diff --git a/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj b/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj index 411195eb..4b71c07a 100644 --- a/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj +++ b/Fonlow.OpenApiClientGen/Fonlow.OpenApiClientGen.csproj @@ -11,7 +11,7 @@ MIT en Copyright © Zijian Huang 2021-$([System.DateTime]::Now.Year) - 3.2.3 + 3.2.4 Swagger, Open API Specification, C#, .NET Core, Web API, TypeScript, Angular, YAML .NET 9 latest-all diff --git a/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs b/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs index 323e57fb..fd36622a 100644 --- a/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs +++ b/OpenApiClientGenCore.NG2FormGroup/CodeObjectHelperForNg2FormGroup.cs @@ -11,12 +11,12 @@ namespace Fonlow.TypeScriptCodeDom public class CodeObjectHelperForNg2FormGroup : CodeObjectHelper { readonly CodeNamespaceCollection codeNamespaceCollection; - readonly bool careForDateOnly; + readonly bool ngDateOnlyFormControlEnabled; - public CodeObjectHelperForNg2FormGroup(CodeNamespaceCollection codeNamespaceCollection, bool careForDateOnly = false) : base(true) + public CodeObjectHelperForNg2FormGroup(CodeNamespaceCollection codeNamespaceCollection, bool ngDateOnlyFormControlEnabled = false) : base(true) { this.codeNamespaceCollection = codeNamespaceCollection; - this.careForDateOnly = careForDateOnly; + this.ngDateOnlyFormControlEnabled = ngDateOnlyFormControlEnabled; } /// @@ -210,6 +210,7 @@ string GetCodeMemberFieldTextForAngularFormGroup(CodeMemberField codeMemberField bool isFieldDateOnly = false; var customAttributes = codeMemberField.CustomAttributes; var fieldName = codeMemberField.Name.EndsWith('?') ? codeMemberField.Name.Substring(0, codeMemberField.Name.Length - 1) : codeMemberField.Name; + var tsTypeName = RefineAngularFormControlTypeName(codeMemberField); FieldTypeInfo fieldTypeInfo = codeMemberField.Type.UserData[UserDataKeys.FieldTypeInfo] as FieldTypeInfo; if (fieldTypeInfo.ClrType == typeof(DateOnly) || fieldTypeInfo.ClrType == typeof(DateOnly?)) { @@ -259,11 +260,11 @@ string GetCodeMemberFieldTextForAngularFormGroup(CodeMemberField codeMemberField Console.WriteLine(); var text = String.Join(", ", validatorList); - var tsTypeName = RefineAngularFormControlTypeName(codeMemberField); + - if (isFieldDateOnly && careForDateOnly) + if (isFieldDateOnly && ngDateOnlyFormControlEnabled) { - return $"{fieldName}: CreateDateOnlyFormControl()"; + return $"{fieldName}: CreateDateOnlyFormControl()"; // DateOnly field is generally with a date picker component, no validator expected? Until someone find a def with validation rules. } else { @@ -273,8 +274,14 @@ string GetCodeMemberFieldTextForAngularFormGroup(CodeMemberField codeMemberField } else { - var tsTypeName = RefineAngularFormControlTypeName(codeMemberField); - return $"{fieldName}: new FormControl<{tsTypeName}>(undefined)"; + if (isFieldDateOnly && ngDateOnlyFormControlEnabled) + { + return $"{fieldName}: CreateDateOnlyFormControl()"; + } + else + { + return $"{fieldName}: new FormControl<{tsTypeName}>(undefined)"; + } } } diff --git a/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj b/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj index 352a5295..717d5cc1 100644 --- a/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj +++ b/OpenApiClientGenCore.NG2FormGroup/OpenApiClientGenCore.NG2FormGroup.csproj @@ -7,7 +7,7 @@ Copyright © Zijian Huang 2021-$([System.DateTime]::Now.Year) Zijian Huang Fonlow.OpenApiClientGen.NG2FormGroup - 2.2 + 2.2.1 latest-all DateOnly FormControl with NgDateOnlyFormControlEnabled diff --git a/Tests/SwagTsTests/AureliaResults/Pet.txt b/Tests/SwagTsTests/AureliaResults/Pet.ts similarity index 96% rename from Tests/SwagTsTests/AureliaResults/Pet.txt rename to Tests/SwagTsTests/AureliaResults/Pet.ts index f7102258..3faa57e3 100644 --- a/Tests/SwagTsTests/AureliaResults/Pet.txt +++ b/Tests/SwagTsTests/AureliaResults/Pet.ts @@ -1,402 +1,402 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - @autoinject() - export class PetClient { - constructor(private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Promise { - return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Promise { - return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return this.http.delete('pet/' + petId, {}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Promise> { - return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class StoreClient { - constructor(private http: HttpClient) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Promise { - return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); - } - } - - @autoinject() - export class UserClient { - constructor(private http: HttpClient) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise { - return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise { - return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise { - return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Promise { - return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Promise { - return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Promise { - return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise { - return this.http.get('user/logout', {}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + @autoinject() + export class PetClient { + constructor(private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Promise { + return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Promise { + return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return this.http.delete('pet/' + petId, {}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Promise> { + return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class StoreClient { + constructor(private http: HttpClient) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Promise { + return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); + } + } + + @autoinject() + export class UserClient { + constructor(private http: HttpClient) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise { + return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise { + return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise { + return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Promise { + return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Promise { + return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Promise { + return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise { + return this.http.get('user/logout', {}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/PetDelete.txt b/Tests/SwagTsTests/AureliaResults/PetDelete.ts similarity index 95% rename from Tests/SwagTsTests/AureliaResults/PetDelete.txt rename to Tests/SwagTsTests/AureliaResults/PetDelete.ts index ae35c5c4..f3ffcd66 100644 --- a/Tests/SwagTsTests/AureliaResults/PetDelete.txt +++ b/Tests/SwagTsTests/AureliaResults/PetDelete.ts @@ -1,22 +1,22 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - @autoinject() - export class PetClient { - constructor(private http: HttpClient) { - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return this.http.delete('pet/' + petId, {}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + @autoinject() + export class PetClient { + constructor(private http: HttpClient) { + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return this.http.delete('pet/' + petId, {}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/PetFindByStatus.txt b/Tests/SwagTsTests/AureliaResults/PetFindByStatus.ts similarity index 96% rename from Tests/SwagTsTests/AureliaResults/PetFindByStatus.txt rename to Tests/SwagTsTests/AureliaResults/PetFindByStatus.ts index 51342496..cf0e16c8 100644 --- a/Tests/SwagTsTests/AureliaResults/PetFindByStatus.txt +++ b/Tests/SwagTsTests/AureliaResults/PetFindByStatus.ts @@ -1,124 +1,124 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - @autoinject() - export class Misc { - constructor(private http: HttpClient) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus2 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus2(status: PetStatus): Promise> { - return this.http.get('pet/findByStatus2?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus3 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus3(status: PetStatus): Promise> { - return this.http.get('pet/findByStatus3?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + @autoinject() + export class Misc { + constructor(private http: HttpClient) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus2 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus2(status: PetStatus): Promise> { + return this.http.get('pet/findByStatus2?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus3 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus3(status: PetStatus): Promise> { + return this.http.get('pet/findByStatus3?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/PetGodClass.txt b/Tests/SwagTsTests/AureliaResults/PetGodClass.ts similarity index 96% rename from Tests/SwagTsTests/AureliaResults/PetGodClass.txt rename to Tests/SwagTsTests/AureliaResults/PetGodClass.ts index 46a1da1a..2796a6f7 100644 --- a/Tests/SwagTsTests/AureliaResults/PetGodClass.txt +++ b/Tests/SwagTsTests/AureliaResults/PetGodClass.ts @@ -1,337 +1,337 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - @autoinject() - export class Misc { - constructor(private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPost(requestBody: Pet): Promise { - return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPut(requestBody: Pet): Promise { - return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - Pet_petIdGet(petId: string): Promise { - return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - Pet_petIdDelete(petId: string): Promise { - return this.http.delete('pet/' + petId, {}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - PetFindByStatusGetByStatus(status: Array): Promise> { - return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - PetFindByTagsGetByTags(tags: Array): Promise> { - return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - StoreInventoryGet(): Promise<{[id: string]: number }> { - return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - StoreOrderPost(requestBody: Order): Promise { - return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - StoreOrder_orderIdGet(orderId: string): Promise { - return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - StoreOrder_orderIdDelete(orderId: string): Promise { - return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - UserPost(requestBody: User): Promise { - return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - User_usernameGet(username: string): Promise { - return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - User_usernamePut(username: string, requestBody: User): Promise { - return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - User_usernameDelete(username: string): Promise { - return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithArrayPost(requestBody: Array): Promise { - return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithListPost(requestBody: Array): Promise { - return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - UserLoginGetByUsernameAndPassword(username: string, password: string): Promise { - return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - UserLogoutGet(): Promise { - return this.http.get('user/logout', {}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + @autoinject() + export class Misc { + constructor(private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPost(requestBody: Pet): Promise { + return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPut(requestBody: Pet): Promise { + return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + Pet_petIdGet(petId: string): Promise { + return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + Pet_petIdDelete(petId: string): Promise { + return this.http.delete('pet/' + petId, {}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + PetFindByStatusGetByStatus(status: Array): Promise> { + return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + PetFindByTagsGetByTags(tags: Array): Promise> { + return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + StoreInventoryGet(): Promise<{[id: string]: number }> { + return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + StoreOrderPost(requestBody: Order): Promise { + return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + StoreOrder_orderIdGet(orderId: string): Promise { + return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + StoreOrder_orderIdDelete(orderId: string): Promise { + return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + UserPost(requestBody: User): Promise { + return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + User_usernameGet(username: string): Promise { + return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + User_usernamePut(username: string, requestBody: User): Promise { + return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + User_usernameDelete(username: string): Promise { + return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithArrayPost(requestBody: Array): Promise { + return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithListPost(requestBody: Array): Promise { + return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + UserLoginGetByUsernameAndPassword(username: string, password: string): Promise { + return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + UserLogoutGet(): Promise { + return this.http.get('user/logout', {}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.txt b/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.ts similarity index 96% rename from Tests/SwagTsTests/AureliaResults/PetPathAsContainer.txt rename to Tests/SwagTsTests/AureliaResults/PetPathAsContainer.ts index baec2e21..76d87d79 100644 --- a/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.txt +++ b/Tests/SwagTsTests/AureliaResults/PetPathAsContainer.ts @@ -1,415 +1,415 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - @autoinject() - export class PetClient { - constructor(private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Post(requestBody: Pet): Promise { - return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Put(requestBody: Pet): Promise { - return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class Pet_petIdClient { - constructor(private http: HttpClient) { - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - GetByPetId(petId: string): Promise { - return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - DeleteByPetId(petId: string): Promise { - return this.http.delete('pet/' + petId, {}); - } - } - - @autoinject() - export class Pet_petIdUploadImageClient { - constructor(private http: HttpClient) { - } - } - - @autoinject() - export class PetFindByStatusClient { - constructor(private http: HttpClient) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - GetByStatus(status: Array): Promise> { - return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class PetFindByTagsClient { - constructor(private http: HttpClient) { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - GetByTags(tags: Array): Promise> { - return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class StoreInventoryClient { - constructor(private http: HttpClient) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - Get(): Promise<{[id: string]: number }> { - return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class StoreOrderClient { - constructor(private http: HttpClient) { - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - Post(requestBody: Order): Promise { - return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class StoreOrder_orderIdClient { - constructor(private http: HttpClient) { - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - GetByOrderId(orderId: string): Promise { - return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - DeleteByOrderId(orderId: string): Promise { - return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); - } - } - - @autoinject() - export class UserClient { - constructor(private http: HttpClient) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - Post(requestBody: User): Promise { - return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class User_usernameClient { - constructor(private http: HttpClient) { - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetByUsername(username: string): Promise { - return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - PutByUsername(username: string, requestBody: User): Promise { - return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteByUsername(username: string): Promise { - return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - } - - @autoinject() - export class UserCreateWithArrayClient { - constructor(private http: HttpClient) { - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Promise { - return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class UserCreateWithListClient { - constructor(private http: HttpClient) { - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Promise { - return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class UserLoginClient { - constructor(private http: HttpClient) { - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - GetByUsernameAndPassword(username: string, password: string): Promise { - return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - } - - @autoinject() - export class UserLogoutClient { - constructor(private http: HttpClient) { - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - Get(): Promise { - return this.http.get('user/logout', {}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + @autoinject() + export class PetClient { + constructor(private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Post(requestBody: Pet): Promise { + return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Put(requestBody: Pet): Promise { + return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class Pet_petIdClient { + constructor(private http: HttpClient) { + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + GetByPetId(petId: string): Promise { + return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + DeleteByPetId(petId: string): Promise { + return this.http.delete('pet/' + petId, {}); + } + } + + @autoinject() + export class Pet_petIdUploadImageClient { + constructor(private http: HttpClient) { + } + } + + @autoinject() + export class PetFindByStatusClient { + constructor(private http: HttpClient) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + GetByStatus(status: Array): Promise> { + return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class PetFindByTagsClient { + constructor(private http: HttpClient) { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + GetByTags(tags: Array): Promise> { + return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class StoreInventoryClient { + constructor(private http: HttpClient) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + Get(): Promise<{[id: string]: number }> { + return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class StoreOrderClient { + constructor(private http: HttpClient) { + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + Post(requestBody: Order): Promise { + return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class StoreOrder_orderIdClient { + constructor(private http: HttpClient) { + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + GetByOrderId(orderId: string): Promise { + return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + DeleteByOrderId(orderId: string): Promise { + return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); + } + } + + @autoinject() + export class UserClient { + constructor(private http: HttpClient) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + Post(requestBody: User): Promise { + return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class User_usernameClient { + constructor(private http: HttpClient) { + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetByUsername(username: string): Promise { + return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + PutByUsername(username: string, requestBody: User): Promise { + return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteByUsername(username: string): Promise { + return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + } + + @autoinject() + export class UserCreateWithArrayClient { + constructor(private http: HttpClient) { + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Promise { + return this.http.post('user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class UserCreateWithListClient { + constructor(private http: HttpClient) { + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Promise { + return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class UserLoginClient { + constructor(private http: HttpClient) { + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + GetByUsernameAndPassword(username: string, password: string): Promise { + return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + } + + @autoinject() + export class UserLogoutClient { + constructor(private http: HttpClient) { + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + Get(): Promise { + return this.http.get('user/logout', {}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/PetStore.txt b/Tests/SwagTsTests/AureliaResults/PetStore.ts similarity index 97% rename from Tests/SwagTsTests/AureliaResults/PetStore.txt rename to Tests/SwagTsTests/AureliaResults/PetStore.ts index 4ec63f75..87e83972 100644 --- a/Tests/SwagTsTests/AureliaResults/PetStore.txt +++ b/Tests/SwagTsTests/AureliaResults/PetStore.ts @@ -1,315 +1,315 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface Order { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity?: number | null; - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - complete?: boolean | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Customer { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - address?: Array
; - } - - export interface Address { - street?: string | null; - city?: string | null; - state?: string | null; - zip?: string | null; - } - - export interface Category { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - firstName?: string | null; - lastName?: string | null; - email?: string | null; - password?: string | null; - phone?: string | null; - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export interface Tag { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface Pet { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Required */ - name: string; - category?: Category; - - /** Required */ - photoUrls: Array; - tags?: Array; - - /** pet status in the store */ - status?: PetStatus | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - @autoinject() - export class PetClient { - constructor(private http: HttpClient) { - } - - /** - * Update an existing pet - * Update an existing pet by Id - * Put pet - * @param {Pet} requestBody Update an existent pet in the store - * @return {Pet} Successful operation - */ - UpdatePet(requestBody: Pet): Promise { - return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Add a new pet to the store - * Add a new pet to the store - * Post pet - * @param {Pet} requestBody Create a new pet in the store - * @return {Pet} Successful operation - */ - AddPet(requestBody: Pet): Promise { - return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: PetStatus | null | undefined): Promise> { - return this.http.get('pet/findByStatus?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array | null | undefined): Promise> { - return this.http.get('pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Updates a pet in the store with form data - * Post pet/{petId} - * @param {string} petId ID of pet that needs to be updated - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @param {string} name Name of pet that needs to be updated - * @param {string} status Status of pet that needs to be updated - * @return {void} - */ - UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise { - return this.http.post('pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, {}); - } - - /** - * Deletes a pet - * delete a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return this.http.delete('pet/' + petId, {}); - } - } - - @autoinject() - export class StoreClient { - constructor(private http: HttpClient) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Place an order for a pet - * Place a new order in the store - * Post store/order - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - * Get store/order/{orderId} - * @param {string} orderId ID of order that needs to be fetched - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeleteOrder(orderId: string): Promise { - return this.http.delete('store/order/' + orderId, {}); - } - } - - @autoinject() - export class UserClient { - constructor(private http: HttpClient) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise { - return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Creates list of users with given input array - * Creates list of users with given input array - * Post user/createWithList - * @return {User} Successful operation - */ - CreateUsersWithListInput(requestBody: Array): Promise { - return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string | null | undefined, password: string | null | undefined): Promise { - return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise { - return this.http.get('user/logout', {}); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Update user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Update an existent user in the store - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise { - return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise { - return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface Order { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity?: number | null; + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + complete?: boolean | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Customer { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + address?: Array
; + } + + export interface Address { + street?: string | null; + city?: string | null; + state?: string | null; + zip?: string | null; + } + + export interface Category { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + firstName?: string | null; + lastName?: string | null; + email?: string | null; + password?: string | null; + phone?: string | null; + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export interface Tag { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface Pet { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Required */ + name: string; + category?: Category; + + /** Required */ + photoUrls: Array; + tags?: Array; + + /** pet status in the store */ + status?: PetStatus | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + @autoinject() + export class PetClient { + constructor(private http: HttpClient) { + } + + /** + * Update an existing pet + * Update an existing pet by Id + * Put pet + * @param {Pet} requestBody Update an existent pet in the store + * @return {Pet} Successful operation + */ + UpdatePet(requestBody: Pet): Promise { + return this.http.put('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Add a new pet to the store + * Add a new pet to the store + * Post pet + * @param {Pet} requestBody Create a new pet in the store + * @return {Pet} Successful operation + */ + AddPet(requestBody: Pet): Promise { + return this.http.post('pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: PetStatus | null | undefined): Promise> { + return this.http.get('pet/findByStatus?status=' + status, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array | null | undefined): Promise> { + return this.http.get('pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Updates a pet in the store with form data + * Post pet/{petId} + * @param {string} petId ID of pet that needs to be updated + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} name Name of pet that needs to be updated + * @param {string} status Status of pet that needs to be updated + * @return {void} + */ + UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise { + return this.http.post('pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, {}); + } + + /** + * Deletes a pet + * delete a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return this.http.delete('pet/' + petId, {}); + } + } + + @autoinject() + export class StoreClient { + constructor(private http: HttpClient) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Place an order for a pet + * Place a new order in the store + * Post store/order + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + * Get store/order/{orderId} + * @param {string} orderId ID of order that needs to be fetched + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeleteOrder(orderId: string): Promise { + return this.http.delete('store/order/' + orderId, {}); + } + } + + @autoinject() + export class UserClient { + constructor(private http: HttpClient) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise { + return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Creates list of users with given input array + * Creates list of users with given input array + * Post user/createWithList + * @return {User} Successful operation + */ + CreateUsersWithListInput(requestBody: Array): Promise { + return this.http.post('user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string | null | undefined, password: string | null | undefined): Promise { + return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise { + return this.http.get('user/logout', {}); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Update user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Update an existent user in the store + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise { + return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise { + return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.txt b/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/PetStoreExpanded.txt rename to Tests/SwagTsTests/AureliaResults/PetStoreExpanded.ts index 40cc9ec4..0299c5ae 100644 --- a/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.txt +++ b/Tests/SwagTsTests/AureliaResults/PetStoreExpanded.ts @@ -1,68 +1,68 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface Pet extends NewPet { - id: string; - } - - export interface NewPet { - name: string; - tag?: string | null; - } - - export interface Error { - code: number; - message: string; - } - - @autoinject() - export class Misc { - constructor(private http: HttpClient) { - } - - /** - * Returns all pets from the system that the user has access to - * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - * Get pets - * @param {Array} tags tags to filter by - * @param {number} limit maximum number of results to return - * @return {Array} pet response - */ - FindPets(tags: Array | null | undefined, limit: number | null | undefined): Promise> { - return this.http.get('pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Creates a new pet in the store. Duplicates are allowed - * Post pets - * @param {NewPet} requestBody Pet to add to the store - * @return {Pet} pet response - */ - AddPet(requestBody: NewPet): Promise { - return this.http.post('pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Returns a user based on a single ID, if the user does not have access to the pet - * Get pets/{id} - * @param {string} id ID of pet to fetch - * @return {Pet} pet response - */ - FindPetById(id: string): Promise { - return this.http.get('pets/' + id, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * deletes a single pet based on the ID supplied - * Delete pets/{id} - * @param {string} id ID of pet to delete - * @return {void} - */ - DeletePet(id: string): Promise { - return this.http.delete('pets/' + id, {}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface Pet extends NewPet { + id: string; + } + + export interface NewPet { + name: string; + tag?: string | null; + } + + export interface Error { + code: number; + message: string; + } + + @autoinject() + export class Misc { + constructor(private http: HttpClient) { + } + + /** + * Returns all pets from the system that the user has access to + * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. + * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. + * Get pets + * @param {Array} tags tags to filter by + * @param {number} limit maximum number of results to return + * @return {Array} pet response + */ + FindPets(tags: Array | null | undefined, limit: number | null | undefined): Promise> { + return this.http.get('pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Creates a new pet in the store. Duplicates are allowed + * Post pets + * @param {NewPet} requestBody Pet to add to the store + * @return {Pet} pet response + */ + AddPet(requestBody: NewPet): Promise { + return this.http.post('pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Returns a user based on a single ID, if the user does not have access to the pet + * Get pets/{id} + * @param {string} id ID of pet to fetch + * @return {Pet} pet response + */ + FindPetById(id: string): Promise { + return this.http.get('pets/' + id, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * deletes a single pet based on the ID supplied + * Delete pets/{id} + * @param {string} id ID of pet to delete + * @return {void} + */ + DeletePet(id: string): Promise { + return this.http.delete('pets/' + id, {}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/Uspto.txt b/Tests/SwagTsTests/AureliaResults/Uspto.ts similarity index 97% rename from Tests/SwagTsTests/AureliaResults/Uspto.txt rename to Tests/SwagTsTests/AureliaResults/Uspto.ts index 5ef6ac99..fcf5ec9c 100644 --- a/Tests/SwagTsTests/AureliaResults/Uspto.txt +++ b/Tests/SwagTsTests/AureliaResults/Uspto.ts @@ -1,58 +1,58 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface DataSetList { - total?: number | null; - DataSetListApis?: Array; - } - - export interface DataSetListApis { - - /** To be used as a dataset parameter value */ - apiKey?: string | null; - - /** To be used as a version parameter value */ - apiVersionNumber?: string | null; - - /** The URL describing the dataset's fields */ - apiUrl?: string | null; - - /** A URL to the API console for each API */ - apiDocumentationUrl?: string | null; - } - - @autoinject() - export class MetadataClient { - constructor(private http: HttpClient) { - } - - /** - * List available data sets - * Get - * @return {DataSetList} Returns a list of data sets - */ - ListDataSets(): Promise { - return this.http.get('', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Provides the general information about the API and the list of fields that can be used to query the dataset. - * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. - * Get {dataset}/{version}/fields - * @param {string} dataset Name of the dataset. - * @param {string} version Version of the dataset. - * @return {string} The dataset API for the given version is found and it is accessible to consume. - */ - ListSearchableFields(dataset: string, version: string): Promise { - return this.http.get('' + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - } - - @autoinject() - export class SearchClient { - constructor(private http: HttpClient) { - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface DataSetList { + total?: number | null; + DataSetListApis?: Array; + } + + export interface DataSetListApis { + + /** To be used as a dataset parameter value */ + apiKey?: string | null; + + /** To be used as a version parameter value */ + apiVersionNumber?: string | null; + + /** The URL describing the dataset's fields */ + apiUrl?: string | null; + + /** A URL to the API console for each API */ + apiDocumentationUrl?: string | null; + } + + @autoinject() + export class MetadataClient { + constructor(private http: HttpClient) { + } + + /** + * List available data sets + * Get + * @return {DataSetList} Returns a list of data sets + */ + ListDataSets(): Promise { + return this.http.get('', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Provides the general information about the API and the list of fields that can be used to query the dataset. + * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. + * Get {dataset}/{version}/fields + * @param {string} dataset Name of the dataset. + * @param {string} version Version of the dataset. + * @return {string} The dataset API for the given version is found and it is accessible to consume. + */ + ListSearchableFields(dataset: string, version: string): Promise { + return this.http.get('' + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + } + + @autoinject() + export class SearchClient { + constructor(private http: HttpClient) { + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/ValuesPaths.txt b/Tests/SwagTsTests/AureliaResults/ValuesPaths.ts similarity index 96% rename from Tests/SwagTsTests/AureliaResults/ValuesPaths.txt rename to Tests/SwagTsTests/AureliaResults/ValuesPaths.ts index bd710d8a..96f499d1 100644 --- a/Tests/SwagTsTests/AureliaResults/ValuesPaths.txt +++ b/Tests/SwagTsTests/AureliaResults/ValuesPaths.ts @@ -1,54 +1,54 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - @autoinject() - export class ValuesClient { - constructor(private http: HttpClient) { - } - - /** - * Get api/Values - * @return {Array} Success - */ - ValuesGet(): Promise> { - return this.http.get('api/Values', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Post api/Values - * @return {string} Success - */ - ValuesPost(requestBody: string): Promise { - return this.http.post('api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * Get api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {string} Success - */ - ValuesGetById(id: number): Promise { - return this.http.get('api/Values/' + id, {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * Put api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesPutById(id: number, requestBody: string): Promise { - return this.http.put('api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Delete api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesDeleteById(id: number): Promise { - return this.http.delete('api/Values/' + id, {}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + @autoinject() + export class ValuesClient { + constructor(private http: HttpClient) { + } + + /** + * Get api/Values + * @return {Array} Success + */ + ValuesGet(): Promise> { + return this.http.get('api/Values', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Post api/Values + * @return {string} Success + */ + ValuesPost(requestBody: string): Promise { + return this.http.post('api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * Get api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {string} Success + */ + ValuesGetById(id: number): Promise { + return this.http.get('api/Values/' + id, {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * Put api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesPutById(id: number, requestBody: string): Promise { + return this.http.put('api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Delete api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesDeleteById(id: number): Promise { + return this.http.delete('api/Values/' + id, {}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/mcp.txt b/Tests/SwagTsTests/AureliaResults/mcp.ts similarity index 97% rename from Tests/SwagTsTests/AureliaResults/mcp.txt rename to Tests/SwagTsTests/AureliaResults/mcp.ts index 3b827c99..710098a0 100644 --- a/Tests/SwagTsTests/AureliaResults/mcp.txt +++ b/Tests/SwagTsTests/AureliaResults/mcp.ts @@ -1,888 +1,888 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface BBSReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface ProviderType { - providerNumber: string; - } - - export interface BBSPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface PaymentRunType { - payerName?: string | null; - runDate?: Date | null; - runNumber?: string | null; - } - - export interface PaymentType { - accountInfo: BankAccountType; - depositAmount?: string | null; - paymentReference?: string | null; - } - - export interface BankAccountType { - accountName?: string | null; - accountNumber?: string | null; - bsbCode?: string | null; - } - - export interface ClaimSummaryType { - accountReferenceId?: string | null; - benefit?: string | null; - chargeAmount?: string | null; - claimChannelCode?: string | null; - claimId?: string | null; - lodgementDate?: Date | null; - transactionId?: string | null; - } - - export interface ServiceMessagesType { - highestSeverity: ServiceMessagesTypeHighestSeverity; - serviceMessage: Array; - } - - export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } - - export interface ServiceMessageType { - code: string; - severity: ServiceMessagesTypeHighestSeverity; - reason: string; - } - - export interface BBSProcessingReportResponseType { - claimAssessment?: ClaimAssessmentType; - status: string; - } - - export interface ClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface MedicalEventResponseType { - patient?: MembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface MembershipStatusType { - status?: StatusType; - currentMembership?: MembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface StatusType { - code?: number | null; - text?: string | null; - } - - export interface MembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - } - - export interface IdentityType { - dateOfBirth?: Date | null; - familyName?: string | null; - givenName?: string | null; - secondInitial?: string | null; - sex?: string | null; - } - - export interface ServiceResponseType { - error?: StatusType; - id?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface BulkBillStoreForwardRequestType { - claim: BulkBillClaimStoreForwardClaimType; - } - - export interface BulkBillClaimStoreForwardClaimType { - facilityId?: string | null; - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface BBSMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - medicalEventDate: Date; - medicalEventTime?: string | null; - patient: MedicarePatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface MedicarePatientType { - identity: IdentityType; - medicare: MembershipType; - } - - export interface ReferralType { - issueDate: Date; - period?: string | null; - periodCode?: string | null; - provider: ProviderType; - typeCode: string; - } - - export interface ServiceType { - id: string; - accessionDateTime?: Date | null; - aftercareOverrideInd?: string | null; - chargeAmount?: string | null; - collectionDateTime?: Date | null; - duplicateServiceOverrideInd?: string | null; - fieldQuantity?: string | null; - itemNumber?: string | null; - lspNumber?: string | null; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - restrictiveOverrideCode?: string | null; - rule3ExemptInd?: string | null; - s4b3ExemptInd?: string | null; - scpId?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - } - - export interface BulkBillStoreForwardResponseType { - claimId: string; - status: string; - } - - export interface AlliedHealthClaimRequestType { - claim: VAAClaimType; - } - - export interface VAAClaimType { - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface VAAMedicalEventType { - id: string; - acceptedDisability?: AcceptedDisabilityType; - authorisationDate: Date; - breakInEpisodeEndDate?: Date | null; - breakInEpisodeOfCareNumber?: string | null; - breakInEpisodeStartDate?: Date | null; - numberOfCNCHours?: string | null; - numberOfCNCVisits?: string | null; - createDateTime: Date; - numberOfENHours?: string | null; - numberOfENVisits?: string | null; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - numberOfNSSHours?: string | null; - numberOfNSSVisits?: string | null; - patient: VeteranPatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - numberOfRNHours?: string | null; - numberOfRNVisits?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface AcceptedDisabilityType { - code: string; - ind: string; - } - - export interface VAAServiceType { - id: string; - accountReferenceNumber?: string | null; - admissionDate?: Date | null; - chargeAmount?: string | null; - dischargeDate?: Date | null; - distanceKilometres?: number | null; - duplicateServiceOverrideInd?: string | null; - itemNumber: string; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - numberOfTeeth?: string | null; - opticalScriptCode?: string | null; - restrictiveOverrideCode?: string | null; - secondDeviceInd?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - toothNumber?: string | null; - upperLowerJawCode?: string | null; - } - - export interface VeteranPatientType extends PatientType { - veteranMembership?: VeteranMembershipType; - } - - export interface VeteranMembershipType { - veteranNumber: string; - } - - export interface PatientType { - identity: IdentityType; - residentialAddress?: AddressType; - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postcode?: string | null; - } - - export interface AlliedHealthClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAClaimRequestType { - claim: DVAClaimType; - } - - export interface DVAClaimType { - hospitalInd?: string | null; - serviceTypeCode: string; - medicalEvent: Array; - serviceProvider: ProviderType; - payeeProvider?: ProviderType; - } - - export interface DVAMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - referralOverrideCode?: string | null; - submissionAuthorityInd: string; - treatmentLocationCode?: string | null; - acceptedDisability?: AcceptedDisabilityType; - referral?: ReferralType; - patient: VeteranPatientType; - service: Array; - } - - export interface DVAServiceType extends ServiceType { - accountReferenceNumber?: string | null; - distanceKilometres?: number | null; - } - - export interface DVAClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface DVAPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface DVAProcessingReportResponseType { - claimAssessment?: DVAClaimAssessmentType; - status: string; - } - - export interface DVAClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface DVAMedicalEventAssessmentType { - patient?: VeteranMembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface VeteranMembershipStatusType { - currentMembership?: VeteranMembershipResponseType; - currentMember?: IdentityType; - status?: StatusType; - processDate?: Date | null; - } - - export interface DVAServiceAssessmentType { - id?: string | null; - accountReferenceNumber?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - gstInd?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface VeteranMembershipResponseType extends VeteranMembershipType { - entitlementCode?: string | null; - } - - export interface EnterpriseConcessionVerificationRequestType { - timeout?: number | null; - concessionVerificationRequest: Array; - } - - export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { - id: string; - } - - export interface ConcessionVerificationRequestType { - patient: MedicarePatientType; - dateOfService?: Date | null; - } - - export interface EnterpriseConcessionVerificationResponseType { - status: string; - concessionVerificationResponse?: Array; - } - - export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { - id: string; - } - - export interface ConcessionVerificationResponseType { - medicareStatus: MembershipStatusType; - concessionStatus: ConcessionStatusType; - } - - export interface ConcessionStatusType { - status?: StatusType; - processDate?: Date | null; - } - - export interface EnterprisePatientVerificationRequestType { - timeout?: number | null; - patientVerificationRequest: Array; - } - - export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { - id: string; - } - - export interface PatientVerificationRequestType { - patient: FundPatientType; - provider?: ProviderType; - dateOfService?: Date | null; - typeCode: string; - } - - export interface FundPatientType extends PatientType { - alsoKnownAs?: IdentityType; - medicare?: MembershipType; - healthFund?: FundMembershipType; - } - - export interface FundMembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - organisation?: string | null; - } - - export interface EnterprisePatientVerificationResponseType { - status: string; - patientVerificationResponse?: Array; - } - - export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { - id: string; - } - - export interface PatientVerificationResponseType { - medicareStatus?: MembershipStatusType; - healthFundStatus?: FundMembershipStatusType; - } - - export interface FundMembershipStatusType { - status?: StatusType; - currentMembership?: FundMembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface EnterpriseVeteranVerificationRequestType { - timeout?: number | null; - veteranVerificationRequest: Array; - } - - export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { - id: string; - } - - export interface VeteranVerificationRequestType { - patient: VeteranPatientType; - } - - export interface EnterpriseVeteranVerificationResponseType { - status: string; - veteranVerificationResponse?: Array; - } - - export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { - id?: string | null; - } - - export interface VeteranVerificationResponseType { - veteranStatus?: VeteranMembershipStatusType; - } - - export interface PatientClaimInteractiveRequestType { - patientClaimInteractive: PatientClaimInteractiveType; - } - - export interface PatientClaimInteractiveType { - patient: MedicarePatientType; - referral?: ReferralType; - claimant: ClaimantType; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - referralOverrideCode?: string | null; - accountPaidInd: string; - accountReferenceId?: string | null; - submissionAuthorityInd: string; - authorisationDate: Date; - } - - export interface PCIMedicalEventType { - service: Array; - id: string; - medicalEventDate: Date; - medicalEventTime?: string | null; - } - - export interface PCIServiceType extends ServiceType { - patientContribAmount?: string | null; - facilityId?: string | null; - hospitalInd?: string | null; - } - - export interface ClaimantType extends MedicarePatientType { - eftDetails?: BankAccountType; - residentialAddress?: AddressType; - contactDetails?: ContactType; - } - - export interface ContactType { - emailAddress?: string | null; - name?: string | null; - phoneNumber?: string | null; - } - - export interface PatientClaimInteractiveResponseType { - claimAssessment: PCIAssessmentType; - status: string; - } - - export interface PCIAssessmentType { - claimant?: CurrentMembershipType; - patient?: CurrentMembershipType; - medicalEvent?: Array; - error?: StatusType; - claimId: string; - } - - export interface CurrentMembershipType { - currentMembership: MembershipType; - } - - export interface PCIMedicalEventResponseType { - service?: Array; - eventDate?: Date | null; - id?: string | null; - } - - export interface RetrieveReportRequestType { - transactionId: Array; - } - - export interface RetrieveReportResponseType { - content?: Array; - } - - export interface ContentType { - transactionId?: string | null; - status?: string | null; - } - - export interface EnterpriseConcessionVerificationReportContentType extends ContentType { - report?: EnterpriseConcessionVerificationResponseType; - } - - export interface EnterprisePatientVerificationReportContentType extends ContentType { - report?: EnterprisePatientVerificationResponseType; - } - - export interface EnterpriseVeteranVerificationReportContentType extends ContentType { - report?: EnterpriseVeteranVerificationResponseType; - } - - export interface SameDayDeleteRequestType { - sameDayDelete: SameDayDeleteType; - } - - export interface SameDayDeleteType { - patient: MedicarePatientType; - reasonCode: string; - } - - export interface SameDayDeleteResponseType { - status: string; - } - - export interface StatusReportRequestType { - transactionId?: Array; - associateName?: string | null; - fromDateTime?: Date | null; - toDateTime?: Date | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - status?: string | null; - } - - export interface StatusReportResponseType { - transactionStatus?: Array; - status: string; - } - - export interface TransactionStatusType { - associateName?: string | null; - lodgementDateTime?: Date | null; - processStatus?: string | null; - reference?: string | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - transactionId?: string | null; - } - - @autoinject() - export class McpClient { - constructor(private http: HttpClient) { - } - - /** - * This is the request - * Post mcp/bulkbillpaymentreport/v1 - * @return {BBSPaymentReportResponseType} successful operation - */ - McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Promise { - return this.http.post('mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillprocessingreport/v1 - * @return {BBSProcessingReportResponseType} successful operation - */ - McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Promise { - return this.http.post('mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/general/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return this.http.post('mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/pathology/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return this.http.post('mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/specialist/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return this.http.post('mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/allied/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return this.http.post('mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/communitynursing/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return this.http.post('mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/dental/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return this.http.post('mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/optical/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return this.http.post('mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/psych/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return this.http.post('mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/speechpathology/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return this.http.post('mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/general/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Promise { - return this.http.post('mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/pathology/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Promise { - return this.http.post('mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/specialist/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Promise { - return this.http.post('mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvapaymentreport/v1 - * @return {DVAPaymentReportResponseType} successful operation - */ - McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Promise { - return this.http.post('mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/dvaprocessingreport/v1 - * @return {DVAProcessingReportResponseType} successful operation - */ - McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Promise { - return this.http.post('mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/v1 - * @return {EnterpriseConcessionVerificationResponseType} successful operation - */ - McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Promise { - return this.http.post('mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/v1 - * @return {EnterprisePatientVerificationResponseType} successful operation - */ - McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Promise { - return this.http.post('mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/v1 - * @return {EnterpriseVeteranVerificationResponseType} successful operation - */ - McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Promise { - return this.http.post('mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/general/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return this.http.post('mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/pathology/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return this.http.post('mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/specialist/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return this.http.post('mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Promise { - return this.http.post('mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/hf/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Promise { - return this.http.post('mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/medicare/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Promise { - return this.http.post('mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return this.http.post('mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return this.http.post('mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return this.http.post('mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/samedaydelete/v1 - * @return {SameDayDeleteResponseType} successful operation - */ - McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Promise { - return this.http.post('mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/statusreport/v1 - * @return {StatusReportResponseType} successful operation - */ - McpStatusReport1Eigw(requestBody: StatusReportRequestType): Promise { - return this.http.post('mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This is the request - * Post mcp/veteranverification/v1 - * @return {VeteranVerificationResponseType} successful operation - */ - McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Promise { - return this.http.post('mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface BBSReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface ProviderType { + providerNumber: string; + } + + export interface BBSPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface PaymentRunType { + payerName?: string | null; + runDate?: Date | null; + runNumber?: string | null; + } + + export interface PaymentType { + accountInfo: BankAccountType; + depositAmount?: string | null; + paymentReference?: string | null; + } + + export interface BankAccountType { + accountName?: string | null; + accountNumber?: string | null; + bsbCode?: string | null; + } + + export interface ClaimSummaryType { + accountReferenceId?: string | null; + benefit?: string | null; + chargeAmount?: string | null; + claimChannelCode?: string | null; + claimId?: string | null; + lodgementDate?: Date | null; + transactionId?: string | null; + } + + export interface ServiceMessagesType { + highestSeverity: ServiceMessagesTypeHighestSeverity; + serviceMessage: Array; + } + + export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } + + export interface ServiceMessageType { + code: string; + severity: ServiceMessagesTypeHighestSeverity; + reason: string; + } + + export interface BBSProcessingReportResponseType { + claimAssessment?: ClaimAssessmentType; + status: string; + } + + export interface ClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface MedicalEventResponseType { + patient?: MembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface MembershipStatusType { + status?: StatusType; + currentMembership?: MembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface StatusType { + code?: number | null; + text?: string | null; + } + + export interface MembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + } + + export interface IdentityType { + dateOfBirth?: Date | null; + familyName?: string | null; + givenName?: string | null; + secondInitial?: string | null; + sex?: string | null; + } + + export interface ServiceResponseType { + error?: StatusType; + id?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface BulkBillStoreForwardRequestType { + claim: BulkBillClaimStoreForwardClaimType; + } + + export interface BulkBillClaimStoreForwardClaimType { + facilityId?: string | null; + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface BBSMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + medicalEventDate: Date; + medicalEventTime?: string | null; + patient: MedicarePatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface MedicarePatientType { + identity: IdentityType; + medicare: MembershipType; + } + + export interface ReferralType { + issueDate: Date; + period?: string | null; + periodCode?: string | null; + provider: ProviderType; + typeCode: string; + } + + export interface ServiceType { + id: string; + accessionDateTime?: Date | null; + aftercareOverrideInd?: string | null; + chargeAmount?: string | null; + collectionDateTime?: Date | null; + duplicateServiceOverrideInd?: string | null; + fieldQuantity?: string | null; + itemNumber?: string | null; + lspNumber?: string | null; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + restrictiveOverrideCode?: string | null; + rule3ExemptInd?: string | null; + s4b3ExemptInd?: string | null; + scpId?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + } + + export interface BulkBillStoreForwardResponseType { + claimId: string; + status: string; + } + + export interface AlliedHealthClaimRequestType { + claim: VAAClaimType; + } + + export interface VAAClaimType { + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface VAAMedicalEventType { + id: string; + acceptedDisability?: AcceptedDisabilityType; + authorisationDate: Date; + breakInEpisodeEndDate?: Date | null; + breakInEpisodeOfCareNumber?: string | null; + breakInEpisodeStartDate?: Date | null; + numberOfCNCHours?: string | null; + numberOfCNCVisits?: string | null; + createDateTime: Date; + numberOfENHours?: string | null; + numberOfENVisits?: string | null; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + numberOfNSSHours?: string | null; + numberOfNSSVisits?: string | null; + patient: VeteranPatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + numberOfRNHours?: string | null; + numberOfRNVisits?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface AcceptedDisabilityType { + code: string; + ind: string; + } + + export interface VAAServiceType { + id: string; + accountReferenceNumber?: string | null; + admissionDate?: Date | null; + chargeAmount?: string | null; + dischargeDate?: Date | null; + distanceKilometres?: number | null; + duplicateServiceOverrideInd?: string | null; + itemNumber: string; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + numberOfTeeth?: string | null; + opticalScriptCode?: string | null; + restrictiveOverrideCode?: string | null; + secondDeviceInd?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + toothNumber?: string | null; + upperLowerJawCode?: string | null; + } + + export interface VeteranPatientType extends PatientType { + veteranMembership?: VeteranMembershipType; + } + + export interface VeteranMembershipType { + veteranNumber: string; + } + + export interface PatientType { + identity: IdentityType; + residentialAddress?: AddressType; + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postcode?: string | null; + } + + export interface AlliedHealthClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAClaimRequestType { + claim: DVAClaimType; + } + + export interface DVAClaimType { + hospitalInd?: string | null; + serviceTypeCode: string; + medicalEvent: Array; + serviceProvider: ProviderType; + payeeProvider?: ProviderType; + } + + export interface DVAMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + referralOverrideCode?: string | null; + submissionAuthorityInd: string; + treatmentLocationCode?: string | null; + acceptedDisability?: AcceptedDisabilityType; + referral?: ReferralType; + patient: VeteranPatientType; + service: Array; + } + + export interface DVAServiceType extends ServiceType { + accountReferenceNumber?: string | null; + distanceKilometres?: number | null; + } + + export interface DVAClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface DVAPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface DVAProcessingReportResponseType { + claimAssessment?: DVAClaimAssessmentType; + status: string; + } + + export interface DVAClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface DVAMedicalEventAssessmentType { + patient?: VeteranMembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface VeteranMembershipStatusType { + currentMembership?: VeteranMembershipResponseType; + currentMember?: IdentityType; + status?: StatusType; + processDate?: Date | null; + } + + export interface DVAServiceAssessmentType { + id?: string | null; + accountReferenceNumber?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + gstInd?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface VeteranMembershipResponseType extends VeteranMembershipType { + entitlementCode?: string | null; + } + + export interface EnterpriseConcessionVerificationRequestType { + timeout?: number | null; + concessionVerificationRequest: Array; + } + + export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { + id: string; + } + + export interface ConcessionVerificationRequestType { + patient: MedicarePatientType; + dateOfService?: Date | null; + } + + export interface EnterpriseConcessionVerificationResponseType { + status: string; + concessionVerificationResponse?: Array; + } + + export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { + id: string; + } + + export interface ConcessionVerificationResponseType { + medicareStatus: MembershipStatusType; + concessionStatus: ConcessionStatusType; + } + + export interface ConcessionStatusType { + status?: StatusType; + processDate?: Date | null; + } + + export interface EnterprisePatientVerificationRequestType { + timeout?: number | null; + patientVerificationRequest: Array; + } + + export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { + id: string; + } + + export interface PatientVerificationRequestType { + patient: FundPatientType; + provider?: ProviderType; + dateOfService?: Date | null; + typeCode: string; + } + + export interface FundPatientType extends PatientType { + alsoKnownAs?: IdentityType; + medicare?: MembershipType; + healthFund?: FundMembershipType; + } + + export interface FundMembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + organisation?: string | null; + } + + export interface EnterprisePatientVerificationResponseType { + status: string; + patientVerificationResponse?: Array; + } + + export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { + id: string; + } + + export interface PatientVerificationResponseType { + medicareStatus?: MembershipStatusType; + healthFundStatus?: FundMembershipStatusType; + } + + export interface FundMembershipStatusType { + status?: StatusType; + currentMembership?: FundMembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface EnterpriseVeteranVerificationRequestType { + timeout?: number | null; + veteranVerificationRequest: Array; + } + + export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { + id: string; + } + + export interface VeteranVerificationRequestType { + patient: VeteranPatientType; + } + + export interface EnterpriseVeteranVerificationResponseType { + status: string; + veteranVerificationResponse?: Array; + } + + export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { + id?: string | null; + } + + export interface VeteranVerificationResponseType { + veteranStatus?: VeteranMembershipStatusType; + } + + export interface PatientClaimInteractiveRequestType { + patientClaimInteractive: PatientClaimInteractiveType; + } + + export interface PatientClaimInteractiveType { + patient: MedicarePatientType; + referral?: ReferralType; + claimant: ClaimantType; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + referralOverrideCode?: string | null; + accountPaidInd: string; + accountReferenceId?: string | null; + submissionAuthorityInd: string; + authorisationDate: Date; + } + + export interface PCIMedicalEventType { + service: Array; + id: string; + medicalEventDate: Date; + medicalEventTime?: string | null; + } + + export interface PCIServiceType extends ServiceType { + patientContribAmount?: string | null; + facilityId?: string | null; + hospitalInd?: string | null; + } + + export interface ClaimantType extends MedicarePatientType { + eftDetails?: BankAccountType; + residentialAddress?: AddressType; + contactDetails?: ContactType; + } + + export interface ContactType { + emailAddress?: string | null; + name?: string | null; + phoneNumber?: string | null; + } + + export interface PatientClaimInteractiveResponseType { + claimAssessment: PCIAssessmentType; + status: string; + } + + export interface PCIAssessmentType { + claimant?: CurrentMembershipType; + patient?: CurrentMembershipType; + medicalEvent?: Array; + error?: StatusType; + claimId: string; + } + + export interface CurrentMembershipType { + currentMembership: MembershipType; + } + + export interface PCIMedicalEventResponseType { + service?: Array; + eventDate?: Date | null; + id?: string | null; + } + + export interface RetrieveReportRequestType { + transactionId: Array; + } + + export interface RetrieveReportResponseType { + content?: Array; + } + + export interface ContentType { + transactionId?: string | null; + status?: string | null; + } + + export interface EnterpriseConcessionVerificationReportContentType extends ContentType { + report?: EnterpriseConcessionVerificationResponseType; + } + + export interface EnterprisePatientVerificationReportContentType extends ContentType { + report?: EnterprisePatientVerificationResponseType; + } + + export interface EnterpriseVeteranVerificationReportContentType extends ContentType { + report?: EnterpriseVeteranVerificationResponseType; + } + + export interface SameDayDeleteRequestType { + sameDayDelete: SameDayDeleteType; + } + + export interface SameDayDeleteType { + patient: MedicarePatientType; + reasonCode: string; + } + + export interface SameDayDeleteResponseType { + status: string; + } + + export interface StatusReportRequestType { + transactionId?: Array; + associateName?: string | null; + fromDateTime?: Date | null; + toDateTime?: Date | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + status?: string | null; + } + + export interface StatusReportResponseType { + transactionStatus?: Array; + status: string; + } + + export interface TransactionStatusType { + associateName?: string | null; + lodgementDateTime?: Date | null; + processStatus?: string | null; + reference?: string | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + transactionId?: string | null; + } + + @autoinject() + export class McpClient { + constructor(private http: HttpClient) { + } + + /** + * This is the request + * Post mcp/bulkbillpaymentreport/v1 + * @return {BBSPaymentReportResponseType} successful operation + */ + McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Promise { + return this.http.post('mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillprocessingreport/v1 + * @return {BBSProcessingReportResponseType} successful operation + */ + McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Promise { + return this.http.post('mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/general/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return this.http.post('mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/pathology/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return this.http.post('mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/specialist/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return this.http.post('mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/allied/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return this.http.post('mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/communitynursing/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return this.http.post('mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/dental/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return this.http.post('mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/optical/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return this.http.post('mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/psych/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return this.http.post('mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/speechpathology/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return this.http.post('mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/general/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Promise { + return this.http.post('mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/pathology/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Promise { + return this.http.post('mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/specialist/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Promise { + return this.http.post('mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvapaymentreport/v1 + * @return {DVAPaymentReportResponseType} successful operation + */ + McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Promise { + return this.http.post('mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/dvaprocessingreport/v1 + * @return {DVAProcessingReportResponseType} successful operation + */ + McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Promise { + return this.http.post('mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/v1 + * @return {EnterpriseConcessionVerificationResponseType} successful operation + */ + McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Promise { + return this.http.post('mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/v1 + * @return {EnterprisePatientVerificationResponseType} successful operation + */ + McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Promise { + return this.http.post('mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/v1 + * @return {EnterpriseVeteranVerificationResponseType} successful operation + */ + McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Promise { + return this.http.post('mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/general/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return this.http.post('mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/pathology/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return this.http.post('mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/specialist/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return this.http.post('mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Promise { + return this.http.post('mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/hf/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Promise { + return this.http.post('mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/medicare/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Promise { + return this.http.post('mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return this.http.post('mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return this.http.post('mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return this.http.post('mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/samedaydelete/v1 + * @return {SameDayDeleteResponseType} successful operation + */ + McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Promise { + return this.http.post('mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/statusreport/v1 + * @return {StatusReportResponseType} successful operation + */ + McpStatusReport1Eigw(requestBody: StatusReportRequestType): Promise { + return this.http.post('mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This is the request + * Post mcp/veteranverification/v1 + * @return {VeteranVerificationResponseType} successful operation + */ + McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Promise { + return this.http.post('mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/redocOpenApi200501.txt b/Tests/SwagTsTests/AureliaResults/redocOpenApi200501.ts similarity index 96% rename from Tests/SwagTsTests/AureliaResults/redocOpenApi200501.txt rename to Tests/SwagTsTests/AureliaResults/redocOpenApi200501.ts index df7b6e79..8fe2f31e 100644 --- a/Tests/SwagTsTests/AureliaResults/redocOpenApi200501.txt +++ b/Tests/SwagTsTests/AureliaResults/redocOpenApi200501.ts @@ -1,425 +1,425 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1.0 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1.0 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - @autoinject() - export class PetClient { - constructor(private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @return {void} - */ - AddPet(): Promise { - return this.http.post('pet', null, {}); - } - - /** - * Update an existing pet - * Put pet - * @return {void} - */ - UpdatePet(): Promise { - return this.http.put('pet', null, {}); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return this.http.delete('pet/' + petId, {}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Promise> { - return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class StoreClient { - constructor(private http: HttpClient) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1.0 Maximum: 5.0 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1.0 - * @return {void} - */ - DeleteOrder(orderId: string): Promise { - return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); - } - - /** - * Subscribe to the Store events - * Add subscription for a store events - * Post store/subscribe - * @return {void} - */ - Subscribe(requestBody: SubscribePostBody): Promise { - return this.http.post('store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class UserClient { - constructor(private http: HttpClient) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise { - return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise { - return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise { - return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @return {void} - */ - CreateUsersWithArrayInput(): Promise { - return this.http.post('user/createWithArray', null, {}); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @return {void} - */ - CreateUsersWithListInput(): Promise { - return this.http.post('user/createWithList', null, {}); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Promise { - return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise { - return this.http.get('user/logout', {}); - } - } - - export interface SubscribePostBody { - - /** - * This URL will be called by the server when the desired event will occur - * Required - */ - callbackUrl: string; - - /** - * Event name for the subscription - * Required - */ - eventName: SubscribePostBodyEventName; - } - - export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1.0 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1.0 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + @autoinject() + export class PetClient { + constructor(private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @return {void} + */ + AddPet(): Promise { + return this.http.post('pet', null, {}); + } + + /** + * Update an existing pet + * Put pet + * @return {void} + */ + UpdatePet(): Promise { + return this.http.put('pet', null, {}); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return this.http.get('pet/' + petId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return this.http.delete('pet/' + petId, {}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return this.http.get('pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Promise> { + return this.http.get('pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class StoreClient { + constructor(private http: HttpClient) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return this.http.get('store/inventory', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return this.http.post('store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1.0 Maximum: 5.0 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return this.http.get('store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1.0 + * @return {void} + */ + DeleteOrder(orderId: string): Promise { + return this.http.delete('store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), {}); + } + + /** + * Subscribe to the Store events + * Add subscription for a store events + * Post store/subscribe + * @return {void} + */ + Subscribe(requestBody: SubscribePostBody): Promise { + return this.http.post('store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class UserClient { + constructor(private http: HttpClient) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise { + return this.http.post('user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return this.http.get('user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise { + return this.http.put('user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise { + return this.http.delete('user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @return {void} + */ + CreateUsersWithArrayInput(): Promise { + return this.http.post('user/createWithArray', null, {}); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @return {void} + */ + CreateUsersWithListInput(): Promise { + return this.http.post('user/createWithList', null, {}); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Promise { + return this.http.get('user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise { + return this.http.get('user/logout', {}); + } + } + + export interface SubscribePostBody { + + /** + * This URL will be called by the server when the desired event will occur + * Required + */ + callbackUrl: string; + + /** + * Event name for the subscription + * Required + */ + eventName: SubscribePostBodyEventName; + } + + export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_account.txt b/Tests/SwagTsTests/AureliaResults/sell_account.ts similarity index 99% rename from Tests/SwagTsTests/AureliaResults/sell_account.txt rename to Tests/SwagTsTests/AureliaResults/sell_account.ts index 308430c9..1eb3773b 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_account.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_account.ts @@ -1,1162 +1,1162 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ - export interface CategoryType { - - /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ - default?: boolean | null; - - /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ - name?: string | null; - } - - - /** A container that describes the details of a deposit. Used only with motor listings. */ - export interface Deposit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - dueIn?: TimeDuration; - - /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ - paymentMethods?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ - export interface PaymentMethod { - - /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ - brands?: Array; - - /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ - paymentMethodType?: string | null; - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - recipientAccountReference?: RecipientAccountReference; - } - - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - export interface RecipientAccountReference { - - /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ - referenceId?: string | null; - - /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ - referenceType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface FulfillmentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ - export interface ShippingOption { - - /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ - costType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - insuranceFee?: Amount; - - /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ - insuranceOffered?: boolean | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ - optionType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - packageHandlingCost?: Amount; - - /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ - rateTableId?: string | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ - shippingServices?: Array; - } - - - /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ - export interface ShippingService { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalShippingCost?: Amount; - - /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForPickup?: boolean | null; - - /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForShipping?: boolean | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - cashOnDeliveryFee?: Amount; - - /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ - freeShipping?: boolean | null; - - /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ - shippingCarrierCode?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - shippingCost?: Amount; - - /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ - shippingServiceCode?: string | null; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** - * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - sortOrder?: number | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - surcharge?: Amount; - } - - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - export interface RegionSet { - - /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ - regionExcluded?: Array; - - /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ - regionIncluded?: Array; - } - - - /** This type defines information for a region. */ - export interface Region { - - /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ - regionName?: string | null; - - /** Reserved for future use. For implementation help, refer to eBay API documentation */ - regionType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface FulfillmentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** The response payload for requests that return a list of fulfillment policies. */ - export interface FulfillmentPolicyResponse { - - /** A list of the seller's fulfillment policies. */ - fulfillmentPolicies?: Array; - - /** Returns a URL link to the result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - export interface InternationalReturnOverrideType { - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ - returnsAccepted?: boolean | null; - - /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface PaymentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - } - - - /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface PaymentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - } - - - /** The response payload for payment policy requests. */ - export interface PaymentPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** A list of the seller's payment policies. */ - paymentPolicies?: Array; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object containing the sellers status with regards to the specified payment program. */ - export interface PaymentsProgramResponse { - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ - paymentsProgramType?: string | null; - - /** For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ - wasPreviouslyOptedIn?: boolean | null; - } - - - /** A seller program in to which a seller can opt-in. */ - export interface Program { - - /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ - programType?: string | null; - } - - - /** A list of the supported seller programs. */ - export interface Programs { - - /** A list of seller programs. */ - programs?: Array; - } - - - /** A complex type that contains information pertaining to a shipping rate table. */ - export interface RateTable { - - /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ - locality?: string | null; - - /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ - name?: string | null; - - /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ - rateTableId?: string | null; - } - - - /** The response container for with information on a seller's shipping rate tables. */ - export interface RateTableResponse { - - /** A list of elements that provide information on the seller-defined shipping rate tables. */ - rateTables?: Array; - } - - - /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface ReturnPolicy { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface ReturnPolicyRequest { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** The response payload for return policy requests. */ - export interface ReturnPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** A list of the seller's return policies. */ - returnPolicies?: Array; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ - export interface SalesTax { - - /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ - salesTaxJurisdictionId?: string | null; - - /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A container that describes the how the sales tax rate is calculated. */ - export interface SalesTaxBase { - - /** The sales tax rate, as a percentage of the sale. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A list of sales tax tables. */ - export interface SalesTaxes { - - /** A list of sales tax tables that have been set up by a seller. */ - salesTaxes?: Array; - } - - - /** Defines the selling limit applied to an eBay seller's account. */ - export interface SellingLimit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** - * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A merchant's selling limit, and the status of their account registration. */ - export interface SellingPrivileges { - - /** If set to true, the seller's registration is completed. */ - sellerRegistrationCompleted?: boolean | null; - - /** Defines the selling limit applied to an eBay seller's account. */ - sellingLimit?: SellingLimit; - } - - - /** Complex type that that gets populated with a response containing a fulfillment policy. */ - export interface SetFulfillmentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** Complex type that that gets populated with a response containing a payment policy. */ - export interface SetPaymentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** Complex type that that gets populated with a response containing a return policy. */ - export interface SetReturnPolicyResponse { - - /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ - restockingFeePercentage?: string | null; - - /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ - returnInstructions?: string | null; - - /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - @autoinject() - export class Fulfillment_policyClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {FulfillmentPolicyResponse} Success - */ - GetFulfillmentPolicies(marketplace_id: string): Promise { - return this.http.get('fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post fulfillment_policy/ - * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. - * @return {void} - */ - CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Promise { - return this.http.post('fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. - * Get fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicy(fulfillmentPolicyId: string): Promise { - return this.http.get('fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. - * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request - * @return {SetFulfillmentPolicyResponse} OK - */ - UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Promise { - return this.http.put('fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. - * Delete fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. - * @return {void} - */ - DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Promise { - return this.http.delete('fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}); - } - - /** - * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicyByName(marketplace_id: string, name: string): Promise { - return this.http.get('fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Payment_policyClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {PaymentPolicyResponse} Success - */ - GetPaymentPolicies(marketplace_id: string): Promise { - return this.http.get('payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post payment_policy/ - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {void} - */ - CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Promise { - return this.http.post('payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. - * Get payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicy(payment_policy_id: string): Promise { - return this.http.get('payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {SetPaymentPolicyResponse} OK - */ - UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Promise { - return this.http.put('payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. - * Delete payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. - * @return {void} - */ - DeletePaymentPolicy(payment_policy_id: string): Promise { - return this.http.delete('payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}); - } - - /** - * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicyByName(marketplace_id: string, name: string): Promise { - return this.http.get('payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Payments_programClient { - constructor(private http: HttpClient) { - } - - /** - * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. - * Get payments_program/{marketplace_id}/{payments_program_type} - * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. - * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. - * @return {PaymentsProgramResponse} Success - */ - GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Promise { - return this.http.get('payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class PrivilegeClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). - * Get privilege/ - * @return {SellingPrivileges} Success - */ - GetPrivileges(): Promise { - return this.http.get('privilege/', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class ProgramClient { - constructor(private http: HttpClient) { - } - - /** - * This method gets a list of the seller programs that the seller has opted-in to. - * Get program/get_opted_in_programs - * @return {Programs} Success - */ - GetOptedInPrograms(): Promise { - return this.http.get('program/get_opted_in_programs', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. - * Post program/opt_in - * @param {Program} requestBody Program being opted-in to. - * @return {string} Success - */ - OptInToProgram(requestBody: Program): Promise { - return this.http.post('program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. - * Post program/opt_out - * @param {Program} requestBody Program being opted-out of. - * @return {string} Success - */ - OptOutOfProgram(requestBody: Program): Promise { - return this.http.post('program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - } - - @autoinject() - export class Rate_tableClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. - * Get rate_table/ - * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {RateTableResponse} Success - */ - GetRateTables(country_code: string | null | undefined): Promise { - return this.http.get('rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Return_policyClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/ - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(marketplace_id: string): Promise { - return this.http.get('return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post return_policy/ - * @param {ReturnPolicyRequest} requestBody Return policy request - * @return {void} - */ - CreateReturnPolicy(requestBody: ReturnPolicyRequest): Promise { - return this.http.post('return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. - * Get return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicy(return_policy_id: string): Promise { - return this.http.get('return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. - * @param {ReturnPolicyRequest} requestBody Container for a return policy request. - * @return {SetReturnPolicyResponse} OK - */ - UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Promise { - return this.http.put('return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. - * Delete return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. - * @return {void} - */ - DeleteReturnPolicy(return_policy_id: string): Promise { - return this.http.delete('return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}); - } - - /** - * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicyByName(marketplace_id: string, name: string): Promise { - return this.http.get('return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Sales_taxClient { - constructor(private http: HttpClient) { - } - - /** - * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. - * Get sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. - * @return {SalesTax} Success - */ - GetSalesTax(countryCode: string, jurisdictionId: string): Promise { - return this.http.get('sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. - * Put sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. - * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. - * @return {void} - */ - CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Promise { - return this.http.put('sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. - * Delete sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. - * @return {void} - */ - DeleteSalesTax(countryCode: string, jurisdictionId: string): Promise { - return this.http.delete('sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}); - } - - /** - * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. - * Get sales_tax/ - * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {SalesTaxes} Success - */ - GetSalesTaxes(country_code: string): Promise { - return this.http.get('sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ + export interface CategoryType { + + /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ + default?: boolean | null; + + /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ + name?: string | null; + } + + + /** A container that describes the details of a deposit. Used only with motor listings. */ + export interface Deposit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + dueIn?: TimeDuration; + + /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ + paymentMethods?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ + export interface PaymentMethod { + + /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ + brands?: Array; + + /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ + paymentMethodType?: string | null; + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + recipientAccountReference?: RecipientAccountReference; + } + + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + export interface RecipientAccountReference { + + /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ + referenceId?: string | null; + + /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ + referenceType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface FulfillmentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ + export interface ShippingOption { + + /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ + costType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + insuranceFee?: Amount; + + /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ + insuranceOffered?: boolean | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ + optionType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + packageHandlingCost?: Amount; + + /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ + rateTableId?: string | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ + shippingServices?: Array; + } + + + /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ + export interface ShippingService { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalShippingCost?: Amount; + + /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForPickup?: boolean | null; + + /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForShipping?: boolean | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + cashOnDeliveryFee?: Amount; + + /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ + freeShipping?: boolean | null; + + /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ + shippingCarrierCode?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + shippingCost?: Amount; + + /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ + shippingServiceCode?: string | null; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** + * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + sortOrder?: number | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + surcharge?: Amount; + } + + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + export interface RegionSet { + + /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ + regionExcluded?: Array; + + /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ + regionIncluded?: Array; + } + + + /** This type defines information for a region. */ + export interface Region { + + /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ + regionName?: string | null; + + /** Reserved for future use. For implementation help, refer to eBay API documentation */ + regionType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface FulfillmentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** The response payload for requests that return a list of fulfillment policies. */ + export interface FulfillmentPolicyResponse { + + /** A list of the seller's fulfillment policies. */ + fulfillmentPolicies?: Array; + + /** Returns a URL link to the result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + export interface InternationalReturnOverrideType { + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ + returnsAccepted?: boolean | null; + + /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface PaymentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + } + + + /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface PaymentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + } + + + /** The response payload for payment policy requests. */ + export interface PaymentPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** A list of the seller's payment policies. */ + paymentPolicies?: Array; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object containing the sellers status with regards to the specified payment program. */ + export interface PaymentsProgramResponse { + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ + paymentsProgramType?: string | null; + + /** For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ + wasPreviouslyOptedIn?: boolean | null; + } + + + /** A seller program in to which a seller can opt-in. */ + export interface Program { + + /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ + programType?: string | null; + } + + + /** A list of the supported seller programs. */ + export interface Programs { + + /** A list of seller programs. */ + programs?: Array; + } + + + /** A complex type that contains information pertaining to a shipping rate table. */ + export interface RateTable { + + /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ + locality?: string | null; + + /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ + name?: string | null; + + /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ + rateTableId?: string | null; + } + + + /** The response container for with information on a seller's shipping rate tables. */ + export interface RateTableResponse { + + /** A list of elements that provide information on the seller-defined shipping rate tables. */ + rateTables?: Array; + } + + + /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface ReturnPolicy { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface ReturnPolicyRequest { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** The response payload for return policy requests. */ + export interface ReturnPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** A list of the seller's return policies. */ + returnPolicies?: Array; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ + export interface SalesTax { + + /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ + salesTaxJurisdictionId?: string | null; + + /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A container that describes the how the sales tax rate is calculated. */ + export interface SalesTaxBase { + + /** The sales tax rate, as a percentage of the sale. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A list of sales tax tables. */ + export interface SalesTaxes { + + /** A list of sales tax tables that have been set up by a seller. */ + salesTaxes?: Array; + } + + + /** Defines the selling limit applied to an eBay seller's account. */ + export interface SellingLimit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** + * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A merchant's selling limit, and the status of their account registration. */ + export interface SellingPrivileges { + + /** If set to true, the seller's registration is completed. */ + sellerRegistrationCompleted?: boolean | null; + + /** Defines the selling limit applied to an eBay seller's account. */ + sellingLimit?: SellingLimit; + } + + + /** Complex type that that gets populated with a response containing a fulfillment policy. */ + export interface SetFulfillmentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** Complex type that that gets populated with a response containing a payment policy. */ + export interface SetPaymentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** Complex type that that gets populated with a response containing a return policy. */ + export interface SetReturnPolicyResponse { + + /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ + restockingFeePercentage?: string | null; + + /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ + returnInstructions?: string | null; + + /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + @autoinject() + export class Fulfillment_policyClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {FulfillmentPolicyResponse} Success + */ + GetFulfillmentPolicies(marketplace_id: string): Promise { + return this.http.get('fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post fulfillment_policy/ + * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. + * @return {void} + */ + CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Promise { + return this.http.post('fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. + * Get fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicy(fulfillmentPolicyId: string): Promise { + return this.http.get('fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. + * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request + * @return {SetFulfillmentPolicyResponse} OK + */ + UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Promise { + return this.http.put('fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. + * Delete fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. + * @return {void} + */ + DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Promise { + return this.http.delete('fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}); + } + + /** + * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicyByName(marketplace_id: string, name: string): Promise { + return this.http.get('fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Payment_policyClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {PaymentPolicyResponse} Success + */ + GetPaymentPolicies(marketplace_id: string): Promise { + return this.http.get('payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post payment_policy/ + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {void} + */ + CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Promise { + return this.http.post('payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. + * Get payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicy(payment_policy_id: string): Promise { + return this.http.get('payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {SetPaymentPolicyResponse} OK + */ + UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Promise { + return this.http.put('payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. + * Delete payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. + * @return {void} + */ + DeletePaymentPolicy(payment_policy_id: string): Promise { + return this.http.delete('payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}); + } + + /** + * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicyByName(marketplace_id: string, name: string): Promise { + return this.http.get('payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Payments_programClient { + constructor(private http: HttpClient) { + } + + /** + * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. + * Get payments_program/{marketplace_id}/{payments_program_type} + * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. + * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. + * @return {PaymentsProgramResponse} Success + */ + GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Promise { + return this.http.get('payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class PrivilegeClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). + * Get privilege/ + * @return {SellingPrivileges} Success + */ + GetPrivileges(): Promise { + return this.http.get('privilege/', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class ProgramClient { + constructor(private http: HttpClient) { + } + + /** + * This method gets a list of the seller programs that the seller has opted-in to. + * Get program/get_opted_in_programs + * @return {Programs} Success + */ + GetOptedInPrograms(): Promise { + return this.http.get('program/get_opted_in_programs', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. + * Post program/opt_in + * @param {Program} requestBody Program being opted-in to. + * @return {string} Success + */ + OptInToProgram(requestBody: Program): Promise { + return this.http.post('program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. + * Post program/opt_out + * @param {Program} requestBody Program being opted-out of. + * @return {string} Success + */ + OptOutOfProgram(requestBody: Program): Promise { + return this.http.post('program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + } + + @autoinject() + export class Rate_tableClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. + * Get rate_table/ + * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {RateTableResponse} Success + */ + GetRateTables(country_code: string | null | undefined): Promise { + return this.http.get('rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Return_policyClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/ + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(marketplace_id: string): Promise { + return this.http.get('return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post return_policy/ + * @param {ReturnPolicyRequest} requestBody Return policy request + * @return {void} + */ + CreateReturnPolicy(requestBody: ReturnPolicyRequest): Promise { + return this.http.post('return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. + * Get return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicy(return_policy_id: string): Promise { + return this.http.get('return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. + * @param {ReturnPolicyRequest} requestBody Container for a return policy request. + * @return {SetReturnPolicyResponse} OK + */ + UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Promise { + return this.http.put('return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. + * Delete return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. + * @return {void} + */ + DeleteReturnPolicy(return_policy_id: string): Promise { + return this.http.delete('return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}); + } + + /** + * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicyByName(marketplace_id: string, name: string): Promise { + return this.http.get('return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Sales_taxClient { + constructor(private http: HttpClient) { + } + + /** + * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. + * Get sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. + * @return {SalesTax} Success + */ + GetSalesTax(countryCode: string, jurisdictionId: string): Promise { + return this.http.get('sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. + * Put sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. + * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. + * @return {void} + */ + CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Promise { + return this.http.put('sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. + * Delete sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. + * @return {void} + */ + DeleteSalesTax(countryCode: string, jurisdictionId: string): Promise { + return this.http.delete('sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}); + } + + /** + * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. + * Get sales_tax/ + * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {SalesTaxes} Success + */ + GetSalesTaxes(country_code: string): Promise { + return this.http.get('sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_analytics.txt b/Tests/SwagTsTests/AureliaResults/sell_analytics.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/sell_analytics.txt rename to Tests/SwagTsTests/AureliaResults/sell_analytics.ts index c1be9261..f0e7d934 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_analytics.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_analytics.ts @@ -1,385 +1,385 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - export interface BenchmarkMetadata { - - /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ - average?: string | null; - } - - - /** A complex type that describes a program cycle. */ - export interface Cycle { - - /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ - cycleType?: string | null; - - /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - evaluationDate?: string | null; - - /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ - evaluationMonth?: string | null; - } - - - /** A complex type that defines a dimension key and metrics in a traffic report. */ - export interface Definition { - - /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The value the dimension or metric parameter as submitted in the request. */ - key?: string | null; - - /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ - localizedName?: string | null; - } - - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - export interface Dimension { - - /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ - dimensionKey?: string | null; - - /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ - name?: string | null; - - /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ - value?: string | null; - } - - - /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ - export interface DimensionMetric { - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - dimension?: Dimension; - - /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ - metrics?: Array; - } - - - /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ - export interface Metric { - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - benchmark?: MetricBenchmark; - - /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ - distributions?: Array; - - /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ - metricKey?: string | null; - - /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ - value?: string | null; - } - - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - export interface MetricBenchmark { - - /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ - adjustment?: string | null; - - /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ - basis?: string | null; - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - metadata?: BenchmarkMetadata; - - /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ - rating?: string | null; - } - - - /** This complex data type describes the metric distribution by basis. */ - export interface MetricDistribution { - - /** This field returns the basis, or the method, by which the metric rating is calculated. */ - basis?: string | null; - - /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ - data?: Array; - } - - - /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ - export interface Distribution { - - /** The name of a distribution in which the seller is active. */ - name?: string | null; - - /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ - value?: string | null; - } - - - /** Type that defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ - category?: string | null; - - /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error than given in the message error field. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** If present, indicates which subsystem in which the error occurred. */ - subdomain?: string | null; - } - - - /** A complex type that defines an error and error message. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - export interface EvaluationCycle { - - /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - endDate?: string | null; - - /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ - evaluationDate?: string | null; - - /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ - evaluationType?: string | null; - - /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - startDate?: string | null; - } - - - /** The response container for a list of seller profiles. */ - export interface FindSellerStandardsProfilesResponse { - - /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ - standardsProfiles?: Array; - } - - - /** A complex type that defines a seller profile. */ - export interface StandardsProfile { - - /** A complex type that describes a program cycle. */ - cycle?: Cycle; - - /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ - defaultProgram?: boolean | null; - - /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ - evaluationReason?: string | null; - - /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ - metrics?: Array; - - /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ - program?: string | null; - - /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ - standardsLevel?: string | null; - } - - - /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ - export interface GetCustomerServiceMetricResponse { - - /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ - dimensionMetrics?: Array; - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - evaluationCycle?: EvaluationCycle; - - /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - export interface Header { - - /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ - dimensionKeys?: Array; - - /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ - metrics?: Array; - } - - - /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ - export interface Metadata { - - /** Type that defines the metadata header fields. */ - metadataHeader?: MetadataHeader; - - /** A list of the individual report records. */ - metadataRecords?: Array; - } - - - /** Type that defines the metadata header fields. */ - export interface MetadataHeader { - - /** The key value used for the report. For example: "key": "LISTING_ID" */ - key?: string | null; - - /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ - metadataKeys?: Array; - } - - - /** A complex type that defines the data records returned in the report. */ - export interface MetadataRecord { - - /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ - metadataValues?: Array; - - /** A complex type that contains a value, plus the veracity of that value. */ - value?: Value; - } - - - /** A complex type that contains a value, plus the veracity of that value. */ - export interface Value { - - /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ - applicable?: boolean | null; - - /** The value of the report data. */ - value?: string | null; - } - - - /** Type that defines the fields of the individual record of the report. */ - export interface Record { - - /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ - dimensionValues?: Array; - - /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ - metricValues?: Array; - } - - - /** The complex type that defines that defines the report. */ - export interface Report { - - /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ - dimensionMetadata?: Array; - - /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - endDate?: string | null; - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - header?: Header; - - /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ - lastUpdatedDate?: string | null; - - /** A complex type containing the individual data records for the traffic report. */ - records?: Array; - - /** The start date of the date range used to calculate the report, in ISO 8601 format. */ - startDate?: string | null; - - /** An array of any process errors or warnings that were generated during the processing of the call processing. */ - warnings?: Array; - } - - @autoinject() - export class Customer_service_metricClient { - constructor(private http: HttpClient) { - } - - /** - * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. - * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} - * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED - * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html - * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. - * @return {GetCustomerServiceMetricResponse} Success - */ - GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Promise { - return this.http.get('customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Seller_standards_profileClient { - constructor(private http: HttpClient) { - } - - /** - * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. - * Get seller_standards_profile - * @return {FindSellerStandardsProfilesResponse} Success - */ - FindSellerStandardsProfiles(): Promise { - return this.http.get('seller_standards_profile', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. - * Get seller_standards_profile/{program}/{cycle} - * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. - * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. - * @return {StandardsProfile} Success - */ - GetSellerStandardsProfile(cycle: string, program: string): Promise { - return this.http.get('seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Traffic_reportClient { - constructor(private http: HttpClient) { - } - - /** - * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. - * Get traffic_report - * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. - * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html - * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count - * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html - * @return {Report} Success - */ - GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Promise { - return this.http.get('traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + export interface BenchmarkMetadata { + + /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ + average?: string | null; + } + + + /** A complex type that describes a program cycle. */ + export interface Cycle { + + /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ + cycleType?: string | null; + + /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + evaluationDate?: string | null; + + /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ + evaluationMonth?: string | null; + } + + + /** A complex type that defines a dimension key and metrics in a traffic report. */ + export interface Definition { + + /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The value the dimension or metric parameter as submitted in the request. */ + key?: string | null; + + /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ + localizedName?: string | null; + } + + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + export interface Dimension { + + /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ + dimensionKey?: string | null; + + /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ + name?: string | null; + + /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ + value?: string | null; + } + + + /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ + export interface DimensionMetric { + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + dimension?: Dimension; + + /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ + metrics?: Array; + } + + + /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ + export interface Metric { + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + benchmark?: MetricBenchmark; + + /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ + distributions?: Array; + + /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ + metricKey?: string | null; + + /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ + value?: string | null; + } + + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + export interface MetricBenchmark { + + /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ + adjustment?: string | null; + + /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ + basis?: string | null; + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + metadata?: BenchmarkMetadata; + + /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ + rating?: string | null; + } + + + /** This complex data type describes the metric distribution by basis. */ + export interface MetricDistribution { + + /** This field returns the basis, or the method, by which the metric rating is calculated. */ + basis?: string | null; + + /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ + data?: Array; + } + + + /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ + export interface Distribution { + + /** The name of a distribution in which the seller is active. */ + name?: string | null; + + /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ + value?: string | null; + } + + + /** Type that defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ + category?: string | null; + + /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error than given in the message error field. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** If present, indicates which subsystem in which the error occurred. */ + subdomain?: string | null; + } + + + /** A complex type that defines an error and error message. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + export interface EvaluationCycle { + + /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + endDate?: string | null; + + /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ + evaluationDate?: string | null; + + /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ + evaluationType?: string | null; + + /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + startDate?: string | null; + } + + + /** The response container for a list of seller profiles. */ + export interface FindSellerStandardsProfilesResponse { + + /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ + standardsProfiles?: Array; + } + + + /** A complex type that defines a seller profile. */ + export interface StandardsProfile { + + /** A complex type that describes a program cycle. */ + cycle?: Cycle; + + /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ + defaultProgram?: boolean | null; + + /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ + evaluationReason?: string | null; + + /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ + metrics?: Array; + + /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ + program?: string | null; + + /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ + standardsLevel?: string | null; + } + + + /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ + export interface GetCustomerServiceMetricResponse { + + /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ + dimensionMetrics?: Array; + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + evaluationCycle?: EvaluationCycle; + + /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + export interface Header { + + /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ + dimensionKeys?: Array; + + /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ + metrics?: Array; + } + + + /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ + export interface Metadata { + + /** Type that defines the metadata header fields. */ + metadataHeader?: MetadataHeader; + + /** A list of the individual report records. */ + metadataRecords?: Array; + } + + + /** Type that defines the metadata header fields. */ + export interface MetadataHeader { + + /** The key value used for the report. For example: "key": "LISTING_ID" */ + key?: string | null; + + /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ + metadataKeys?: Array; + } + + + /** A complex type that defines the data records returned in the report. */ + export interface MetadataRecord { + + /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ + metadataValues?: Array; + + /** A complex type that contains a value, plus the veracity of that value. */ + value?: Value; + } + + + /** A complex type that contains a value, plus the veracity of that value. */ + export interface Value { + + /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ + applicable?: boolean | null; + + /** The value of the report data. */ + value?: string | null; + } + + + /** Type that defines the fields of the individual record of the report. */ + export interface Record { + + /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ + dimensionValues?: Array; + + /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ + metricValues?: Array; + } + + + /** The complex type that defines that defines the report. */ + export interface Report { + + /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ + dimensionMetadata?: Array; + + /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + endDate?: string | null; + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + header?: Header; + + /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ + lastUpdatedDate?: string | null; + + /** A complex type containing the individual data records for the traffic report. */ + records?: Array; + + /** The start date of the date range used to calculate the report, in ISO 8601 format. */ + startDate?: string | null; + + /** An array of any process errors or warnings that were generated during the processing of the call processing. */ + warnings?: Array; + } + + @autoinject() + export class Customer_service_metricClient { + constructor(private http: HttpClient) { + } + + /** + * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. + * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} + * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED + * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html + * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. + * @return {GetCustomerServiceMetricResponse} Success + */ + GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Promise { + return this.http.get('customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Seller_standards_profileClient { + constructor(private http: HttpClient) { + } + + /** + * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. + * Get seller_standards_profile + * @return {FindSellerStandardsProfilesResponse} Success + */ + FindSellerStandardsProfiles(): Promise { + return this.http.get('seller_standards_profile', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. + * Get seller_standards_profile/{program}/{cycle} + * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. + * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. + * @return {StandardsProfile} Success + */ + GetSellerStandardsProfile(cycle: string, program: string): Promise { + return this.http.get('seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Traffic_reportClient { + constructor(private http: HttpClient) { + } + + /** + * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. + * Get traffic_report + * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. + * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html + * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count + * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html + * @return {Report} Success + */ + GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Promise { + return this.http.get('traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_compliance.txt b/Tests/SwagTsTests/AureliaResults/sell_compliance.ts similarity index 99% rename from Tests/SwagTsTests/AureliaResults/sell_compliance.txt rename to Tests/SwagTsTests/AureliaResults/sell_compliance.ts index 1cd65b40..287c50e4 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_compliance.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_compliance.ts @@ -1,261 +1,261 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ - export interface AspectRecommendations { - - /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ - localizedAspectName?: string | null; - - /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ - suggestedValues?: Array; - } - - - /** This type is used by each listing violation that is returned under the violations container. */ - export interface ComplianceDetail { - - /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ - reasonCode?: string | null; - - /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ - message?: string | null; - - /** This type is used to identify the product variation that has the listing violation. */ - variation?: VariationDetails; - - /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ - violationData?: Array; - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - correctiveRecommendations?: CorrectiveRecommendations; - - /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ - complianceState?: string | null; - } - - - /** This type is used to identify the product variation that has the listing violation. */ - export interface VariationDetails { - - /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ - sku?: string | null; - - /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ - variationAspects?: Array; - } - - - /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ - export interface NameValueList { - - /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - name?: string | null; - - /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - value?: string | null; - } - - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - export interface CorrectiveRecommendations { - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - productRecommendation?: ProductRecommendation; - - /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ - aspectRecommendations?: Array; - } - - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - export interface ProductRecommendation { - - /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ - epid?: string | null; - } - - - /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ - export interface ComplianceSummary { - - /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ - violationSummaries?: Array; - } - - - /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ - export interface ComplianceSummaryInfo { - - /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - listingCount?: number | null; - } - - - /** This type is used by each listing violation that is returned under the listingViolations container. */ - export interface ComplianceViolation { - - /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ - listingId?: string | null; - - /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ - sku?: string | null; - - /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ - offerId?: string | null; - - /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ - violations?: Array; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is the base response type of the getListingViolations method. */ - export interface PagedComplianceViolationCollection { - - /** - * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI of the getListingViolations call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ - next?: string | null; - - /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ - prev?: string | null; - - /** - * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ - listingViolations?: Array; - } - - - /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ - export interface SuppressViolationRequest { - - /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ - listingId?: string | null; - } - - @autoinject() - export class Listing_violation_summaryClient { - constructor(private http: HttpClient) { - } - - /** - * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * Get listing_violation_summary - * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * @return {void} Success - */ - GetListingViolationsSummary(compliance_type: string | null | undefined): Promise { - return this.http.get('listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), {}); - } - } - - @autoinject() - export class Listing_violationClient { - constructor(private http: HttpClient) { - } - - /** - * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. - * Get listing_violation - * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. - * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) - * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. - * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 - * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} - * @return {void} Success - */ - GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Promise { - return this.http.get('listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. - * Post suppress_listing_violation - * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. - * @return {void} - */ - SuppressViolation(requestBody: SuppressViolationRequest): Promise { - return this.http.post('suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ + export interface AspectRecommendations { + + /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ + localizedAspectName?: string | null; + + /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ + suggestedValues?: Array; + } + + + /** This type is used by each listing violation that is returned under the violations container. */ + export interface ComplianceDetail { + + /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ + reasonCode?: string | null; + + /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ + message?: string | null; + + /** This type is used to identify the product variation that has the listing violation. */ + variation?: VariationDetails; + + /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ + violationData?: Array; + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + correctiveRecommendations?: CorrectiveRecommendations; + + /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ + complianceState?: string | null; + } + + + /** This type is used to identify the product variation that has the listing violation. */ + export interface VariationDetails { + + /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ + sku?: string | null; + + /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ + variationAspects?: Array; + } + + + /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ + export interface NameValueList { + + /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + name?: string | null; + + /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + value?: string | null; + } + + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + export interface CorrectiveRecommendations { + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + productRecommendation?: ProductRecommendation; + + /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ + aspectRecommendations?: Array; + } + + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + export interface ProductRecommendation { + + /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ + epid?: string | null; + } + + + /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ + export interface ComplianceSummary { + + /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ + violationSummaries?: Array; + } + + + /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ + export interface ComplianceSummaryInfo { + + /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + listingCount?: number | null; + } + + + /** This type is used by each listing violation that is returned under the listingViolations container. */ + export interface ComplianceViolation { + + /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ + listingId?: string | null; + + /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ + sku?: string | null; + + /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ + offerId?: string | null; + + /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ + violations?: Array; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is the base response type of the getListingViolations method. */ + export interface PagedComplianceViolationCollection { + + /** + * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI of the getListingViolations call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ + next?: string | null; + + /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ + prev?: string | null; + + /** + * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ + listingViolations?: Array; + } + + + /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ + export interface SuppressViolationRequest { + + /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ + listingId?: string | null; + } + + @autoinject() + export class Listing_violation_summaryClient { + constructor(private http: HttpClient) { + } + + /** + * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * Get listing_violation_summary + * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * @return {void} Success + */ + GetListingViolationsSummary(compliance_type: string | null | undefined): Promise { + return this.http.get('listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), {}); + } + } + + @autoinject() + export class Listing_violationClient { + constructor(private http: HttpClient) { + } + + /** + * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. + * Get listing_violation + * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. + * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) + * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. + * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 + * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} + * @return {void} Success + */ + GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Promise { + return this.http.get('listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. + * Post suppress_listing_violation + * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. + * @return {void} + */ + SuppressViolation(requestBody: SuppressViolationRequest): Promise { + return this.http.post('suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_finances.txt b/Tests/SwagTsTests/AureliaResults/sell_finances.ts similarity index 99% rename from Tests/SwagTsTests/AureliaResults/sell_finances.txt rename to Tests/SwagTsTests/AureliaResults/sell_finances.ts index 3e3a339d..104a675c 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_finances.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_finances.ts @@ -1,404 +1,404 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - export interface Amount { - - /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ - value?: string | null; - } - - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - export interface Buyer { - - /** The eBay user ID of the order's buyer. */ - username?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ - export interface Payout { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ - payoutDate?: string | null; - - /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ - payoutId?: string | null; - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - payoutInstrument?: PayoutInstrument; - - /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ - payoutStatus?: string | null; - - /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ - payoutStatusDescription?: string | null; - - /** - * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - export interface PayoutInstrument { - - /** This string value is the last four digits of the seller's account number. */ - accountLastFourDigits?: string | null; - - /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ - instrumentType?: string | null; - - /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ - nickname?: string | null; - } - - - /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ - export interface PayoutSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** - * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - payoutCount?: number | null; - - /** - * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ - export interface Payouts { - - /** The URI of the getPayouts call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ - payouts?: Array; - - /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ - export interface SellerFundsSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - availableFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - fundsOnHold?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - processingFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - totalFunds?: Amount; - } - - - /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ - export interface Transaction { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ - bookingEntry?: string | null; - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - buyer?: Buyer; - - /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ - orderId?: string | null; - - /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ - payoutId?: string | null; - - /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ - salesRecordReference?: string | null; - - /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ - transactionDate?: string | null; - - /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ - transactionId?: string | null; - - /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ - transactionMemo?: string | null; - - /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ - transactionStatus?: string | null; - - /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ - transactionType?: string | null; - } - - - /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ - export interface TransactionSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - creditAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ - creditBookingEntry?: string | null; - - /** - * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - creditCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - disputeAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ - disputeBookingEntry?: string | null; - - /** - * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - disputeCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - onHoldAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ - onHoldBookingEntry?: string | null; - - /** - * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - onHoldCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - refundAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ - refundBookingEntry?: string | null; - - /** - * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - refundCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - shippingLabelAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ - shippingLabelBookingEntry?: string | null; - - /** - * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - shippingLabelCount?: number | null; - } - - - /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ - export interface Transactions { - - /** The URI of the getTransactions method request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ - transactions?: Array; - } - - @autoinject() - export class PayoutClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. - * Get payout/{payout_Id} - * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. - * @return {Payout} Success - */ - GetPayout(payout_Id: string): Promise { - return this.http.get('payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. - * Get payout - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) - * @return {Payouts} Success - */ - GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return this.http.get('payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. - * Get payout_summary - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {PayoutSummaryResponse} Success - */ - GetPayoutSummary(filter: string | null | undefined): Promise { - return this.http.get('payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class TransactionClient { - constructor(private http: HttpClient) { - } - - /** - * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. - * Get transaction - * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * @return {Transactions} Success - */ - GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return this.http.get('transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). - * Get transaction_summary - * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {TransactionSummaryResponse} Success - */ - GetTransactionSummary(filter: string | null | undefined): Promise { - return this.http.get('transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Seller_funds_summaryClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. - * Get seller_funds_summary - * @return {SellerFundsSummaryResponse} Success - */ - GetSellerFundsSummary(): Promise { - return this.http.get('seller_funds_summary', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + export interface Amount { + + /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ + value?: string | null; + } + + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + export interface Buyer { + + /** The eBay user ID of the order's buyer. */ + username?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ + export interface Payout { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ + payoutDate?: string | null; + + /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ + payoutId?: string | null; + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + payoutInstrument?: PayoutInstrument; + + /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ + payoutStatus?: string | null; + + /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ + payoutStatusDescription?: string | null; + + /** + * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + export interface PayoutInstrument { + + /** This string value is the last four digits of the seller's account number. */ + accountLastFourDigits?: string | null; + + /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ + instrumentType?: string | null; + + /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ + nickname?: string | null; + } + + + /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ + export interface PayoutSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** + * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + payoutCount?: number | null; + + /** + * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ + export interface Payouts { + + /** The URI of the getPayouts call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ + payouts?: Array; + + /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ + export interface SellerFundsSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + availableFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + fundsOnHold?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + processingFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + totalFunds?: Amount; + } + + + /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ + export interface Transaction { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ + bookingEntry?: string | null; + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + buyer?: Buyer; + + /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ + orderId?: string | null; + + /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ + payoutId?: string | null; + + /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ + salesRecordReference?: string | null; + + /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ + transactionDate?: string | null; + + /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ + transactionId?: string | null; + + /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ + transactionMemo?: string | null; + + /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ + transactionStatus?: string | null; + + /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ + transactionType?: string | null; + } + + + /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ + export interface TransactionSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + creditAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ + creditBookingEntry?: string | null; + + /** + * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + creditCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + disputeAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ + disputeBookingEntry?: string | null; + + /** + * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + disputeCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + onHoldAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ + onHoldBookingEntry?: string | null; + + /** + * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + onHoldCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + refundAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ + refundBookingEntry?: string | null; + + /** + * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + refundCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + shippingLabelAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ + shippingLabelBookingEntry?: string | null; + + /** + * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + shippingLabelCount?: number | null; + } + + + /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ + export interface Transactions { + + /** The URI of the getTransactions method request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ + transactions?: Array; + } + + @autoinject() + export class PayoutClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. + * Get payout/{payout_Id} + * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. + * @return {Payout} Success + */ + GetPayout(payout_Id: string): Promise { + return this.http.get('payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. + * Get payout + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) + * @return {Payouts} Success + */ + GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return this.http.get('payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. + * Get payout_summary + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {PayoutSummaryResponse} Success + */ + GetPayoutSummary(filter: string | null | undefined): Promise { + return this.http.get('payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class TransactionClient { + constructor(private http: HttpClient) { + } + + /** + * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. + * Get transaction + * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * @return {Transactions} Success + */ + GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return this.http.get('transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). + * Get transaction_summary + * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {TransactionSummaryResponse} Success + */ + GetTransactionSummary(filter: string | null | undefined): Promise { + return this.http.get('transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Seller_funds_summaryClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. + * Get seller_funds_summary + * @return {SellerFundsSummaryResponse} Success + */ + GetSellerFundsSummary(): Promise { + return this.http.get('seller_funds_summary', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_inventory.txt b/Tests/SwagTsTests/AureliaResults/sell_inventory.ts similarity index 99% rename from Tests/SwagTsTests/AureliaResults/sell_inventory.txt rename to Tests/SwagTsTests/AureliaResults/sell_inventory.ts index 0c028dec..6f53dce8 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_inventory.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_inventory.ts @@ -1,1854 +1,1854 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** This type is used to define the physical address of an inventory location. */ - export interface Address { - - /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine1?: string | null; - - /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine2?: string | null; - - /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ - city?: string | null; - - /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ - country?: string | null; - - /** The county in which the address resides. This field is returned if defined for an inventory location. */ - county?: string | null; - - /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ - postalCode?: string | null; - - /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ - stateOrProvince?: string | null; - } - - - /** This type is used to express a dollar value and the applicable currency. */ - export interface Amount { - - /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ - currency?: string | null; - - /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ - value?: string | null; - } - - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - export interface Availability { - - /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - pickupAtLocationAvailability?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - } - - - /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ - export interface PickupAtLocationAvailability { - - /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ - availabilityType?: string | null; - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - fulfillmentTime?: TimeDuration; - - /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ - merchantLocationKey?: string | null; - - /** - * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - export interface TimeDuration { - - /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - export interface ShipToLocationAvailability { - - /** - * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ - export interface BaseResponse { - - /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ - warnings?: Array; - } - - - /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ - export interface Error { - - /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ - category?: string | null; - - /** The name of the domain in which the error or warning occurred. */ - domain?: string | null; - - /** - * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ - longMessage?: string | null; - - /** A description of the condition that caused the error or warning. */ - message?: string | null; - - /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ - outputRefIds?: Array; - - /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. */ - subdomain?: string | null; - } - - - /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ - export interface ErrorParameter { - - /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ - name?: string | null; - - /** This is the actual value that was passed in for the element specified in the name field. */ - value?: string | null; - } - - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - export interface BestOffer { - - /** This type is used to express a dollar value and the applicable currency. */ - autoAcceptPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - autoDeclinePrice?: Amount; - - /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ - bestOfferEnabled?: boolean | null; - } - - - /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ - export interface BulkEbayOfferDetailsWithKeys { - - /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ - requests?: Array; - } - - - /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ - export interface EbayOfferDetailsWithKeys { - - /** - * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - - /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ - donationPercentage?: string | null; - } - - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - export interface ListingPolicies { - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - bestOfferTerms?: BestOffer; - - /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - eBayPlusIfEligible?: boolean | null; - - /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - fulfillmentPolicyId?: string | null; - - /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - paymentPolicyId?: string | null; - - /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - returnPolicyId?: string | null; - - /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ - shippingCostOverrides?: Array; - } - - - /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ - export interface ShippingCostOverride { - - /** This type is used to express a dollar value and the applicable currency. */ - additionalShippingCost?: Amount; - - /** - * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - priority?: number | null; - - /** This type is used to express a dollar value and the applicable currency. */ - shippingCost?: Amount; - - /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ - shippingServiceType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - surcharge?: Amount; - } - - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - export interface PricingSummary { - - /** This type is used to express a dollar value and the applicable currency. */ - minimumAdvertisedPrice?: Amount; - - /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - originallySoldForRetailPriceOn?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - originalRetailPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - - /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - pricingVisibility?: string | null; - } - - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - export interface Tax { - - /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ - applyTax?: boolean | null; - - /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ - thirdPartyTaxCategory?: string | null; - - /** - * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. - * Type: double - */ - vatPercentage?: number | null; - } - - - /** This type is used by the base request of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItem { - - /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ - requests?: Array; - } - - - /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ - export interface GetInventoryItem { - - /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemResponse { - - /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ - export interface GetInventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ - errors?: Array; - - /** This type is used to provide details about each retrieved inventory item record. */ - inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ - warnings?: Array; - } - - - /** This type is used to provide details about each retrieved inventory item record. */ - export interface InventoryItemWithSkuLocaleGroupKeys { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface PackageWeightAndSize { - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - dimensions?: Dimension; - - /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ - packageType?: string | null; - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - weight?: Weight; - } - - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Dimension { - - /** - * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - height?: number | null; - - /** - * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - length?: number | null; - - /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - width?: number | null; - } - - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Weight { - - /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } - * Type: double - */ - value?: number | null; - } - - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - export interface Product { - - /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ - aspects?: Array; - - /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ - brand?: string | null; - - /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ - description?: string | null; - - /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ - ean?: Array; - - /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ - epid?: string | null; - - /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ - imageUrls?: Array; - - /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ - isbn?: Array; - - /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ - mpn?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ - title?: string | null; - - /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ - upc?: Array; - } - - - /** The base request of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItem { - - /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ - requests?: Array; - } - - - /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ - export interface InventoryItemWithSkuLocale { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemResponse { - - /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ - export interface InventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ - errors?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base container of the bulkMigrateListings request payload. */ - export interface BulkMigrateListing { - - /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ - requests?: Array; - } - - - /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ - export interface MigrateListing { - - /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ - listingId?: string | null; - } - - - /** This type is used by the response payload of the bulkMigrateListings call. */ - export interface BulkMigrateListingResponse { - - /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ - responses?: Array; - } - - - /** This type is used to display the results of each listing that the seller attempted to migrate. */ - export interface MigrateListingResponse { - - /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ - errors?: Array; - - /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ - inventoryItemGroupKey?: string | null; - - /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ - inventoryItems?: Array; - - /** The unique identifier of the eBay listing that the seller attempted to migrate. */ - listingId?: string | null; - - /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ - warnings?: Array; - } - - - /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ - export interface InventoryItemListing { - - /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ - offerId?: string | null; - - /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ - sku?: string | null; - } - - - /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ - export interface BulkOffer { - - /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ - requests?: Array; - } - - - /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ - export interface OfferKeyWithId { - - /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ - offerId?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOffer method. */ - export interface BulkOfferResponse { - - /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ - export interface OfferSkuResponse { - - /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ - errors?: Array; - - /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ - offerId?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ - sku?: string | null; - - /** - * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ - warnings?: Array; - } - - - /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - export interface BulkPriceQuantity { - - /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - requests?: Array; - } - - - /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ - export interface PriceQuantity { - - /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ - offers?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - - /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ - export interface OfferPriceQuantity { - - /** - * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ - offerId?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - } - - - /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - export interface BulkPriceQuantityResponse { - - /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - responses?: Array; - } - - - /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ - export interface PriceQuantityResponse { - - /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ - errors?: Array; - - /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ - offerId?: string | null; - - /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ - sku?: string | null; - - /** - * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base response of the bulkPublishOffer method. */ - export interface BulkPublishResponse { - - /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ - responses?: Array; - } - - - /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ - export interface OfferResponseWithListingId { - - /** This container will be returned if there were one or more errors associated with publishing the offer. */ - errors?: Array; - - /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ - listingId?: string | null; - - /** The unique identifier of the offer that the seller published (or attempted to publish). */ - offerId?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with publishing the offer. */ - warnings?: Array; - } - - - /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ - export interface Compatibility { - - /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ - compatibleProducts?: Array; - - /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ - sku?: string | null; - } - - - /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ - export interface CompatibleProduct { - - /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ - compatibilityProperties?: Array; - - /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ - notes?: string | null; - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - productFamilyProperties?: ProductFamilyProperties; - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - productIdentifier?: ProductIdentifier; - } - - - /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ - export interface NameValueList { - - /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ - name?: string | null; - - /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ - value?: string | null; - } - - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - export interface ProductFamilyProperties { - - /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ - engine?: string | null; - - /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ - make?: string | null; - - /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ - model?: string | null; - - /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ - trim?: string | null; - - /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ - year?: string | null; - } - - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - export interface ProductIdentifier { - - /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ - epid?: string | null; - - /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ - gtin?: string | null; - - /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ - ktype?: string | null; - } - - - /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ - export interface EbayOfferDetailsWithAll { - - /** - * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - listing?: ListingDetails; - - /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ - merchantLocationKey?: string | null; - - /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ - offerId?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ - sku?: string | null; - - /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - export interface ListingDetails { - - /** The unique identifier of the eBay listing that is associated with the published offer. */ - listingId?: string | null; - - /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ - listingStatus?: string | null; - - /** - * This integer value indicates the quantity of the product that has been sold for the published offer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - soldQuantity?: number | null; - } - - - /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ - export interface EbayOfferDetailsWithId { - - /** - * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ - export interface Fee { - - /** This type is used to express a dollar value and the applicable currency. */ - amount?: Amount; - - /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - feeType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - promotionalDiscount?: Amount; - } - - - /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ - export interface FeeSummary { - - /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - fees?: Array; - - /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response payload for the getListingFees call. */ - export interface FeesSummaryResponse { - - /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ - feeSummaries?: Array; - } - - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - export interface GeoCoordinates { - - /** - * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - longitude?: number | null; - } - - - /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ - export interface Interval { - - /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - close?: string | null; - - /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - open?: string | null; - } - - - /** This type is used to provide detailed information about an inventory item. */ - export interface InventoryItem { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - } - - - /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ - export interface InventoryItemGroup { - - /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ - aspects?: Array; - - /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ - description?: string | null; - - /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ - imageUrls?: Array; - - /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ - inventoryItemGroupKey?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ - title?: string | null; - - /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ - variantSKUs?: Array; - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - variesBy?: VariesBy; - } - - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - export interface VariesBy { - - /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ - aspectsImageVariesBy?: Array; - - /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ - specifications?: Array; - } - - - /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ - export interface Specification { - - /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ - name?: string | null; - - /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ - values?: Array; - } - - export interface InventoryItemWithSkuLocaleGroupid { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ - groupIds?: Array; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used by the base response payload of getInventoryItems call. */ - export interface InventoryItems { - - /** This is the URL to the current page of inventory items. */ - href?: string | null; - - /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ - inventoryItems?: Array; - - /** - * This integer value is the number of inventory items that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ - next?: string | null; - - /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ - prev?: string | null; - - /** - * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ - export interface InventoryLocation { - - /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ - locationInstructions?: string | null; - - /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ - locationWebUrl?: string | null; - - /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ - name?: string | null; - - /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ - operatingHours?: Array; - - /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ - phone?: string | null; - - /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ - specialHours?: Array; - } - - - /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ - export interface OperatingHours { - - /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ - dayOfWeekEnum?: string | null; - - /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ - intervals?: Array; - } - - - /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ - export interface SpecialHours { - - /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ - date?: string | null; - - /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ - intervals?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ - export interface InventoryLocationFull { - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - location?: LocationDetails; - - /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ - locationInstructions?: string | null; - - /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ - locationTypes?: Array; - - /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ - phone?: string | null; - - /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ - specialHours?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - export interface LocationDetails { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - } - - - /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ - export interface InventoryLocationResponse { - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - location?: Location; - - /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ - locationInstructions?: string | null; - - /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ - locationTypes?: Array; - - /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ - phone?: string | null; - - /** This container shows the special operating hours for a store location on a specific date or dates. */ - specialHours?: Array; - } - - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - export interface Location { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - - /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ - locationId?: string | null; - } - - - /** This type is used by the base response payload for the getInventoryLocations call. */ - export interface LocationResponse { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of one or more of the merchant's inventory locations. */ - locations?: Array; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the base request payload of the getListingFees call. */ - export interface OfferKeysWithId { - - /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ - offers?: Array; - } - - - /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ - export interface OfferResponse { - - /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ - offerId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ - export interface Offers { - - /** This is the URL to the current page of offers. */ - href?: string | null; - - /** - * This integer value is the number of offers that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ - next?: string | null; - - /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ - offers?: Array; - - /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ - prev?: string | null; - - /** - * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ - export interface PublishByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ - export interface PublishResponse { - - /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ - listingId?: string | null; - - /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ - warnings?: Array; - } - - - /** This type is used to show the version number and instance of the service or API. */ - export interface Version { - - /** This type is used to show the version number and instance of the service or API. */ - instance?: Version; - - /** The version number of the service or API. */ - version?: string | null; - } - - - /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ - export interface WithdrawByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** The base response of the withdrawOffer call. */ - export interface WithdrawResponse { - - /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ - listingId?: string | null; - - /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ - warnings?: Array; - } - - @autoinject() - export class LocationClient { - constructor(private http: HttpClient) { - } - - /** - * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 - * @return {InventoryLocationResponse} Success - */ - GetInventoryLocation(merchantLocationKey: string): Promise { - return this.http.get('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 - * @param {InventoryLocationFull} requestBody Inventory Location details - * @return {void} - */ - CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Promise { - return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. - * Delete location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 - * @return {void} - */ - DeleteInventoryLocation(merchantLocationKey: string): Promise { - return this.http.delete('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}); - } - - /** - * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/disable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 - * @return {string} Success - */ - DisableInventoryLocation(merchantLocationKey: string): Promise { - return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/enable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 - * @return {string} Success - */ - EnableInventoryLocation(merchantLocationKey: string): Promise { - return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, {}).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 - * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {LocationResponse} Success - */ - GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Promise { - return this.http.get('location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey}/update_location_details - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 - * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). - * @return {void} - */ - UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Promise { - return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class Inventory_itemClient { - constructor(private http: HttpClient) { - } - - /** - * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Get inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. - * @return {InventoryItemWithSkuLocaleGroupid} Success - */ - GetInventoryItem(sku: string): Promise { - return this.http.get('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. - * Put inventory_item/{sku} - * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. - * @param {InventoryItem} requestBody Details of the inventory item record. - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Promise { - return this.http.put('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Delete inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. - * @return {void} - */ - DeleteInventoryItem(sku: string): Promise { - return this.http.delete('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}); - } - - /** - * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. - * Get inventory_item - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {InventoryItems} Success - */ - GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Promise { - return this.http.get('inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Post bulk_update_price_quantity - * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace - * @return {BulkPriceQuantityResponse} Success - */ - BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Promise { - return this.http.post('bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. - * Post bulk_create_or_replace_inventory_item - * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkInventoryItemResponse} Success - */ - BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Promise { - return this.http.post('bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Post bulk_get_inventory_item - * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkGetInventoryItemResponse} Success - */ - BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Promise { - return this.http.post('bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Product_compatibilityClient { - constructor(private http: HttpClient) { - } - - /** - * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Get inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {Compatibility} Success - */ - GetProductCompatibility(sku: string): Promise { - return this.http.get('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @param {Compatibility} requestBody Details of the compatibility - * @return {BaseResponse} Success - */ - CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Promise { - return this.http.put('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Delete inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {void} - */ - DeleteProductCompatibility(sku: string): Promise { - return this.http.delete('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}); - } - } - - @autoinject() - export class OfferClient { - constructor(private http: HttpClient) { - } - - /** - * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer - * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. - * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. - * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {Offers} Success - */ - GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return this.http.get('offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. - * Post offer - * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {void} - */ - CreateOffer(requestBody: EbayOfferDetailsWithKeys): Promise { - return this.http.post('offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is to be retrieved. - * @return {EbayOfferDetailsWithAll} Success - */ - GetOffer(offerId: string): Promise { - return this.http.get('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. - * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel - * @return {OfferResponse} Success - */ - UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Promise { - return this.http.put('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. - * Delete offer/{offerId} - * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. - * @return {void} - */ - DeleteOffer(offerId: string): Promise { - return this.http.delete('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}); - } - - /** - * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post offer/{offerId}/publish/ - * @param {string} offerId The unique identifier of the offer that is to be published. - * @return {PublishResponse} Success - */ - PublishOffer(offerId: string): Promise { - return this.http.post('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. - * Post offer/publish_by_inventory_item_group/ - * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. - * @return {PublishResponse} Success - */ - PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Promise { - return this.http.post('offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. - * Post offer/withdraw_by_inventory_item_group - * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. - * @return {void} - */ - WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Promise { - return this.http.post('offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. - * Post offer/get_listing_fees - * @param {OfferKeysWithId} requestBody List of offers that needs fee information - * @return {FeesSummaryResponse} Success - */ - GetListingFees(requestBody: OfferKeysWithId): Promise { - return this.http.post('offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. - * Post bulk_create_offer - * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {BulkOfferResponse} Success - */ - BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Promise { - return this.http.post('bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post bulk_publish_offer - * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. - * @return {BulkPublishResponse} Success - */ - BulkPublishOffer(requestBody: BulkOffer): Promise { - return this.http.post('bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. - * Post offer/{offerId}/withdraw - * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. - * @return {WithdrawResponse} Success - */ - WithdrawOffer(offerId: string): Promise { - return this.http.post('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Inventory_item_groupClient { - constructor(private http: HttpClient) { - } - - /** - * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. - * Get inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. - * @return {InventoryItemGroup} Success - */ - GetInventoryItemGroup(inventoryItemGroupKey: string): Promise { - return this.http.get('inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. - * @param {InventoryItemGroup} requestBody Details of the inventory Item Group - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Promise { - return this.http.put('inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call deletes the inventory item group for a given inventoryItemGroupKey value. - * Delete inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. - * @return {void} - */ - DeleteInventoryItemGroup(inventoryItemGroupKey: string): Promise { - return this.http.delete('inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}); - } - } - - @autoinject() - export class ListingClient { - constructor(private http: HttpClient) { - } - - /** - * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. - * Post bulk_migrate_listing - * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory - * @return {BulkMigrateListingResponse} Success - */ - BulkMigrateListing(requestBody: BulkMigrateListing): Promise { - return this.http.post('bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** This type is used to define the physical address of an inventory location. */ + export interface Address { + + /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine1?: string | null; + + /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine2?: string | null; + + /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ + city?: string | null; + + /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ + country?: string | null; + + /** The county in which the address resides. This field is returned if defined for an inventory location. */ + county?: string | null; + + /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ + postalCode?: string | null; + + /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ + stateOrProvince?: string | null; + } + + + /** This type is used to express a dollar value and the applicable currency. */ + export interface Amount { + + /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ + currency?: string | null; + + /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ + value?: string | null; + } + + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + export interface Availability { + + /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + pickupAtLocationAvailability?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + } + + + /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ + export interface PickupAtLocationAvailability { + + /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ + availabilityType?: string | null; + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + fulfillmentTime?: TimeDuration; + + /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ + merchantLocationKey?: string | null; + + /** + * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + export interface TimeDuration { + + /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + export interface ShipToLocationAvailability { + + /** + * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ + export interface BaseResponse { + + /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ + warnings?: Array; + } + + + /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ + export interface Error { + + /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ + category?: string | null; + + /** The name of the domain in which the error or warning occurred. */ + domain?: string | null; + + /** + * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ + longMessage?: string | null; + + /** A description of the condition that caused the error or warning. */ + message?: string | null; + + /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ + outputRefIds?: Array; + + /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. */ + subdomain?: string | null; + } + + + /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ + export interface ErrorParameter { + + /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ + name?: string | null; + + /** This is the actual value that was passed in for the element specified in the name field. */ + value?: string | null; + } + + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + export interface BestOffer { + + /** This type is used to express a dollar value and the applicable currency. */ + autoAcceptPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + autoDeclinePrice?: Amount; + + /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ + bestOfferEnabled?: boolean | null; + } + + + /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ + export interface BulkEbayOfferDetailsWithKeys { + + /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ + requests?: Array; + } + + + /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ + export interface EbayOfferDetailsWithKeys { + + /** + * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + + /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ + donationPercentage?: string | null; + } + + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + export interface ListingPolicies { + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + bestOfferTerms?: BestOffer; + + /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + eBayPlusIfEligible?: boolean | null; + + /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + fulfillmentPolicyId?: string | null; + + /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + paymentPolicyId?: string | null; + + /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + returnPolicyId?: string | null; + + /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ + shippingCostOverrides?: Array; + } + + + /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ + export interface ShippingCostOverride { + + /** This type is used to express a dollar value and the applicable currency. */ + additionalShippingCost?: Amount; + + /** + * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + priority?: number | null; + + /** This type is used to express a dollar value and the applicable currency. */ + shippingCost?: Amount; + + /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ + shippingServiceType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + surcharge?: Amount; + } + + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + export interface PricingSummary { + + /** This type is used to express a dollar value and the applicable currency. */ + minimumAdvertisedPrice?: Amount; + + /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + originallySoldForRetailPriceOn?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + originalRetailPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + + /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + pricingVisibility?: string | null; + } + + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + export interface Tax { + + /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ + applyTax?: boolean | null; + + /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ + thirdPartyTaxCategory?: string | null; + + /** + * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. + * Type: double + */ + vatPercentage?: number | null; + } + + + /** This type is used by the base request of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItem { + + /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ + requests?: Array; + } + + + /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ + export interface GetInventoryItem { + + /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemResponse { + + /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ + export interface GetInventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ + errors?: Array; + + /** This type is used to provide details about each retrieved inventory item record. */ + inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ + warnings?: Array; + } + + + /** This type is used to provide details about each retrieved inventory item record. */ + export interface InventoryItemWithSkuLocaleGroupKeys { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface PackageWeightAndSize { + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + dimensions?: Dimension; + + /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ + packageType?: string | null; + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + weight?: Weight; + } + + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Dimension { + + /** + * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + height?: number | null; + + /** + * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + length?: number | null; + + /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + width?: number | null; + } + + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Weight { + + /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } + * Type: double + */ + value?: number | null; + } + + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + export interface Product { + + /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ + aspects?: Array; + + /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ + brand?: string | null; + + /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ + description?: string | null; + + /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ + ean?: Array; + + /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ + epid?: string | null; + + /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ + imageUrls?: Array; + + /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ + isbn?: Array; + + /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ + mpn?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ + title?: string | null; + + /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ + upc?: Array; + } + + + /** The base request of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItem { + + /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ + requests?: Array; + } + + + /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ + export interface InventoryItemWithSkuLocale { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemResponse { + + /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ + export interface InventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ + errors?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base container of the bulkMigrateListings request payload. */ + export interface BulkMigrateListing { + + /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ + requests?: Array; + } + + + /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ + export interface MigrateListing { + + /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ + listingId?: string | null; + } + + + /** This type is used by the response payload of the bulkMigrateListings call. */ + export interface BulkMigrateListingResponse { + + /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ + responses?: Array; + } + + + /** This type is used to display the results of each listing that the seller attempted to migrate. */ + export interface MigrateListingResponse { + + /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ + errors?: Array; + + /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ + inventoryItemGroupKey?: string | null; + + /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ + inventoryItems?: Array; + + /** The unique identifier of the eBay listing that the seller attempted to migrate. */ + listingId?: string | null; + + /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ + warnings?: Array; + } + + + /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ + export interface InventoryItemListing { + + /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ + offerId?: string | null; + + /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ + sku?: string | null; + } + + + /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ + export interface BulkOffer { + + /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ + requests?: Array; + } + + + /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ + export interface OfferKeyWithId { + + /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ + offerId?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOffer method. */ + export interface BulkOfferResponse { + + /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ + export interface OfferSkuResponse { + + /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ + errors?: Array; + + /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ + offerId?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ + sku?: string | null; + + /** + * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ + warnings?: Array; + } + + + /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + export interface BulkPriceQuantity { + + /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + requests?: Array; + } + + + /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ + export interface PriceQuantity { + + /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ + offers?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + + /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ + export interface OfferPriceQuantity { + + /** + * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ + offerId?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + } + + + /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + export interface BulkPriceQuantityResponse { + + /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + responses?: Array; + } + + + /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ + export interface PriceQuantityResponse { + + /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ + errors?: Array; + + /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ + offerId?: string | null; + + /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ + sku?: string | null; + + /** + * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base response of the bulkPublishOffer method. */ + export interface BulkPublishResponse { + + /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ + responses?: Array; + } + + + /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ + export interface OfferResponseWithListingId { + + /** This container will be returned if there were one or more errors associated with publishing the offer. */ + errors?: Array; + + /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ + listingId?: string | null; + + /** The unique identifier of the offer that the seller published (or attempted to publish). */ + offerId?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with publishing the offer. */ + warnings?: Array; + } + + + /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ + export interface Compatibility { + + /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ + compatibleProducts?: Array; + + /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ + sku?: string | null; + } + + + /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ + export interface CompatibleProduct { + + /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ + compatibilityProperties?: Array; + + /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ + notes?: string | null; + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + productFamilyProperties?: ProductFamilyProperties; + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + productIdentifier?: ProductIdentifier; + } + + + /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ + export interface NameValueList { + + /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ + name?: string | null; + + /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ + value?: string | null; + } + + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + export interface ProductFamilyProperties { + + /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ + engine?: string | null; + + /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ + make?: string | null; + + /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ + model?: string | null; + + /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ + trim?: string | null; + + /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ + year?: string | null; + } + + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + export interface ProductIdentifier { + + /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ + epid?: string | null; + + /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ + gtin?: string | null; + + /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ + ktype?: string | null; + } + + + /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ + export interface EbayOfferDetailsWithAll { + + /** + * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + listing?: ListingDetails; + + /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ + merchantLocationKey?: string | null; + + /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ + offerId?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ + sku?: string | null; + + /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + export interface ListingDetails { + + /** The unique identifier of the eBay listing that is associated with the published offer. */ + listingId?: string | null; + + /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ + listingStatus?: string | null; + + /** + * This integer value indicates the quantity of the product that has been sold for the published offer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + soldQuantity?: number | null; + } + + + /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ + export interface EbayOfferDetailsWithId { + + /** + * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ + export interface Fee { + + /** This type is used to express a dollar value and the applicable currency. */ + amount?: Amount; + + /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + feeType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + promotionalDiscount?: Amount; + } + + + /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ + export interface FeeSummary { + + /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + fees?: Array; + + /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response payload for the getListingFees call. */ + export interface FeesSummaryResponse { + + /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ + feeSummaries?: Array; + } + + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + export interface GeoCoordinates { + + /** + * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + longitude?: number | null; + } + + + /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ + export interface Interval { + + /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + close?: string | null; + + /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + open?: string | null; + } + + + /** This type is used to provide detailed information about an inventory item. */ + export interface InventoryItem { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + } + + + /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ + export interface InventoryItemGroup { + + /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ + aspects?: Array; + + /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ + description?: string | null; + + /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ + imageUrls?: Array; + + /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ + inventoryItemGroupKey?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ + title?: string | null; + + /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ + variantSKUs?: Array; + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + variesBy?: VariesBy; + } + + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + export interface VariesBy { + + /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ + aspectsImageVariesBy?: Array; + + /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ + specifications?: Array; + } + + + /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ + export interface Specification { + + /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ + name?: string | null; + + /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ + values?: Array; + } + + export interface InventoryItemWithSkuLocaleGroupid { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ + groupIds?: Array; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used by the base response payload of getInventoryItems call. */ + export interface InventoryItems { + + /** This is the URL to the current page of inventory items. */ + href?: string | null; + + /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ + inventoryItems?: Array; + + /** + * This integer value is the number of inventory items that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ + next?: string | null; + + /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ + prev?: string | null; + + /** + * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ + export interface InventoryLocation { + + /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ + locationInstructions?: string | null; + + /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ + locationWebUrl?: string | null; + + /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ + name?: string | null; + + /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ + operatingHours?: Array; + + /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ + phone?: string | null; + + /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ + specialHours?: Array; + } + + + /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ + export interface OperatingHours { + + /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ + dayOfWeekEnum?: string | null; + + /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ + intervals?: Array; + } + + + /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ + export interface SpecialHours { + + /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ + date?: string | null; + + /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ + intervals?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ + export interface InventoryLocationFull { + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + location?: LocationDetails; + + /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ + locationInstructions?: string | null; + + /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ + locationTypes?: Array; + + /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ + phone?: string | null; + + /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ + specialHours?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + export interface LocationDetails { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + } + + + /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ + export interface InventoryLocationResponse { + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + location?: Location; + + /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ + locationInstructions?: string | null; + + /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ + locationTypes?: Array; + + /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ + phone?: string | null; + + /** This container shows the special operating hours for a store location on a specific date or dates. */ + specialHours?: Array; + } + + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + export interface Location { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + + /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ + locationId?: string | null; + } + + + /** This type is used by the base response payload for the getInventoryLocations call. */ + export interface LocationResponse { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of one or more of the merchant's inventory locations. */ + locations?: Array; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the base request payload of the getListingFees call. */ + export interface OfferKeysWithId { + + /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ + offers?: Array; + } + + + /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ + export interface OfferResponse { + + /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ + offerId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ + export interface Offers { + + /** This is the URL to the current page of offers. */ + href?: string | null; + + /** + * This integer value is the number of offers that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ + next?: string | null; + + /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ + offers?: Array; + + /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ + prev?: string | null; + + /** + * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ + export interface PublishByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ + export interface PublishResponse { + + /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ + listingId?: string | null; + + /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ + warnings?: Array; + } + + + /** This type is used to show the version number and instance of the service or API. */ + export interface Version { + + /** This type is used to show the version number and instance of the service or API. */ + instance?: Version; + + /** The version number of the service or API. */ + version?: string | null; + } + + + /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ + export interface WithdrawByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** The base response of the withdrawOffer call. */ + export interface WithdrawResponse { + + /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ + listingId?: string | null; + + /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ + warnings?: Array; + } + + @autoinject() + export class LocationClient { + constructor(private http: HttpClient) { + } + + /** + * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 + * @return {InventoryLocationResponse} Success + */ + GetInventoryLocation(merchantLocationKey: string): Promise { + return this.http.get('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 + * @param {InventoryLocationFull} requestBody Inventory Location details + * @return {void} + */ + CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Promise { + return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. + * Delete location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 + * @return {void} + */ + DeleteInventoryLocation(merchantLocationKey: string): Promise { + return this.http.delete('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}); + } + + /** + * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/disable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 + * @return {string} Success + */ + DisableInventoryLocation(merchantLocationKey: string): Promise { + return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/enable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 + * @return {string} Success + */ + EnableInventoryLocation(merchantLocationKey: string): Promise { + return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, {}).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 + * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {LocationResponse} Success + */ + GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Promise { + return this.http.get('location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey}/update_location_details + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 + * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). + * @return {void} + */ + UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Promise { + return this.http.post('location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class Inventory_itemClient { + constructor(private http: HttpClient) { + } + + /** + * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Get inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. + * @return {InventoryItemWithSkuLocaleGroupid} Success + */ + GetInventoryItem(sku: string): Promise { + return this.http.get('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. + * Put inventory_item/{sku} + * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. + * @param {InventoryItem} requestBody Details of the inventory item record. + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Promise { + return this.http.put('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Delete inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. + * @return {void} + */ + DeleteInventoryItem(sku: string): Promise { + return this.http.delete('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}); + } + + /** + * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. + * Get inventory_item + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {InventoryItems} Success + */ + GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Promise { + return this.http.get('inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Post bulk_update_price_quantity + * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace + * @return {BulkPriceQuantityResponse} Success + */ + BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Promise { + return this.http.post('bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. + * Post bulk_create_or_replace_inventory_item + * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkInventoryItemResponse} Success + */ + BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Promise { + return this.http.post('bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Post bulk_get_inventory_item + * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkGetInventoryItemResponse} Success + */ + BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Promise { + return this.http.post('bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Product_compatibilityClient { + constructor(private http: HttpClient) { + } + + /** + * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Get inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {Compatibility} Success + */ + GetProductCompatibility(sku: string): Promise { + return this.http.get('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @param {Compatibility} requestBody Details of the compatibility + * @return {BaseResponse} Success + */ + CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Promise { + return this.http.put('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Delete inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {void} + */ + DeleteProductCompatibility(sku: string): Promise { + return this.http.delete('inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}); + } + } + + @autoinject() + export class OfferClient { + constructor(private http: HttpClient) { + } + + /** + * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer + * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. + * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. + * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {Offers} Success + */ + GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return this.http.get('offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. + * Post offer + * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {void} + */ + CreateOffer(requestBody: EbayOfferDetailsWithKeys): Promise { + return this.http.post('offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is to be retrieved. + * @return {EbayOfferDetailsWithAll} Success + */ + GetOffer(offerId: string): Promise { + return this.http.get('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. + * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel + * @return {OfferResponse} Success + */ + UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Promise { + return this.http.put('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. + * Delete offer/{offerId} + * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. + * @return {void} + */ + DeleteOffer(offerId: string): Promise { + return this.http.delete('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}); + } + + /** + * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post offer/{offerId}/publish/ + * @param {string} offerId The unique identifier of the offer that is to be published. + * @return {PublishResponse} Success + */ + PublishOffer(offerId: string): Promise { + return this.http.post('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. + * Post offer/publish_by_inventory_item_group/ + * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. + * @return {PublishResponse} Success + */ + PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Promise { + return this.http.post('offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. + * Post offer/withdraw_by_inventory_item_group + * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. + * @return {void} + */ + WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Promise { + return this.http.post('offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. + * Post offer/get_listing_fees + * @param {OfferKeysWithId} requestBody List of offers that needs fee information + * @return {FeesSummaryResponse} Success + */ + GetListingFees(requestBody: OfferKeysWithId): Promise { + return this.http.post('offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. + * Post bulk_create_offer + * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {BulkOfferResponse} Success + */ + BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Promise { + return this.http.post('bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post bulk_publish_offer + * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. + * @return {BulkPublishResponse} Success + */ + BulkPublishOffer(requestBody: BulkOffer): Promise { + return this.http.post('bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. + * Post offer/{offerId}/withdraw + * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. + * @return {WithdrawResponse} Success + */ + WithdrawOffer(offerId: string): Promise { + return this.http.post('offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Inventory_item_groupClient { + constructor(private http: HttpClient) { + } + + /** + * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. + * Get inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. + * @return {InventoryItemGroup} Success + */ + GetInventoryItemGroup(inventoryItemGroupKey: string): Promise { + return this.http.get('inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. + * @param {InventoryItemGroup} requestBody Details of the inventory Item Group + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Promise { + return this.http.put('inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call deletes the inventory item group for a given inventoryItemGroupKey value. + * Delete inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. + * @return {void} + */ + DeleteInventoryItemGroup(inventoryItemGroupKey: string): Promise { + return this.http.delete('inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}); + } + } + + @autoinject() + export class ListingClient { + constructor(private http: HttpClient) { + } + + /** + * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. + * Post bulk_migrate_listing + * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory + * @return {BulkMigrateListingResponse} Success + */ + BulkMigrateListing(requestBody: BulkMigrateListing): Promise { + return this.http.post('bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_listing.txt b/Tests/SwagTsTests/AureliaResults/sell_listing.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/sell_listing.txt rename to Tests/SwagTsTests/AureliaResults/sell_listing.ts index f2f05856..2d023dda 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_listing.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_listing.ts @@ -1,171 +1,171 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** The type that defines the fields for the currency and a monetary amount. */ - export interface Amount { - - /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. */ - value?: string | null; - } - - - /** The type that defines the fields for the item aspects. */ - export interface Aspect { - - /** The name of an aspect, such and Brand. */ - name?: string | null; - - /** A list of potential values for this aspect. */ - values?: Array; - } - - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ - donationPercentage?: string | null; - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** The type that defines the fields for the listing details. */ - export interface ItemDraft { - - /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - categoryId?: string | null; - - /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The type that defines the fields for the price details for an item. */ - pricingSummary?: PricingSummary; - - /** The type that defines the fields for the aspects of a product. */ - product?: Product; - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - } - - - /** The type that defines the fields for the price details for an item. */ - export interface PricingSummary { - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionReservePrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionStartPrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - price?: Amount; - } - - - /** The type that defines the fields for the aspects of a product. */ - export interface Product { - - /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ - aspects?: Array; - - /** The name brand of the item, such as Nike, Apple, etc. */ - brand?: string | null; - - /** The description of the item that was created by the seller. This can be plain text or rich content. */ - description?: string | null; - - /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - epid?: string | null; - - /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ - imageUrls?: Array; - - /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ - title?: string | null; - } - - - /** The type that defines the field for the createItemDraft response. */ - export interface ItemDraftResponse { - - /** The eBay generated ID of the listing draft. */ - itemDraftId?: string | null; - - /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ - sellFlowNativeUri?: string | null; - - /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ - sellFlowUrl?: string | null; - } - - @autoinject() - export class Item_draftClient { - constructor(private http: HttpClient) { - } - - /** - * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. - * Post item_draft/ - * @return {void} - */ - CreateItemDraft(requestBody: ItemDraft): Promise { - return this.http.post('item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** The type that defines the fields for the currency and a monetary amount. */ + export interface Amount { + + /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. */ + value?: string | null; + } + + + /** The type that defines the fields for the item aspects. */ + export interface Aspect { + + /** The name of an aspect, such and Brand. */ + name?: string | null; + + /** A list of potential values for this aspect. */ + values?: Array; + } + + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ + donationPercentage?: string | null; + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** The type that defines the fields for the listing details. */ + export interface ItemDraft { + + /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + categoryId?: string | null; + + /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The type that defines the fields for the price details for an item. */ + pricingSummary?: PricingSummary; + + /** The type that defines the fields for the aspects of a product. */ + product?: Product; + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + } + + + /** The type that defines the fields for the price details for an item. */ + export interface PricingSummary { + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionReservePrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionStartPrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + price?: Amount; + } + + + /** The type that defines the fields for the aspects of a product. */ + export interface Product { + + /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ + aspects?: Array; + + /** The name brand of the item, such as Nike, Apple, etc. */ + brand?: string | null; + + /** The description of the item that was created by the seller. This can be plain text or rich content. */ + description?: string | null; + + /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + epid?: string | null; + + /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ + imageUrls?: Array; + + /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ + title?: string | null; + } + + + /** The type that defines the field for the createItemDraft response. */ + export interface ItemDraftResponse { + + /** The eBay generated ID of the listing draft. */ + itemDraftId?: string | null; + + /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ + sellFlowNativeUri?: string | null; + + /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ + sellFlowUrl?: string | null; + } + + @autoinject() + export class Item_draftClient { + constructor(private http: HttpClient) { + } + + /** + * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. + * Post item_draft/ + * @return {void} + */ + CreateItemDraft(requestBody: ItemDraft): Promise { + return this.http.post('item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_logistics.txt b/Tests/SwagTsTests/AureliaResults/sell_logistics.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/sell_logistics.txt rename to Tests/SwagTsTests/AureliaResults/sell_logistics.ts index abe2bcf2..5bf781e4 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_logistics.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_logistics.ts @@ -1,487 +1,487 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ - export interface AdditionalOption { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalCost?: Amount; - - /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ - optionType?: string | null; - } - - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains contact information for an individual buyer or seller. */ - export interface Contact { - - /** The company name with which the contact is associated. */ - companyName?: string | null; - - /** This complex type specifies the details of a geographical address. */ - contactAddress?: ContactAddress; - - /** The contact's full name. */ - fullName?: string | null; - - /** This complex type contains a string field representing a telephone number. */ - primaryPhone?: PhoneNumber; - } - - - /** This complex type specifies the details of a geographical address. */ - export interface ContactAddress { - - /** The first line of the street address. */ - addressLine1?: string | null; - - /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ - addressLine2?: string | null; - - /** The city in which the address is located. */ - city?: string | null; - - /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ - county?: string | null; - - /** The postal code of the address. */ - postalCode?: string | null; - - /** The state or province in which the address is located. States and provinces often contain multiple counties. */ - stateOrProvince?: string | null; - } - - - /** This complex type contains a string field representing a telephone number. */ - export interface PhoneNumber { - - /** A telephone number. */ - phoneNumber?: string | null; - } - - - /** This complex type contains the request payload for the createFromShippingQuote method. */ - export interface CreateShipmentFromQuoteRequest { - - /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ - additionalOptions?: Array; - - /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ - labelCustomMessage?: string | null; - - /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ - labelSize?: string | null; - - /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ - rateId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ - shippingQuoteId?: string | null; - } - - - /** This complex type defines the dimensions of a package to be shipped. */ - export interface Dimensions { - - /** The numeric value of the height of the package. */ - height?: string | null; - - /** The numeric value of the length of the package. */ - length?: string | null; - - /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the width of the package. */ - width?: string | null; - } - - - /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ - export interface Order { - - /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ - channel?: string | null; - - /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ - orderId?: string | null; - } - - - /** This complex type specifies the dimensions and weight of a package. */ - export interface PackageSpecification { - - /** This complex type defines the dimensions of a package to be shipped. */ - dimensions?: Dimensions; - - /** This complex type contains information about the weight of an object such as a shipping package. */ - weight?: Weight; - } - - - /** This complex type contains information about the weight of an object such as a shipping package. */ - export interface Weight { - - /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the weight of the package, as measured by the value of unit. */ - value?: string | null; - } - - - /** This complex type defines a time window for the pickup of a package. */ - export interface PickupSlot { - - /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ - pickupSlotEndTime?: string | null; - - /** Seller-defined name for the pickup slot. */ - pickupSlotId?: string | null; - - /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ - pickupSlotStartTime?: string | null; - - /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ - pickupSlotTimeZone?: string | null; - } - - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - export interface PurchasedRate { - - /** An list of additional, optional features that have been purchased for the shipment. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ - destinationTimeZone?: string | null; - - /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - maxEstimatedDeliveryDate?: string | null; - - /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ - pickupSlotId?: string | null; - - /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ - rateId?: string | null; - - /** The ID code for the carrier that was selected for the package shipment. */ - shippingCarrierCode?: string | null; - - /** The name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ - shippingQuoteId?: string | null; - - /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ - shippingServiceCode?: string | null; - - /** The name of the shipping service. */ - shippingServiceName?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - totalShippingCost?: Amount; - } - - - /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ - export interface Rate { - - /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ - destinationTimeZone?: string | null; - - /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ - maxEstimatedDeliveryDate?: string | null; - - /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** A list of available pickup slots for the package. */ - pickupSlots?: Array; - - /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The unique eBay-assigned ID for this shipping rate. */ - rateId?: string | null; - - /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ - rateRecommendation?: Array; - - /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ - shippingCarrierCode?: string | null; - - /** The common name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ - shippingServiceCode?: string | null; - - /** The common name of the shipping service. */ - shippingServiceName?: string | null; - } - - - /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ - export interface Shipment { - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - cancellation?: ShipmentCancellation; - - /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - creationDate?: string | null; - - /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ - labelCustomMessage?: string | null; - - /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ - labelDownloadUrl?: string | null; - - /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ - labelSize?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - rate?: PurchasedRate; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ - shipmentId?: string | null; - - /** A unique carrier-assigned ID string that can be used to track the shipment. */ - shipmentTrackingNumber?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - export interface ShipmentCancellation { - - /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ - cancellationRequestedDate?: string | null; - - /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ - cancellationStatus?: string | null; - } - - - /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ - export interface ShippingQuote { - - /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ - creationDate?: string | null; - - /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ - expirationDate?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ - rates?: Array; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ - shippingQuoteId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - - /** A list of any warnings triggered by the request. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning message. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ - export interface ShippingQuoteRequest { - - /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - @autoinject() - export class ShipmentClient { - constructor(private http: HttpClient) { - } - - /** - * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. - * Post shipment/create_from_shipping_quote - * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. - * @return {void} - */ - CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Promise { - return this.http.post('shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. - * Get shipment/{shipmentId} - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - GetShipment(shipmentId: string): Promise { - return this.http.get('shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. - * Get shipment/{shipmentId}/download_label_file - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {void} Success - */ - DownloadLabelFile(shipmentId: string): Promise { - return this.http.get('shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', {}); - } - - /** - * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. - * Post shipment/{shipmentId}/cancel - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - CancelShipment(shipmentId: string): Promise { - return this.http.post('shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Shipping_quoteClient { - constructor(private http: HttpClient) { - } - - /** - * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. - * Post shipping_quote - * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. - * @return {void} - */ - CreateShippingQuote(requestBody: ShippingQuoteRequest): Promise { - return this.http.post('shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. - * Get shipping_quote/{shippingQuoteId} - * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. - * @return {ShippingQuote} Success - */ - GetShippingQuote(shippingQuoteId: string): Promise { - return this.http.get('shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ + export interface AdditionalOption { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalCost?: Amount; + + /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ + optionType?: string | null; + } + + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains contact information for an individual buyer or seller. */ + export interface Contact { + + /** The company name with which the contact is associated. */ + companyName?: string | null; + + /** This complex type specifies the details of a geographical address. */ + contactAddress?: ContactAddress; + + /** The contact's full name. */ + fullName?: string | null; + + /** This complex type contains a string field representing a telephone number. */ + primaryPhone?: PhoneNumber; + } + + + /** This complex type specifies the details of a geographical address. */ + export interface ContactAddress { + + /** The first line of the street address. */ + addressLine1?: string | null; + + /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ + addressLine2?: string | null; + + /** The city in which the address is located. */ + city?: string | null; + + /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ + county?: string | null; + + /** The postal code of the address. */ + postalCode?: string | null; + + /** The state or province in which the address is located. States and provinces often contain multiple counties. */ + stateOrProvince?: string | null; + } + + + /** This complex type contains a string field representing a telephone number. */ + export interface PhoneNumber { + + /** A telephone number. */ + phoneNumber?: string | null; + } + + + /** This complex type contains the request payload for the createFromShippingQuote method. */ + export interface CreateShipmentFromQuoteRequest { + + /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ + additionalOptions?: Array; + + /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ + labelCustomMessage?: string | null; + + /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ + labelSize?: string | null; + + /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ + rateId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ + shippingQuoteId?: string | null; + } + + + /** This complex type defines the dimensions of a package to be shipped. */ + export interface Dimensions { + + /** The numeric value of the height of the package. */ + height?: string | null; + + /** The numeric value of the length of the package. */ + length?: string | null; + + /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the width of the package. */ + width?: string | null; + } + + + /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ + export interface Order { + + /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ + channel?: string | null; + + /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ + orderId?: string | null; + } + + + /** This complex type specifies the dimensions and weight of a package. */ + export interface PackageSpecification { + + /** This complex type defines the dimensions of a package to be shipped. */ + dimensions?: Dimensions; + + /** This complex type contains information about the weight of an object such as a shipping package. */ + weight?: Weight; + } + + + /** This complex type contains information about the weight of an object such as a shipping package. */ + export interface Weight { + + /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the weight of the package, as measured by the value of unit. */ + value?: string | null; + } + + + /** This complex type defines a time window for the pickup of a package. */ + export interface PickupSlot { + + /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ + pickupSlotEndTime?: string | null; + + /** Seller-defined name for the pickup slot. */ + pickupSlotId?: string | null; + + /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ + pickupSlotStartTime?: string | null; + + /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ + pickupSlotTimeZone?: string | null; + } + + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + export interface PurchasedRate { + + /** An list of additional, optional features that have been purchased for the shipment. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ + destinationTimeZone?: string | null; + + /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + maxEstimatedDeliveryDate?: string | null; + + /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ + pickupSlotId?: string | null; + + /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ + rateId?: string | null; + + /** The ID code for the carrier that was selected for the package shipment. */ + shippingCarrierCode?: string | null; + + /** The name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ + shippingQuoteId?: string | null; + + /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ + shippingServiceCode?: string | null; + + /** The name of the shipping service. */ + shippingServiceName?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + totalShippingCost?: Amount; + } + + + /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ + export interface Rate { + + /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ + destinationTimeZone?: string | null; + + /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ + maxEstimatedDeliveryDate?: string | null; + + /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** A list of available pickup slots for the package. */ + pickupSlots?: Array; + + /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The unique eBay-assigned ID for this shipping rate. */ + rateId?: string | null; + + /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ + rateRecommendation?: Array; + + /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ + shippingCarrierCode?: string | null; + + /** The common name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ + shippingServiceCode?: string | null; + + /** The common name of the shipping service. */ + shippingServiceName?: string | null; + } + + + /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ + export interface Shipment { + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + cancellation?: ShipmentCancellation; + + /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + creationDate?: string | null; + + /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ + labelCustomMessage?: string | null; + + /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ + labelDownloadUrl?: string | null; + + /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ + labelSize?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + rate?: PurchasedRate; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ + shipmentId?: string | null; + + /** A unique carrier-assigned ID string that can be used to track the shipment. */ + shipmentTrackingNumber?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + export interface ShipmentCancellation { + + /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ + cancellationRequestedDate?: string | null; + + /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ + cancellationStatus?: string | null; + } + + + /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ + export interface ShippingQuote { + + /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ + creationDate?: string | null; + + /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ + expirationDate?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ + rates?: Array; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ + shippingQuoteId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + + /** A list of any warnings triggered by the request. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning message. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ + export interface ShippingQuoteRequest { + + /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + @autoinject() + export class ShipmentClient { + constructor(private http: HttpClient) { + } + + /** + * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. + * Post shipment/create_from_shipping_quote + * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. + * @return {void} + */ + CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Promise { + return this.http.post('shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. + * Get shipment/{shipmentId} + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + GetShipment(shipmentId: string): Promise { + return this.http.get('shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. + * Get shipment/{shipmentId}/download_label_file + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {void} Success + */ + DownloadLabelFile(shipmentId: string): Promise { + return this.http.get('shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', {}); + } + + /** + * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. + * Post shipment/{shipmentId}/cancel + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + CancelShipment(shipmentId: string): Promise { + return this.http.post('shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Shipping_quoteClient { + constructor(private http: HttpClient) { + } + + /** + * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. + * Post shipping_quote + * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. + * @return {void} + */ + CreateShippingQuote(requestBody: ShippingQuoteRequest): Promise { + return this.http.post('shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. + * Get shipping_quote/{shippingQuoteId} + * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. + * @return {ShippingQuote} Success + */ + GetShippingQuote(shippingQuoteId: string): Promise { + return this.http.get('shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_marketing.txt b/Tests/SwagTsTests/AureliaResults/sell_marketing.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/sell_marketing.txt rename to Tests/SwagTsTests/AureliaResults/sell_marketing.ts index e395e4e7..7c2b2617 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_marketing.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_marketing.ts @@ -1,1773 +1,1773 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** This type defines the fields for an ad. */ - export interface Ad { - - /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ - adId?: string | null; - - /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type is a container for a list of ad IDs. */ - export interface AdIds { - - /** A list of ad ID's. */ - adIds?: Array; - } - - - /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface AdPagedCollection { - - /** A list of ads contained on this page from the paginated response. */ - ads?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for an ad ID and its associated URL. */ - export interface AdReference { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** The URI of an ad. You can use this URI to retrieve the ad. */ - href?: string | null; - } - - - /** This type is a container for a list of ad IDs and their associated URIs. */ - export interface AdReferences { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines the fields returned in an ad response. */ - export interface AdResponse { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** An array of errors associated with the request. */ - errors?: Array; - - /** The URI that points to the ad. */ - href?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields returned in an error condition. */ - export interface Error { - - /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** The name of the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ - longMessage?: string | null; - - /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ - message?: string | null; - - /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** A name/value pair that provides parameter details regarding a warning or error condition. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** The value that was set for the element specified in the name field. */ - value?: string | null; - } - - - /** This type defines the container for an array of ads. */ - export interface Ads { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - export interface Amount { - - /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ - value?: string | null; - } - - - /** This type defines the fields for any warning error messages. */ - export interface BaseResponse { - - /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ - warnings?: Array; - } - - - /** This type defines the fields for the create ads in bulk response. */ - export interface BulkAdResponse { - - /** A list of ads processed by the call. */ - responses?: Array; - } - - - /** This type defines the fields for the create ads in bulk by listing IDs. */ - export interface BulkCreateAdRequest { - - /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ - requests?: Array; - } - - - /** This type defines the fields for the create ad request. */ - export interface CreateAdRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ - export interface BulkCreateAdsByInventoryReferenceRequest { - - /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to create ads by inventory reference ID request. */ - export interface CreateAdsByInventoryReferenceRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ - export interface BulkCreateAdsByInventoryReferenceResponse { - - /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ - responses?: Array; - } - - - /** This type defines the fields returned when you create an ad by inventory reference ID. */ - export interface CreateAdsByInventoryReferenceResponse { - - /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ - ads?: Array; - - /** An array of errors or warnings associated with the create-ads request. */ - errors?: Array; - - /** The seller's inventory reference ID that's associated with the ad. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that the call uses to remove ads in bulk. */ - export interface BulkDeleteAdRequest { - - /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - requests?: Array; - } - - - /** This type defines the fields used in a delete-ad request. */ - export interface DeleteAdRequest { - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ - export interface BulkDeleteAdResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned in a delete-ad response. */ - export interface DeleteAdResponse { - - /** The ID of the ad that was deleted. */ - adId?: string | null; - - /** An array of the errors or warnings associated with the request. */ - errors?: Array; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ - export interface BulkDeleteAdsByInventoryReferenceRequest { - - /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ - export interface DeleteAdsByInventoryReferenceRequest { - - /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ - export interface BulkDeleteAdsByInventoryReferenceResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ - export interface DeleteAdsByInventoryReferenceResponse { - - /** The list of ad IDs that were removed from the campaign. */ - adIds?: Array; - - /** The container for the errors associated with the request. */ - errors?: Array; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that describe an ad campaign. */ - export interface Campaign { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ - campaignId?: string | null; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ - campaignStatus?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - export interface CampaignCriterion { - - /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ - criterionType?: string | null; - - /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ - selectionRules?: Array; - } - - - /** This type specifies the selection rules used to create a campaign. */ - export interface SelectionRule { - - /** A list of the brands of the items to be included in the campaign. */ - brands?: Array; - - /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ - categoryIds?: Array; - - /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ - categoryScope?: string | null; - - /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ - listingConditionIds?: Array; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - maxPrice?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minPrice?: Amount; - } - - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - export interface FundingStrategy { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ - fundingModel?: string | null; - } - - - /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface CampaignPagedCollection { - - /** A list of campaigns contained on this page from the paginated response. */ - campaigns?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type contains a list of campaigns. */ - export interface Campaigns { - - /** An array of campaigns and their details. */ - campaigns?: Array; - } - - - /** This type defines the fields needed for a clone-campaign request. */ - export interface CloneCampaignRequest { - - /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ - export interface CreateCampaignRequest { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ - export interface CreateReportTask { - - /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ - dimensions?: Array; - - /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ - inventoryReferences?: Array; - - /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ - listingIds?: Array; - - /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ - metricKeys?: Array; - - /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ - export interface Dimension { - - /** A list of annotations associated with the dimension of the report. */ - annotationKeys?: Array; - - /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ - dimensionKey?: string | null; - } - - - /** This type defines the fields contained in an inventory reference ID. */ - export interface InventoryReference { - - /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ - inventoryReferenceId?: string | null; - - /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ - export interface DimensionKeyAnnotation { - - /** An annotation key associated with the dimension. */ - annotationKey?: string | null; - - /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - } - - - /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ - export interface DimensionMetadata { - - /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the dimension used to create the report. */ - dimensionKey?: string | null; - - /** An list of annotation keys associated with the specified dimension of the report. */ - dimensionKeyAnnotations?: Array; - } - - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - export interface DiscountBenefit { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffItem?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffOrder?: Amount; - - /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ - percentageOffItem?: string | null; - - /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ - percentageOffOrder?: string | null; - } - - - /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ - export interface DiscountRule { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountSpecification?: DiscountSpecification; - - /** - * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - export interface DiscountSpecification { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - forEachAmount?: Amount; - - /** - * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - forEachQuantity?: number | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minAmount?: Amount; - - /** - * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - minQuantity?: number | null; - - /** - * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfDiscountedItems?: number | null; - } - - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - export interface InventoryCriterion { - - /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ - inventoryCriterionType?: string | null; - - /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ - inventoryItems?: Array; - - /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ - listingIds?: Array; - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - ruleCriteria?: RuleCriteria; - } - - - /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ - export interface InventoryItem { - - /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ - inventoryReferenceId?: string | null; - } - - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - export interface RuleCriteria { - - /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeInventoryItems?: Array; - - /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeListingIds?: Array; - - /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ - markupInventoryItems?: Array; - - /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ - markupListingIds?: Array; - - /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ - selectionRules?: Array; - } - - - /** This type defines the fields used to describe an item price markdown promotion. */ - export interface ItemPriceMarkdown { - - /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ - applyFreeShipping?: boolean | null; - - /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ - blockPriceIncreaseInItemRevision?: boolean | null; - - /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ - selectedInventoryDiscounts?: Array; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ - export interface SelectedInventoryDiscount { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ - discountId?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** - * For markdown promotions, this field is reserved for future use. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ - export interface ItemPromotion { - - /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This complex type defines the fields returned for a promotion. */ - export interface ItemPromotionResponse { - - /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the name and data type of a metric. */ - export interface MetricMetadata { - - /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the metric. */ - metricKey?: string | null; - } - - - /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ - export interface PromotionDetail { - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** The URI of the promotion details. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields in a promotion-level report. */ - export interface PromotionReportDetail { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemRevenue?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderRevenue?: Amount; - - /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ - averageOrderSize?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** - * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemsSoldQuantity?: number | null; - - /** - * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfOrdersSold?: number | null; - - /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ - percentageSalesLift?: string | null; - - /** The URI of the promotion report. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ - promotionReportId?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ - promotions?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsReportPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list of promotionReports contained in the paginated result set. */ - promotionReports?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields included in the report. */ - export interface ReportMetadata { - - /** A list containing the metadata for the dimension used in the report. */ - dimensionMetadata?: Array; - - /** - * The maximum number of dimensions that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfDimensionsToRequest?: number | null; - - /** - * The maximum number of metrics that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfMetricsToRequest?: number | null; - - /** A list containing the metadata for the metrics in the report. */ - metricMetadata?: Array; - - /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the metadata used by the all report types. */ - export interface ReportMetadatas { - - /** A list of the metadata for the associated report type. */ - reportMetadata?: Array; - } - - - /** This type defines the fields in a report task. */ - export interface ReportTask { - - /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** A list containing the dimension in the report. */ - dimensions?: Array; - - /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ - inventoryReferences?: Array; - - /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingIds?: Array; - - /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A list of metrics for the report task. */ - metricKeys?: Array; - - /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportExpirationDate?: string | null; - - /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The URL of the generated report, which can be used to download the report once it has been generated. */ - reportHref?: string | null; - - /** A unique eBay-assigned ID for the report. */ - reportId?: string | null; - - /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ - reportName?: string | null; - - /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCompletionDate?: string | null; - - /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCreationDate?: string | null; - - /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskExpectedCompletionDate?: string | null; - - /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ - reportTaskId?: string | null; - - /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ - reportTaskStatus?: string | null; - - /** A status message with additional information about the report task. */ - reportTaskStatusMessage?: string | null; - - /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface ReportTaskPagedCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** A list of report tasks contained on this page from the paginated response. */ - reportTasks?: Array; - } - - - /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ - export interface SummaryReportResponse { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** The date the report was generated. */ - lastUpdated?: string | null; - - /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ - percentageSalesLift?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type specifies the bid percentage for an ad campaign. */ - export interface UpdateBidPercentageRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - } - - - /** This type specifies the updated name, and start and end dates for an update-campaign request. */ - export interface UpdateCampaignIdentificationRequest { - - /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ - campaignName?: string | null; - - /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ - startDate?: string | null; - } - - @autoinject() - export class AdClient { - constructor(private http: HttpClient) { - } - - /** - * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @return {BulkAdResponse} Success - */ - BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. - * @return {BulkDeleteAdsByInventoryReferenceResponse} Success - */ - BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. - * @return {BulkDeleteAdResponse} Success - */ - BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. - * @return {BulkAdResponse} Success - */ - BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {AdPagedCollection} Success - */ - GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Promise { - return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. - * @return {void} - */ - CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. - * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. - * @return {void} - */ - CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. - * Get ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Ad} Success - */ - GetAd(ad_id: string, campaign_id: string): Promise { - return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. - * Delete ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteAd(ad_id: string, campaign_id: string): Promise { - return this.http.delete('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}); - } - - /** - * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. - * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. - * @return {AdIds} Success - */ - DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. - * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. - * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. - * @return {Ads} Success - */ - GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Promise { - return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. - * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid - * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. - * @return {void} - */ - UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class CampaignClient { - constructor(private http: HttpClient) { - } - - /** - * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). - * Post ad_campaign/{campaign_id}/clone - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. - * @return {void} - */ - CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign - * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name - * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status - * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. - * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. - * @return {CampaignPagedCollection} Success - */ - GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Promise { - return this.http.get('ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. - * Post ad_campaign - * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. - * @return {void} - */ - CreateCampaign(requestBody: CreateCampaignRequest): Promise { - return this.http.post('ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Campaign} Success - */ - GetCampaign(campaign_id: string): Promise { - return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Delete ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteCampaign(campaign_id: string): Promise { - return this.http.delete('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}); - } - - /** - * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/end - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - EndCampaign(campaign_id: string): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, {}); - } - - /** - * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/find_campaign_by_ad_reference - * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} listing_id Identifier of the eBay listing associated with the ad. - * @return {Campaigns} Success - */ - FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Promise { - return this.http.get('ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/get_campaign_by_name - * @param {string} campaign_name Name of the campaign. - * @return {Campaign} Success - */ - GetCampaignByName(campaign_name: string): Promise { - return this.http.get('ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/pause - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - PauseCampaign(campaign_id: string): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, {}); - } - - /** - * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/resume - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - ResumeCampaign(campaign_id: string): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, {}); - } - - /** - * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. - * Post ad_campaign/{campaign_id}/update_campaign_identification - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. - * @return {void} - */ - UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Promise { - return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @autoinject() - export class Ad_reportClient { - constructor(private http: HttpClient) { - } - - /** - * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. - * Get ad_report/{report_id} - * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. - * @return {void} Success - */ - GetReport(report_id: string): Promise { - return this.http.get('ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), {}); - } - } - - @autoinject() - export class Ad_report_metadataClient { - constructor(private http: HttpClient) { - } - - /** - * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. - * Get ad_report_metadata - * @return {ReportMetadatas} Success - */ - GetReportMetadata(): Promise { - return this.http.get('ad_report_metadata', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. - * Get ad_report_metadata/{report_type} - * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT - * @return {ReportMetadata} Success - */ - GetReportMetadataForReportType(report_type: string): Promise { - return this.http.get('ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Ad_report_taskClient { - constructor(private http: HttpClient) { - } - - /** - * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. - * Get ad_report_task - * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 - * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED - * @return {ReportTaskPagedCollection} Success - */ - GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Promise { - return this.http.get('ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. - * Post ad_report_task - * @param {CreateReportTask} requestBody The container for the fields that define the report task. - * @return {void} - */ - CreateReportTask(requestBody: CreateReportTask): Promise { - return this.http.post('ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Get ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {ReportTask} Success - */ - GetReportTask(report_task_id: string): Promise { - return this.http.get('ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Delete ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {void} - */ - DeleteReportTask(report_task_id: string): Promise { - return this.http.delete('ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}); - } - } - - @autoinject() - export class Item_price_markdownClient { - constructor(private http: HttpClient) { - } - - /** - * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. - * Post item_price_markdown - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {void} - */ - CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Promise { - return this.http.post('item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPriceMarkdown} Success - */ - GetItemPriceMarkdownPromotion(promotion_id: string): Promise { - return this.http.get('item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. - * Put item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {string} Success - */ - UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Promise { - return this.http.put('item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); - } - - /** - * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. - * Delete item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPriceMarkdownPromotion(promotion_id: string): Promise { - return this.http.delete('item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); - } - } - - @autoinject() - export class Item_promotionClient { - constructor(private http: HttpClient) { - } - - /** - * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. - * Post item_promotion - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {void} - */ - CreateItemPromotion(requestBody: ItemPromotion): Promise { - return this.http.post('item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPromotionResponse} Success - */ - GetItemPromotion(promotion_id: string): Promise { - return this.http.get('item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. - * Put item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {BaseResponse} Success - */ - UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Promise { - return this.http.put('item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. - * Delete item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPromotion(promotion_id: string): Promise { - return this.http.delete('item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); - } - } - - @autoinject() - export class PromotionClient { - constructor(private http: HttpClient) { - } - - /** - * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 - * Get promotion/{promotion_id}/get_listing_set - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {string} q Reserved for future use. - * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html - * @return {void} - */ - GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Promise { - return this.http.get('promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), {}); - } - - /** - * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 - * Get promotion - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 - * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @return {PromotionsPagedCollection} Success - */ - GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Promise { - return this.http.get('promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). - * Post promotion/{promotion_id}/pause - * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - PausePromotion(promotion_id: string): Promise { - return this.http.post('promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, {}); - } - - /** - * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. - * Post promotion/{promotion_id}/resume - * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - ResumePromotion(promotion_id: string): Promise { - return this.http.post('promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, {}); - } - } - - @autoinject() - export class Promotion_reportClient { - constructor(private http: HttpClient) { - } - - /** - * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. - * Get promotion_report - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 - * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @return {PromotionsReportPagedCollection} Success - */ - GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Promise { - return this.http.get('promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class Promotion_summary_reportClient { - constructor(private http: HttpClient) { - } - - /** - * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. - * Get promotion_summary_report - * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @return {SummaryReportResponse} Success - */ - GetPromotionSummaryReport(marketplace_id: string): Promise { - return this.http.get('promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** This type defines the fields for an ad. */ + export interface Ad { + + /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ + adId?: string | null; + + /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type is a container for a list of ad IDs. */ + export interface AdIds { + + /** A list of ad ID's. */ + adIds?: Array; + } + + + /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface AdPagedCollection { + + /** A list of ads contained on this page from the paginated response. */ + ads?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for an ad ID and its associated URL. */ + export interface AdReference { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** The URI of an ad. You can use this URI to retrieve the ad. */ + href?: string | null; + } + + + /** This type is a container for a list of ad IDs and their associated URIs. */ + export interface AdReferences { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines the fields returned in an ad response. */ + export interface AdResponse { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** An array of errors associated with the request. */ + errors?: Array; + + /** The URI that points to the ad. */ + href?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields returned in an error condition. */ + export interface Error { + + /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** The name of the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ + longMessage?: string | null; + + /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ + message?: string | null; + + /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** A name/value pair that provides parameter details regarding a warning or error condition. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** The value that was set for the element specified in the name field. */ + value?: string | null; + } + + + /** This type defines the container for an array of ads. */ + export interface Ads { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + export interface Amount { + + /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ + value?: string | null; + } + + + /** This type defines the fields for any warning error messages. */ + export interface BaseResponse { + + /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ + warnings?: Array; + } + + + /** This type defines the fields for the create ads in bulk response. */ + export interface BulkAdResponse { + + /** A list of ads processed by the call. */ + responses?: Array; + } + + + /** This type defines the fields for the create ads in bulk by listing IDs. */ + export interface BulkCreateAdRequest { + + /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ + requests?: Array; + } + + + /** This type defines the fields for the create ad request. */ + export interface CreateAdRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ + export interface BulkCreateAdsByInventoryReferenceRequest { + + /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to create ads by inventory reference ID request. */ + export interface CreateAdsByInventoryReferenceRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ + export interface BulkCreateAdsByInventoryReferenceResponse { + + /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ + responses?: Array; + } + + + /** This type defines the fields returned when you create an ad by inventory reference ID. */ + export interface CreateAdsByInventoryReferenceResponse { + + /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ + ads?: Array; + + /** An array of errors or warnings associated with the create-ads request. */ + errors?: Array; + + /** The seller's inventory reference ID that's associated with the ad. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that the call uses to remove ads in bulk. */ + export interface BulkDeleteAdRequest { + + /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + requests?: Array; + } + + + /** This type defines the fields used in a delete-ad request. */ + export interface DeleteAdRequest { + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ + export interface BulkDeleteAdResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned in a delete-ad response. */ + export interface DeleteAdResponse { + + /** The ID of the ad that was deleted. */ + adId?: string | null; + + /** An array of the errors or warnings associated with the request. */ + errors?: Array; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ + export interface BulkDeleteAdsByInventoryReferenceRequest { + + /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ + export interface DeleteAdsByInventoryReferenceRequest { + + /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ + export interface BulkDeleteAdsByInventoryReferenceResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ + export interface DeleteAdsByInventoryReferenceResponse { + + /** The list of ad IDs that were removed from the campaign. */ + adIds?: Array; + + /** The container for the errors associated with the request. */ + errors?: Array; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that describe an ad campaign. */ + export interface Campaign { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ + campaignId?: string | null; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ + campaignStatus?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + export interface CampaignCriterion { + + /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ + criterionType?: string | null; + + /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ + selectionRules?: Array; + } + + + /** This type specifies the selection rules used to create a campaign. */ + export interface SelectionRule { + + /** A list of the brands of the items to be included in the campaign. */ + brands?: Array; + + /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ + categoryIds?: Array; + + /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ + categoryScope?: string | null; + + /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ + listingConditionIds?: Array; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + maxPrice?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minPrice?: Amount; + } + + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + export interface FundingStrategy { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ + fundingModel?: string | null; + } + + + /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface CampaignPagedCollection { + + /** A list of campaigns contained on this page from the paginated response. */ + campaigns?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type contains a list of campaigns. */ + export interface Campaigns { + + /** An array of campaigns and their details. */ + campaigns?: Array; + } + + + /** This type defines the fields needed for a clone-campaign request. */ + export interface CloneCampaignRequest { + + /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ + export interface CreateCampaignRequest { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ + export interface CreateReportTask { + + /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ + dimensions?: Array; + + /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ + inventoryReferences?: Array; + + /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ + listingIds?: Array; + + /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ + metricKeys?: Array; + + /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ + export interface Dimension { + + /** A list of annotations associated with the dimension of the report. */ + annotationKeys?: Array; + + /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ + dimensionKey?: string | null; + } + + + /** This type defines the fields contained in an inventory reference ID. */ + export interface InventoryReference { + + /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ + inventoryReferenceId?: string | null; + + /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ + export interface DimensionKeyAnnotation { + + /** An annotation key associated with the dimension. */ + annotationKey?: string | null; + + /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + } + + + /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ + export interface DimensionMetadata { + + /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the dimension used to create the report. */ + dimensionKey?: string | null; + + /** An list of annotation keys associated with the specified dimension of the report. */ + dimensionKeyAnnotations?: Array; + } + + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + export interface DiscountBenefit { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffItem?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffOrder?: Amount; + + /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ + percentageOffItem?: string | null; + + /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ + percentageOffOrder?: string | null; + } + + + /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ + export interface DiscountRule { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountSpecification?: DiscountSpecification; + + /** + * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + export interface DiscountSpecification { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + forEachAmount?: Amount; + + /** + * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + forEachQuantity?: number | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minAmount?: Amount; + + /** + * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + minQuantity?: number | null; + + /** + * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfDiscountedItems?: number | null; + } + + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + export interface InventoryCriterion { + + /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ + inventoryCriterionType?: string | null; + + /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ + inventoryItems?: Array; + + /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ + listingIds?: Array; + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + ruleCriteria?: RuleCriteria; + } + + + /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ + export interface InventoryItem { + + /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ + inventoryReferenceId?: string | null; + } + + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + export interface RuleCriteria { + + /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeInventoryItems?: Array; + + /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeListingIds?: Array; + + /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ + markupInventoryItems?: Array; + + /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ + markupListingIds?: Array; + + /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ + selectionRules?: Array; + } + + + /** This type defines the fields used to describe an item price markdown promotion. */ + export interface ItemPriceMarkdown { + + /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ + applyFreeShipping?: boolean | null; + + /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ + blockPriceIncreaseInItemRevision?: boolean | null; + + /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ + selectedInventoryDiscounts?: Array; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ + export interface SelectedInventoryDiscount { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ + discountId?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** + * For markdown promotions, this field is reserved for future use. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ + export interface ItemPromotion { + + /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This complex type defines the fields returned for a promotion. */ + export interface ItemPromotionResponse { + + /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the name and data type of a metric. */ + export interface MetricMetadata { + + /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the metric. */ + metricKey?: string | null; + } + + + /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ + export interface PromotionDetail { + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** The URI of the promotion details. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields in a promotion-level report. */ + export interface PromotionReportDetail { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemRevenue?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderRevenue?: Amount; + + /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ + averageOrderSize?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** + * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemsSoldQuantity?: number | null; + + /** + * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfOrdersSold?: number | null; + + /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ + percentageSalesLift?: string | null; + + /** The URI of the promotion report. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ + promotionReportId?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ + promotions?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsReportPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list of promotionReports contained in the paginated result set. */ + promotionReports?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields included in the report. */ + export interface ReportMetadata { + + /** A list containing the metadata for the dimension used in the report. */ + dimensionMetadata?: Array; + + /** + * The maximum number of dimensions that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfDimensionsToRequest?: number | null; + + /** + * The maximum number of metrics that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfMetricsToRequest?: number | null; + + /** A list containing the metadata for the metrics in the report. */ + metricMetadata?: Array; + + /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the metadata used by the all report types. */ + export interface ReportMetadatas { + + /** A list of the metadata for the associated report type. */ + reportMetadata?: Array; + } + + + /** This type defines the fields in a report task. */ + export interface ReportTask { + + /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** A list containing the dimension in the report. */ + dimensions?: Array; + + /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ + inventoryReferences?: Array; + + /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingIds?: Array; + + /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A list of metrics for the report task. */ + metricKeys?: Array; + + /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportExpirationDate?: string | null; + + /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The URL of the generated report, which can be used to download the report once it has been generated. */ + reportHref?: string | null; + + /** A unique eBay-assigned ID for the report. */ + reportId?: string | null; + + /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ + reportName?: string | null; + + /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCompletionDate?: string | null; + + /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCreationDate?: string | null; + + /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskExpectedCompletionDate?: string | null; + + /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ + reportTaskId?: string | null; + + /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ + reportTaskStatus?: string | null; + + /** A status message with additional information about the report task. */ + reportTaskStatusMessage?: string | null; + + /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface ReportTaskPagedCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** A list of report tasks contained on this page from the paginated response. */ + reportTasks?: Array; + } + + + /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ + export interface SummaryReportResponse { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** The date the report was generated. */ + lastUpdated?: string | null; + + /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ + percentageSalesLift?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type specifies the bid percentage for an ad campaign. */ + export interface UpdateBidPercentageRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + } + + + /** This type specifies the updated name, and start and end dates for an update-campaign request. */ + export interface UpdateCampaignIdentificationRequest { + + /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ + campaignName?: string | null; + + /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ + startDate?: string | null; + } + + @autoinject() + export class AdClient { + constructor(private http: HttpClient) { + } + + /** + * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @return {BulkAdResponse} Success + */ + BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. + * @return {BulkDeleteAdsByInventoryReferenceResponse} Success + */ + BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. + * @return {BulkDeleteAdResponse} Success + */ + BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. + * @return {BulkAdResponse} Success + */ + BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {AdPagedCollection} Success + */ + GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Promise { + return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. + * @return {void} + */ + CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. + * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. + * @return {void} + */ + CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. + * Get ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Ad} Success + */ + GetAd(ad_id: string, campaign_id: string): Promise { + return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. + * Delete ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteAd(ad_id: string, campaign_id: string): Promise { + return this.http.delete('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}); + } + + /** + * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. + * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. + * @return {AdIds} Success + */ + DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. + * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. + * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. + * @return {Ads} Success + */ + GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Promise { + return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. + * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid + * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. + * @return {void} + */ + UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class CampaignClient { + constructor(private http: HttpClient) { + } + + /** + * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). + * Post ad_campaign/{campaign_id}/clone + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. + * @return {void} + */ + CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign + * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name + * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status + * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. + * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. + * @return {CampaignPagedCollection} Success + */ + GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Promise { + return this.http.get('ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. + * Post ad_campaign + * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. + * @return {void} + */ + CreateCampaign(requestBody: CreateCampaignRequest): Promise { + return this.http.post('ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Campaign} Success + */ + GetCampaign(campaign_id: string): Promise { + return this.http.get('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Delete ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteCampaign(campaign_id: string): Promise { + return this.http.delete('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}); + } + + /** + * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/end + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + EndCampaign(campaign_id: string): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, {}); + } + + /** + * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/find_campaign_by_ad_reference + * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} listing_id Identifier of the eBay listing associated with the ad. + * @return {Campaigns} Success + */ + FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Promise { + return this.http.get('ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/get_campaign_by_name + * @param {string} campaign_name Name of the campaign. + * @return {Campaign} Success + */ + GetCampaignByName(campaign_name: string): Promise { + return this.http.get('ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/pause + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + PauseCampaign(campaign_id: string): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, {}); + } + + /** + * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/resume + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + ResumeCampaign(campaign_id: string): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, {}); + } + + /** + * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. + * Post ad_campaign/{campaign_id}/update_campaign_identification + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. + * @return {void} + */ + UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Promise { + return this.http.post('ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @autoinject() + export class Ad_reportClient { + constructor(private http: HttpClient) { + } + + /** + * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. + * Get ad_report/{report_id} + * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. + * @return {void} Success + */ + GetReport(report_id: string): Promise { + return this.http.get('ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), {}); + } + } + + @autoinject() + export class Ad_report_metadataClient { + constructor(private http: HttpClient) { + } + + /** + * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. + * Get ad_report_metadata + * @return {ReportMetadatas} Success + */ + GetReportMetadata(): Promise { + return this.http.get('ad_report_metadata', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. + * Get ad_report_metadata/{report_type} + * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT + * @return {ReportMetadata} Success + */ + GetReportMetadataForReportType(report_type: string): Promise { + return this.http.get('ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Ad_report_taskClient { + constructor(private http: HttpClient) { + } + + /** + * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. + * Get ad_report_task + * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 + * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED + * @return {ReportTaskPagedCollection} Success + */ + GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Promise { + return this.http.get('ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. + * Post ad_report_task + * @param {CreateReportTask} requestBody The container for the fields that define the report task. + * @return {void} + */ + CreateReportTask(requestBody: CreateReportTask): Promise { + return this.http.post('ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Get ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {ReportTask} Success + */ + GetReportTask(report_task_id: string): Promise { + return this.http.get('ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Delete ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {void} + */ + DeleteReportTask(report_task_id: string): Promise { + return this.http.delete('ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}); + } + } + + @autoinject() + export class Item_price_markdownClient { + constructor(private http: HttpClient) { + } + + /** + * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. + * Post item_price_markdown + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {void} + */ + CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Promise { + return this.http.post('item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPriceMarkdown} Success + */ + GetItemPriceMarkdownPromotion(promotion_id: string): Promise { + return this.http.get('item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. + * Put item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {string} Success + */ + UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Promise { + return this.http.put('item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.text(); throw d;}); + } + + /** + * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. + * Delete item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPriceMarkdownPromotion(promotion_id: string): Promise { + return this.http.delete('item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); + } + } + + @autoinject() + export class Item_promotionClient { + constructor(private http: HttpClient) { + } + + /** + * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. + * Post item_promotion + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {void} + */ + CreateItemPromotion(requestBody: ItemPromotion): Promise { + return this.http.post('item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPromotionResponse} Success + */ + GetItemPromotion(promotion_id: string): Promise { + return this.http.get('item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. + * Put item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {BaseResponse} Success + */ + UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Promise { + return this.http.put('item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. + * Delete item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPromotion(promotion_id: string): Promise { + return this.http.delete('item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); + } + } + + @autoinject() + export class PromotionClient { + constructor(private http: HttpClient) { + } + + /** + * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 + * Get promotion/{promotion_id}/get_listing_set + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {string} q Reserved for future use. + * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html + * @return {void} + */ + GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Promise { + return this.http.get('promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), {}); + } + + /** + * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 + * Get promotion + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 + * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @return {PromotionsPagedCollection} Success + */ + GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Promise { + return this.http.get('promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). + * Post promotion/{promotion_id}/pause + * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + PausePromotion(promotion_id: string): Promise { + return this.http.post('promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, {}); + } + + /** + * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. + * Post promotion/{promotion_id}/resume + * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + ResumePromotion(promotion_id: string): Promise { + return this.http.post('promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, {}); + } + } + + @autoinject() + export class Promotion_reportClient { + constructor(private http: HttpClient) { + } + + /** + * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. + * Get promotion_report + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 + * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @return {PromotionsReportPagedCollection} Success + */ + GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Promise { + return this.http.get('promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class Promotion_summary_reportClient { + constructor(private http: HttpClient) { + } + + /** + * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. + * Get promotion_summary_report + * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @return {SummaryReportResponse} Success + */ + GetPromotionSummaryReport(marketplace_id: string): Promise { + return this.http.get('promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_metadata.txt b/Tests/SwagTsTests/AureliaResults/sell_metadata.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/sell_metadata.txt rename to Tests/SwagTsTests/AureliaResults/sell_metadata.ts index 8ffa50bd..65fcb41d 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_metadata.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_metadata.ts @@ -1,366 +1,366 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** A unique ID for a sales tax jurisdiction. */ - export interface SalesTaxJurisdiction { - - /** The unique ID for a sales tax jurisdiction. */ - salesTaxJurisdictionId?: string | null; - } - - - /** This complex type contains a list of sales tax jurisdictions. */ - export interface SalesTaxJurisdictions { - - /** A list of sales tax jurisdictions. */ - salesTaxJurisdictions?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An amount of time, as measured by the time-measurement units specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for a error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - export interface AutomotivePartsCompatibilityPolicy { - - /** The category ID to which the automotive-parts-compatibility policies apply. */ - categoryId?: string | null; - - /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ - compatibilityBasedOn?: string | null; - - /** Indicates the compatibility classification of the part based on high-level vehicle types. */ - compatibleVehicleTypes?: Array; - - /** - * Specifies the maximum number of compatible vehicle-applications allowed per item. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfCompatibleVehicles?: number | null; - } - - export interface AutomotivePartsCompatibilityPolicyResponse { - - /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ - automotivePartsCompatibilityPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - export interface Exclusion { - - /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ - brands?: Array; - } - - export interface ItemCondition { - - /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ - conditionDescription?: string | null; - - /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ - conditionId?: string | null; - } - - export interface ItemConditionPolicy { - - /** The category ID to which the item-condition policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ - itemConditionRequired?: boolean | null; - - /** The item-condition values allowed in the category. */ - itemConditions?: Array; - } - - export interface ItemConditionPolicyResponse { - - /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ - itemConditionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ListingStructurePolicy { - - /** The category ID to which the listing-structure policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ - variationsSupported?: boolean | null; - } - - export interface ListingStructurePolicyResponse { - - /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ - listingStructurePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface NegotiatedPricePolicy { - - /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ - bestOfferAutoAcceptEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ - bestOfferAutoDeclineEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ - bestOfferCounterEnabled?: boolean | null; - - /** The category ID to which the negotiated-price policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - } - - export interface NegotiatedPricePolicyResponse { - - /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ - negotiatedPricePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ - export interface ProductAdoptionPolicy { - - /** The category ID to which the listing policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - exclusion?: Exclusion; - - /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ - productRequired?: boolean | null; - } - - - /** This is the response object returned by a call to getProductAdoptionPolicies. */ - export interface ProductAdoptionPolicyResponse { - - /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ - productAdoptionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ReturnPolicy { - - /** The category ID to which the return policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - domestic?: ReturnPolicyDetails; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - international?: ReturnPolicyDetails; - - /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ - required?: boolean | null; - } - - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - export interface ReturnPolicyDetails { - - /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ - policyDescriptionEnabled?: boolean | null; - - /** A list of refund methods allowed for the associated category. */ - refundMethods?: Array; - - /** A list of return methods allowed for the associated category. */ - returnMethods?: Array; - - /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ - returnPeriods?: Array; - - /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ - returnsAcceptanceEnabled?: boolean | null; - - /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ - returnShippingCostPayers?: Array; - } - - export interface ReturnPolicyResponse { - - /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ - returnPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - @autoinject() - export class CountryClient { - constructor(private http: HttpClient) { - } - - /** - * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. - * Get country/{countryCode}/sales_tax_jurisdiction - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. - * @return {SalesTaxJurisdictions} Success - */ - GetSalesTaxJurisdictions(countryCode: string): Promise { - return this.http.get('country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - - @autoinject() - export class MarketplaceClient { - constructor(private http: HttpClient) { - } - - /** - * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT - * @return {AutomotivePartsCompatibilityPolicyResponse} Success - */ - GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_item_condition_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ItemConditionPolicyResponse} Success - */ - GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_listing_structure_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ListingStructurePolicyResponse} Success - */ - GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_negotiated_price_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {NegotiatedPricePolicyResponse} Success - */ - GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_product_adoption_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ProductAdoptionPolicyResponse} Success - */ - GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_return_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** A unique ID for a sales tax jurisdiction. */ + export interface SalesTaxJurisdiction { + + /** The unique ID for a sales tax jurisdiction. */ + salesTaxJurisdictionId?: string | null; + } + + + /** This complex type contains a list of sales tax jurisdictions. */ + export interface SalesTaxJurisdictions { + + /** A list of sales tax jurisdictions. */ + salesTaxJurisdictions?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An amount of time, as measured by the time-measurement units specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for a error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + export interface AutomotivePartsCompatibilityPolicy { + + /** The category ID to which the automotive-parts-compatibility policies apply. */ + categoryId?: string | null; + + /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ + compatibilityBasedOn?: string | null; + + /** Indicates the compatibility classification of the part based on high-level vehicle types. */ + compatibleVehicleTypes?: Array; + + /** + * Specifies the maximum number of compatible vehicle-applications allowed per item. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfCompatibleVehicles?: number | null; + } + + export interface AutomotivePartsCompatibilityPolicyResponse { + + /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ + automotivePartsCompatibilityPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + export interface Exclusion { + + /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ + brands?: Array; + } + + export interface ItemCondition { + + /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ + conditionDescription?: string | null; + + /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ + conditionId?: string | null; + } + + export interface ItemConditionPolicy { + + /** The category ID to which the item-condition policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ + itemConditionRequired?: boolean | null; + + /** The item-condition values allowed in the category. */ + itemConditions?: Array; + } + + export interface ItemConditionPolicyResponse { + + /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ + itemConditionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ListingStructurePolicy { + + /** The category ID to which the listing-structure policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ + variationsSupported?: boolean | null; + } + + export interface ListingStructurePolicyResponse { + + /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ + listingStructurePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface NegotiatedPricePolicy { + + /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ + bestOfferAutoAcceptEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ + bestOfferAutoDeclineEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ + bestOfferCounterEnabled?: boolean | null; + + /** The category ID to which the negotiated-price policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + } + + export interface NegotiatedPricePolicyResponse { + + /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ + negotiatedPricePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ + export interface ProductAdoptionPolicy { + + /** The category ID to which the listing policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + exclusion?: Exclusion; + + /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ + productRequired?: boolean | null; + } + + + /** This is the response object returned by a call to getProductAdoptionPolicies. */ + export interface ProductAdoptionPolicyResponse { + + /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ + productAdoptionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ReturnPolicy { + + /** The category ID to which the return policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + domestic?: ReturnPolicyDetails; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + international?: ReturnPolicyDetails; + + /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ + required?: boolean | null; + } + + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + export interface ReturnPolicyDetails { + + /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ + policyDescriptionEnabled?: boolean | null; + + /** A list of refund methods allowed for the associated category. */ + refundMethods?: Array; + + /** A list of return methods allowed for the associated category. */ + returnMethods?: Array; + + /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ + returnPeriods?: Array; + + /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ + returnsAcceptanceEnabled?: boolean | null; + + /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ + returnShippingCostPayers?: Array; + } + + export interface ReturnPolicyResponse { + + /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ + returnPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + @autoinject() + export class CountryClient { + constructor(private http: HttpClient) { + } + + /** + * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. + * Get country/{countryCode}/sales_tax_jurisdiction + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. + * @return {SalesTaxJurisdictions} Success + */ + GetSalesTaxJurisdictions(countryCode: string): Promise { + return this.http.get('country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + + @autoinject() + export class MarketplaceClient { + constructor(private http: HttpClient) { + } + + /** + * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT + * @return {AutomotivePartsCompatibilityPolicyResponse} Success + */ + GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_item_condition_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ItemConditionPolicyResponse} Success + */ + GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_listing_structure_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ListingStructurePolicyResponse} Success + */ + GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_negotiated_price_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {NegotiatedPricePolicyResponse} Success + */ + GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_product_adoption_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ProductAdoptionPolicyResponse} Success + */ + GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_return_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return this.http.get('marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_negotiation.txt b/Tests/SwagTsTests/AureliaResults/sell_negotiation.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/sell_negotiation.txt rename to Tests/SwagTsTests/AureliaResults/sell_negotiation.ts index 4a2d53ec..98e4f71e 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_negotiation.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_negotiation.ts @@ -1,238 +1,238 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ - export interface CreateOffersRequest { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ - allowCounterOffer?: boolean | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ - offeredItems?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A complex type that defines the offer being made to an "interested" buyer. */ - export interface OfferedItem { - - /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ - discountPercentage?: string | null; - - /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ - listingId?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - price?: Amount; - - /** - * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ - export interface EligibleItem { - - /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ - listingId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** A complex type that defines an offer that a seller makes to eligible buyers. */ - export interface Offer { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ - allowCounterOffer?: boolean | null; - - /** This complex type identifies an eBay user. */ - buyer?: User; - - /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - creationDate?: string | null; - - /** The eBay UserName of the user (seller) who initiated the offer. */ - initiatedBy?: string | null; - - /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ - lastModifiedDate?: string | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ - offeredItems?: Array; - - /** A unique eBay-assigned identifier for the offer. */ - offerId?: string | null; - - /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ - offerStatus?: string | null; - - /** The type of offer being made. For implementation help, refer to eBay API documentation */ - offerType?: string | null; - - /** A unique, eBay-assigned ID for the revision of the offer. */ - revision?: string | null; - } - - - /** This complex type identifies an eBay user. */ - export interface User { - - /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ - maskedUsername?: string | null; - } - - - /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ - export interface PagedEligibleItemCollection { - - /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ - eligibleItems?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object returned from a SendOfferToInterestedBuyers request. */ - export interface SendOfferToInterestedBuyersCollectionResponse { - - /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ - offers?: Array; - } - - @autoinject() - export class OfferClient { - constructor(private http: HttpClient) { - } - - /** - * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Get find_eligible_items - * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 - * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {PagedEligibleItemCollection} Success - */ - FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Promise { - return this.http.get('find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - - /** - * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Post send_offer_to_interested_buyers - * @param {CreateOffersRequest} requestBody Send offer to eligible items request. - * @return {SendOfferToInterestedBuyersCollectionResponse} Success - */ - SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Promise { - return this.http.post('send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ + export interface CreateOffersRequest { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ + allowCounterOffer?: boolean | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ + offeredItems?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A complex type that defines the offer being made to an "interested" buyer. */ + export interface OfferedItem { + + /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ + discountPercentage?: string | null; + + /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ + listingId?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + price?: Amount; + + /** + * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ + export interface EligibleItem { + + /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ + listingId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** A complex type that defines an offer that a seller makes to eligible buyers. */ + export interface Offer { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ + allowCounterOffer?: boolean | null; + + /** This complex type identifies an eBay user. */ + buyer?: User; + + /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + creationDate?: string | null; + + /** The eBay UserName of the user (seller) who initiated the offer. */ + initiatedBy?: string | null; + + /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ + lastModifiedDate?: string | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ + offeredItems?: Array; + + /** A unique eBay-assigned identifier for the offer. */ + offerId?: string | null; + + /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ + offerStatus?: string | null; + + /** The type of offer being made. For implementation help, refer to eBay API documentation */ + offerType?: string | null; + + /** A unique, eBay-assigned ID for the revision of the offer. */ + revision?: string | null; + } + + + /** This complex type identifies an eBay user. */ + export interface User { + + /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ + maskedUsername?: string | null; + } + + + /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ + export interface PagedEligibleItemCollection { + + /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ + eligibleItems?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object returned from a SendOfferToInterestedBuyers request. */ + export interface SendOfferToInterestedBuyersCollectionResponse { + + /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ + offers?: Array; + } + + @autoinject() + export class OfferClient { + constructor(private http: HttpClient) { + } + + /** + * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Get find_eligible_items + * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 + * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {PagedEligibleItemCollection} Success + */ + FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Promise { + return this.http.get('find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + + /** + * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Post send_offer_to_interested_buyers + * @param {CreateOffersRequest} requestBody Send offer to eligible items request. + * @return {SendOfferToInterestedBuyersCollectionResponse} Success + */ + SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Promise { + return this.http.post('send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.json(); throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AureliaResults/sell_recommendation.txt b/Tests/SwagTsTests/AureliaResults/sell_recommendation.ts similarity index 98% rename from Tests/SwagTsTests/AureliaResults/sell_recommendation.txt rename to Tests/SwagTsTests/AureliaResults/sell_recommendation.ts index 3c7a64f7..dd174a29 100644 --- a/Tests/SwagTsTests/AureliaResults/sell_recommendation.txt +++ b/Tests/SwagTsTests/AureliaResults/sell_recommendation.ts @@ -1,162 +1,162 @@ -import {HttpClient} from 'aurelia-fetch-client'; -import {autoinject} from 'aurelia-framework'; -export namespace MyNS { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - export interface Ad { - - /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ - bidPercentages?: Array; - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - promoteWithAd?: PromoteWithAd; - } - - - /** A complex type that returns data related to Promoted Listings bid percentages. */ - export interface BidPercentages { - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - basis?: Basis; - - /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ - value?: string | null; - } - - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - export enum Basis { TRENDING = 0 } - - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ - export interface FindListingRecommendationRequest { - - /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ - listingIds?: Array; - } - - - /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ - export interface ListingRecommendation { - - /** An ID that identifies the active listing associated with the eBay recommendations. */ - listingId?: string | null; - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - marketing?: MarketingRecommendation; - } - - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - export interface MarketingRecommendation { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - ad?: Ad; - - /** A message that can conditionally accompany the listing information. */ - message?: string | null; - } - - - /** The high-level object used to return a set of Promoted Listings ad recommendations. */ - export interface PagedListingRecommendationCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ - listingRecommendations?: Array; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - @autoinject() - export class Listing_recommendationClient { - constructor(private http: HttpClient) { - } - - /** - * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. - * Post find - * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} - * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {void} Success - */ - FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Promise { - return this.http.post('find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import {HttpClient} from 'aurelia-fetch-client'; +import {autoinject} from 'aurelia-framework'; +export namespace MyNS { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + export interface Ad { + + /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ + bidPercentages?: Array; + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + promoteWithAd?: PromoteWithAd; + } + + + /** A complex type that returns data related to Promoted Listings bid percentages. */ + export interface BidPercentages { + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + basis?: Basis; + + /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ + value?: string | null; + } + + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + export enum Basis { TRENDING = 0 } + + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ + export interface FindListingRecommendationRequest { + + /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ + listingIds?: Array; + } + + + /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ + export interface ListingRecommendation { + + /** An ID that identifies the active listing associated with the eBay recommendations. */ + listingId?: string | null; + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + marketing?: MarketingRecommendation; + } + + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + export interface MarketingRecommendation { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + ad?: Ad; + + /** A message that can conditionally accompany the listing information. */ + message?: string | null; + } + + + /** The high-level object used to return a set of Promoted Listings ad recommendations. */ + export interface PagedListingRecommendationCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ + listingRecommendations?: Array; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + @autoinject() + export class Listing_recommendationClient { + constructor(private http: HttpClient) { + } + + /** + * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. + * Post find + * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} + * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {void} Success + */ + FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Promise { + return this.http.post('find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/Pet.txt b/Tests/SwagTsTests/AxiosResults/Pet.ts similarity index 96% rename from Tests/SwagTsTests/AxiosResults/Pet.txt rename to Tests/SwagTsTests/AxiosResults/Pet.ts index 2aa0148b..d05c6b80 100644 --- a/Tests/SwagTsTests/AxiosResults/Pet.txt +++ b/Tests/SwagTsTests/AxiosResults/Pet.ts @@ -1,399 +1,399 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Promise> { - return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Promise> { - return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise> { - return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class StoreClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Promise> { - return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise> { - return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise> { - return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise> { - return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Promise> { - return Axios.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Promise> { - return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Promise { - return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise> { - return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Promise> { + return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Promise> { + return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise> { + return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class StoreClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Promise> { + return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise> { + return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise> { + return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise> { + return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Promise> { + return Axios.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Promise> { + return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Promise { + return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise> { + return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/PetDelete.txt b/Tests/SwagTsTests/AxiosResults/PetDelete.ts similarity index 96% rename from Tests/SwagTsTests/AxiosResults/PetDelete.txt rename to Tests/SwagTsTests/AxiosResults/PetDelete.ts index 6c9a90a8..a4c9e4c3 100644 --- a/Tests/SwagTsTests/AxiosResults/PetDelete.txt +++ b/Tests/SwagTsTests/AxiosResults/PetDelete.ts @@ -1,21 +1,21 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise> { - return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise> { + return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/PetFindByStatus.txt b/Tests/SwagTsTests/AxiosResults/PetFindByStatus.ts similarity index 96% rename from Tests/SwagTsTests/AxiosResults/PetFindByStatus.txt rename to Tests/SwagTsTests/AxiosResults/PetFindByStatus.ts index 431d3691..22494c98 100644 --- a/Tests/SwagTsTests/AxiosResults/PetFindByStatus.txt +++ b/Tests/SwagTsTests/AxiosResults/PetFindByStatus.ts @@ -1,123 +1,123 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export class Misc { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus2 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus2(status: PetStatus): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus2?status=' + status, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus3 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus3(status: PetStatus): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus3?status=' + status, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export class Misc { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus2 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus2(status: PetStatus): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus2?status=' + status, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus3 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus3(status: PetStatus): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus3?status=' + status, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/PetGodClass.txt b/Tests/SwagTsTests/AxiosResults/PetGodClass.ts similarity index 96% rename from Tests/SwagTsTests/AxiosResults/PetGodClass.txt rename to Tests/SwagTsTests/AxiosResults/PetGodClass.ts index 2c804716..fe6754fe 100644 --- a/Tests/SwagTsTests/AxiosResults/PetGodClass.txt +++ b/Tests/SwagTsTests/AxiosResults/PetGodClass.ts @@ -1,336 +1,336 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - export class Misc { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPost(requestBody: Pet): Promise> { - return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPut(requestBody: Pet): Promise> { - return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - Pet_petIdGet(petId: string): Promise { - return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - Pet_petIdDelete(petId: string): Promise> { - return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - PetFindByStatusGetByStatus(status: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - PetFindByTagsGetByTags(tags: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - StoreInventoryGet(): Promise<{[id: string]: number }> { - return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - StoreOrderPost(requestBody: Order): Promise { - return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - StoreOrder_orderIdGet(orderId: string): Promise { - return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - StoreOrder_orderIdDelete(orderId: string): Promise> { - return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - UserPost(requestBody: User): Promise> { - return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - User_usernameGet(username: string): Promise { - return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - User_usernamePut(username: string, requestBody: User): Promise> { - return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - User_usernameDelete(username: string): Promise> { - return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithArrayPost(requestBody: Array): Promise> { - return Axios.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithListPost(requestBody: Array): Promise> { - return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - UserLoginGetByUsernameAndPassword(username: string, password: string): Promise { - return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - UserLogoutGet(): Promise> { - return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + export class Misc { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPost(requestBody: Pet): Promise> { + return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPut(requestBody: Pet): Promise> { + return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + Pet_petIdGet(petId: string): Promise { + return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + Pet_petIdDelete(petId: string): Promise> { + return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + PetFindByStatusGetByStatus(status: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + PetFindByTagsGetByTags(tags: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + StoreInventoryGet(): Promise<{[id: string]: number }> { + return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + StoreOrderPost(requestBody: Order): Promise { + return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + StoreOrder_orderIdGet(orderId: string): Promise { + return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + StoreOrder_orderIdDelete(orderId: string): Promise> { + return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + UserPost(requestBody: User): Promise> { + return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + User_usernameGet(username: string): Promise { + return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + User_usernamePut(username: string, requestBody: User): Promise> { + return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + User_usernameDelete(username: string): Promise> { + return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithArrayPost(requestBody: Array): Promise> { + return Axios.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithListPost(requestBody: Array): Promise> { + return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + UserLoginGetByUsernameAndPassword(username: string, password: string): Promise { + return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + UserLogoutGet(): Promise> { + return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/PetPathAsContainer.txt b/Tests/SwagTsTests/AxiosResults/PetPathAsContainer.ts similarity index 96% rename from Tests/SwagTsTests/AxiosResults/PetPathAsContainer.txt rename to Tests/SwagTsTests/AxiosResults/PetPathAsContainer.ts index ac7ddd84..b4a969c3 100644 --- a/Tests/SwagTsTests/AxiosResults/PetPathAsContainer.txt +++ b/Tests/SwagTsTests/AxiosResults/PetPathAsContainer.ts @@ -1,401 +1,401 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Post(requestBody: Pet): Promise> { - return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Put(requestBody: Pet): Promise> { - return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class Pet_petIdClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - GetByPetId(petId: string): Promise { - return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - DeleteByPetId(petId: string): Promise> { - return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); - } - } - - export class Pet_petIdUploadImageClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - } - - export class PetFindByStatusClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - GetByStatus(status: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class PetFindByTagsClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - GetByTags(tags: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class StoreInventoryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - Get(): Promise<{[id: string]: number }> { - return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class StoreOrderClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - Post(requestBody: Order): Promise { - return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class StoreOrder_orderIdClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - GetByOrderId(orderId: string): Promise { - return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - DeleteByOrderId(orderId: string): Promise> { - return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - Post(requestBody: User): Promise> { - return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class User_usernameClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetByUsername(username: string): Promise { - return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - PutByUsername(username: string, requestBody: User): Promise> { - return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteByUsername(username: string): Promise> { - return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); - } - } - - export class UserCreateWithArrayClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Promise> { - return Axios.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class UserCreateWithListClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Promise> { - return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class UserLoginClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - GetByUsernameAndPassword(username: string, password: string): Promise { - return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class UserLogoutClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - Get(): Promise> { - return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Post(requestBody: Pet): Promise> { + return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Put(requestBody: Pet): Promise> { + return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class Pet_petIdClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + GetByPetId(petId: string): Promise { + return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + DeleteByPetId(petId: string): Promise> { + return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); + } + } + + export class Pet_petIdUploadImageClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + } + + export class PetFindByStatusClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + GetByStatus(status: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class PetFindByTagsClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + GetByTags(tags: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class StoreInventoryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + Get(): Promise<{[id: string]: number }> { + return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class StoreOrderClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + Post(requestBody: Order): Promise { + return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class StoreOrder_orderIdClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + GetByOrderId(orderId: string): Promise { + return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + DeleteByOrderId(orderId: string): Promise> { + return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + Post(requestBody: User): Promise> { + return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class User_usernameClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetByUsername(username: string): Promise { + return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + PutByUsername(username: string, requestBody: User): Promise> { + return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteByUsername(username: string): Promise> { + return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); + } + } + + export class UserCreateWithArrayClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Promise> { + return Axios.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class UserCreateWithListClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Promise> { + return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class UserLoginClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + GetByUsernameAndPassword(username: string, password: string): Promise { + return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class UserLogoutClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + Get(): Promise> { + return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/PetStore.txt b/Tests/SwagTsTests/AxiosResults/PetStore.ts similarity index 97% rename from Tests/SwagTsTests/AxiosResults/PetStore.txt rename to Tests/SwagTsTests/AxiosResults/PetStore.ts index b45b2d4e..debd6228 100644 --- a/Tests/SwagTsTests/AxiosResults/PetStore.txt +++ b/Tests/SwagTsTests/AxiosResults/PetStore.ts @@ -1,312 +1,312 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface Order { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity?: number | null; - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - complete?: boolean | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Customer { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - address?: Array
; - } - - export interface Address { - street?: string | null; - city?: string | null; - state?: string | null; - zip?: string | null; - } - - export interface Category { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - firstName?: string | null; - lastName?: string | null; - email?: string | null; - password?: string | null; - phone?: string | null; - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export interface Tag { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface Pet { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Required */ - name: string; - category?: Category; - - /** Required */ - photoUrls: Array; - tags?: Array; - - /** pet status in the store */ - status?: PetStatus | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Update an existing pet - * Update an existing pet by Id - * Put pet - * @param {Pet} requestBody Update an existent pet in the store - * @return {Pet} Successful operation - */ - UpdatePet(requestBody: Pet): Promise { - return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Add a new pet to the store - * Add a new pet to the store - * Post pet - * @param {Pet} requestBody Create a new pet in the store - * @return {Pet} Successful operation - */ - AddPet(requestBody: Pet): Promise { - return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: PetStatus | null | undefined): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array | null | undefined): Promise> { - return Axios.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Updates a pet in the store with form data - * Post pet/{petId} - * @param {string} petId ID of pet that needs to be updated - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @param {string} name Name of pet that needs to be updated - * @param {string} status Status of pet that needs to be updated - * @return {void} - */ - UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise> { - return Axios.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { responseType: 'text' }); - } - - /** - * Deletes a pet - * delete a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise> { - return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); - } - } - - export class StoreClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Place an order for a pet - * Place a new order in the store - * Post store/order - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - * Get store/order/{orderId} - * @param {string} orderId ID of order that needs to be fetched - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeleteOrder(orderId: string): Promise> { - return Axios.delete(this.baseUri + 'store/order/' + orderId, { responseType: 'text' }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise> { - return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Creates list of users with given input array - * Post user/createWithList - * @return {User} Successful operation - */ - CreateUsersWithListInput(requestBody: Array): Promise { - return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string | null | undefined, password: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise> { - return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Update user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Update an existent user in the store - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise> { - return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise> { - return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface Order { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity?: number | null; + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + complete?: boolean | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Customer { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + address?: Array
; + } + + export interface Address { + street?: string | null; + city?: string | null; + state?: string | null; + zip?: string | null; + } + + export interface Category { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + firstName?: string | null; + lastName?: string | null; + email?: string | null; + password?: string | null; + phone?: string | null; + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export interface Tag { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface Pet { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Required */ + name: string; + category?: Category; + + /** Required */ + photoUrls: Array; + tags?: Array; + + /** pet status in the store */ + status?: PetStatus | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Update an existing pet + * Update an existing pet by Id + * Put pet + * @param {Pet} requestBody Update an existent pet in the store + * @return {Pet} Successful operation + */ + UpdatePet(requestBody: Pet): Promise { + return Axios.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Add a new pet to the store + * Add a new pet to the store + * Post pet + * @param {Pet} requestBody Create a new pet in the store + * @return {Pet} Successful operation + */ + AddPet(requestBody: Pet): Promise { + return Axios.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: PetStatus | null | undefined): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array | null | undefined): Promise> { + return Axios.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Updates a pet in the store with form data + * Post pet/{petId} + * @param {string} petId ID of pet that needs to be updated + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} name Name of pet that needs to be updated + * @param {string} status Status of pet that needs to be updated + * @return {void} + */ + UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise> { + return Axios.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { responseType: 'text' }); + } + + /** + * Deletes a pet + * delete a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise> { + return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); + } + } + + export class StoreClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Place an order for a pet + * Place a new order in the store + * Post store/order + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + * Get store/order/{orderId} + * @param {string} orderId ID of order that needs to be fetched + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeleteOrder(orderId: string): Promise> { + return Axios.delete(this.baseUri + 'store/order/' + orderId, { responseType: 'text' }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise> { + return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Creates list of users with given input array + * Post user/createWithList + * @return {User} Successful operation + */ + CreateUsersWithListInput(requestBody: Array): Promise { + return Axios.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string | null | undefined, password: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise> { + return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Update user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Update an existent user in the store + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise> { + return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise> { + return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/PetStoreExpanded.txt b/Tests/SwagTsTests/AxiosResults/PetStoreExpanded.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/PetStoreExpanded.txt rename to Tests/SwagTsTests/AxiosResults/PetStoreExpanded.ts index c5fb9cec..b72a5a30 100644 --- a/Tests/SwagTsTests/AxiosResults/PetStoreExpanded.txt +++ b/Tests/SwagTsTests/AxiosResults/PetStoreExpanded.ts @@ -1,67 +1,67 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface Pet extends NewPet { - id: string; - } - - export interface NewPet { - name: string; - tag?: string | null; - } - - export interface Error { - code: number; - message: string; - } - - export class Misc { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns all pets from the system that the user has access to - * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - * Get pets - * @param {Array} tags tags to filter by - * @param {number} limit maximum number of results to return - * @return {Array} pet response - */ - FindPets(tags: Array | null | undefined, limit: number | null | undefined): Promise> { - return Axios.get>(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Creates a new pet in the store. Duplicates are allowed - * Post pets - * @param {NewPet} requestBody Pet to add to the store - * @return {Pet} pet response - */ - AddPet(requestBody: NewPet): Promise { - return Axios.post(this.baseUri + 'pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Returns a user based on a single ID, if the user does not have access to the pet - * Get pets/{id} - * @param {string} id ID of pet to fetch - * @return {Pet} pet response - */ - FindPetById(id: string): Promise { - return Axios.get(this.baseUri + 'pets/' + id, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * deletes a single pet based on the ID supplied - * Delete pets/{id} - * @param {string} id ID of pet to delete - * @return {void} - */ - DeletePet(id: string): Promise> { - return Axios.delete(this.baseUri + 'pets/' + id, { responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface Pet extends NewPet { + id: string; + } + + export interface NewPet { + name: string; + tag?: string | null; + } + + export interface Error { + code: number; + message: string; + } + + export class Misc { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns all pets from the system that the user has access to + * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. + * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. + * Get pets + * @param {Array} tags tags to filter by + * @param {number} limit maximum number of results to return + * @return {Array} pet response + */ + FindPets(tags: Array | null | undefined, limit: number | null | undefined): Promise> { + return Axios.get>(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Creates a new pet in the store. Duplicates are allowed + * Post pets + * @param {NewPet} requestBody Pet to add to the store + * @return {Pet} pet response + */ + AddPet(requestBody: NewPet): Promise { + return Axios.post(this.baseUri + 'pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Returns a user based on a single ID, if the user does not have access to the pet + * Get pets/{id} + * @param {string} id ID of pet to fetch + * @return {Pet} pet response + */ + FindPetById(id: string): Promise { + return Axios.get(this.baseUri + 'pets/' + id, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * deletes a single pet based on the ID supplied + * Delete pets/{id} + * @param {string} id ID of pet to delete + * @return {void} + */ + DeletePet(id: string): Promise> { + return Axios.delete(this.baseUri + 'pets/' + id, { responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/Uspto.txt b/Tests/SwagTsTests/AxiosResults/Uspto.ts similarity index 97% rename from Tests/SwagTsTests/AxiosResults/Uspto.txt rename to Tests/SwagTsTests/AxiosResults/Uspto.ts index d7b2b2fd..9d1520c6 100644 --- a/Tests/SwagTsTests/AxiosResults/Uspto.txt +++ b/Tests/SwagTsTests/AxiosResults/Uspto.ts @@ -1,56 +1,56 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface DataSetList { - total?: number | null; - DataSetListApis?: Array; - } - - export interface DataSetListApis { - - /** To be used as a dataset parameter value */ - apiKey?: string | null; - - /** To be used as a version parameter value */ - apiVersionNumber?: string | null; - - /** The URL describing the dataset's fields */ - apiUrl?: string | null; - - /** A URL to the API console for each API */ - apiDocumentationUrl?: string | null; - } - - export class MetadataClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * List available data sets - * Get - * @return {DataSetList} Returns a list of data sets - */ - ListDataSets(): Promise { - return Axios.get(this.baseUri + '', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Provides the general information about the API and the list of fields that can be used to query the dataset. - * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. - * Get {dataset}/{version}/fields - * @param {string} dataset Name of the dataset. - * @param {string} version Version of the dataset. - * @return {string} The dataset API for the given version is found and it is accessible to consume. - */ - ListSearchableFields(dataset: string, version: string): Promise { - return Axios.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class SearchClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface DataSetList { + total?: number | null; + DataSetListApis?: Array; + } + + export interface DataSetListApis { + + /** To be used as a dataset parameter value */ + apiKey?: string | null; + + /** To be used as a version parameter value */ + apiVersionNumber?: string | null; + + /** The URL describing the dataset's fields */ + apiUrl?: string | null; + + /** A URL to the API console for each API */ + apiDocumentationUrl?: string | null; + } + + export class MetadataClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * List available data sets + * Get + * @return {DataSetList} Returns a list of data sets + */ + ListDataSets(): Promise { + return Axios.get(this.baseUri + '', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Provides the general information about the API and the list of fields that can be used to query the dataset. + * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. + * Get {dataset}/{version}/fields + * @param {string} dataset Name of the dataset. + * @param {string} version Version of the dataset. + * @return {string} The dataset API for the given version is found and it is accessible to consume. + */ + ListSearchableFields(dataset: string, version: string): Promise { + return Axios.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class SearchClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/ValuesPaths.txt b/Tests/SwagTsTests/AxiosResults/ValuesPaths.ts similarity index 97% rename from Tests/SwagTsTests/AxiosResults/ValuesPaths.txt rename to Tests/SwagTsTests/AxiosResults/ValuesPaths.ts index aa60d12d..45d5386d 100644 --- a/Tests/SwagTsTests/AxiosResults/ValuesPaths.txt +++ b/Tests/SwagTsTests/AxiosResults/ValuesPaths.ts @@ -1,53 +1,53 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export class ValuesClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Get api/Values - * @return {Array} Success - */ - ValuesGet(): Promise> { - return Axios.get>(this.baseUri + 'api/Values', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Post api/Values - * @return {string} Success - */ - ValuesPost(requestBody: string): Promise { - return Axios.post(this.baseUri + 'api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Get api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {string} Success - */ - ValuesGetById(id: number): Promise { - return Axios.get(this.baseUri + 'api/Values/' + id, { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Put api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesPutById(id: number, requestBody: string): Promise> { - return Axios.put(this.baseUri + 'api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Delete api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesDeleteById(id: number): Promise> { - return Axios.delete(this.baseUri + 'api/Values/' + id, { responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export class ValuesClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Get api/Values + * @return {Array} Success + */ + ValuesGet(): Promise> { + return Axios.get>(this.baseUri + 'api/Values', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Post api/Values + * @return {string} Success + */ + ValuesPost(requestBody: string): Promise { + return Axios.post(this.baseUri + 'api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Get api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {string} Success + */ + ValuesGetById(id: number): Promise { + return Axios.get(this.baseUri + 'api/Values/' + id, { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Put api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesPutById(id: number, requestBody: string): Promise> { + return Axios.put(this.baseUri + 'api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Delete api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesDeleteById(id: number): Promise> { + return Axios.delete(this.baseUri + 'api/Values/' + id, { responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/mcp.txt b/Tests/SwagTsTests/AxiosResults/mcp.ts similarity index 97% rename from Tests/SwagTsTests/AxiosResults/mcp.txt rename to Tests/SwagTsTests/AxiosResults/mcp.ts index 8ff1b6d8..c4da3ece 100644 --- a/Tests/SwagTsTests/AxiosResults/mcp.txt +++ b/Tests/SwagTsTests/AxiosResults/mcp.ts @@ -1,887 +1,887 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface BBSReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface ProviderType { - providerNumber: string; - } - - export interface BBSPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface PaymentRunType { - payerName?: string | null; - runDate?: Date | null; - runNumber?: string | null; - } - - export interface PaymentType { - accountInfo: BankAccountType; - depositAmount?: string | null; - paymentReference?: string | null; - } - - export interface BankAccountType { - accountName?: string | null; - accountNumber?: string | null; - bsbCode?: string | null; - } - - export interface ClaimSummaryType { - accountReferenceId?: string | null; - benefit?: string | null; - chargeAmount?: string | null; - claimChannelCode?: string | null; - claimId?: string | null; - lodgementDate?: Date | null; - transactionId?: string | null; - } - - export interface ServiceMessagesType { - highestSeverity: ServiceMessagesTypeHighestSeverity; - serviceMessage: Array; - } - - export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } - - export interface ServiceMessageType { - code: string; - severity: ServiceMessagesTypeHighestSeverity; - reason: string; - } - - export interface BBSProcessingReportResponseType { - claimAssessment?: ClaimAssessmentType; - status: string; - } - - export interface ClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface MedicalEventResponseType { - patient?: MembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface MembershipStatusType { - status?: StatusType; - currentMembership?: MembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface StatusType { - code?: number | null; - text?: string | null; - } - - export interface MembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - } - - export interface IdentityType { - dateOfBirth?: Date | null; - familyName?: string | null; - givenName?: string | null; - secondInitial?: string | null; - sex?: string | null; - } - - export interface ServiceResponseType { - error?: StatusType; - id?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface BulkBillStoreForwardRequestType { - claim: BulkBillClaimStoreForwardClaimType; - } - - export interface BulkBillClaimStoreForwardClaimType { - facilityId?: string | null; - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface BBSMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - medicalEventDate: Date; - medicalEventTime?: string | null; - patient: MedicarePatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface MedicarePatientType { - identity: IdentityType; - medicare: MembershipType; - } - - export interface ReferralType { - issueDate: Date; - period?: string | null; - periodCode?: string | null; - provider: ProviderType; - typeCode: string; - } - - export interface ServiceType { - id: string; - accessionDateTime?: Date | null; - aftercareOverrideInd?: string | null; - chargeAmount?: string | null; - collectionDateTime?: Date | null; - duplicateServiceOverrideInd?: string | null; - fieldQuantity?: string | null; - itemNumber?: string | null; - lspNumber?: string | null; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - restrictiveOverrideCode?: string | null; - rule3ExemptInd?: string | null; - s4b3ExemptInd?: string | null; - scpId?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - } - - export interface BulkBillStoreForwardResponseType { - claimId: string; - status: string; - } - - export interface AlliedHealthClaimRequestType { - claim: VAAClaimType; - } - - export interface VAAClaimType { - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface VAAMedicalEventType { - id: string; - acceptedDisability?: AcceptedDisabilityType; - authorisationDate: Date; - breakInEpisodeEndDate?: Date | null; - breakInEpisodeOfCareNumber?: string | null; - breakInEpisodeStartDate?: Date | null; - numberOfCNCHours?: string | null; - numberOfCNCVisits?: string | null; - createDateTime: Date; - numberOfENHours?: string | null; - numberOfENVisits?: string | null; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - numberOfNSSHours?: string | null; - numberOfNSSVisits?: string | null; - patient: VeteranPatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - numberOfRNHours?: string | null; - numberOfRNVisits?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface AcceptedDisabilityType { - code: string; - ind: string; - } - - export interface VAAServiceType { - id: string; - accountReferenceNumber?: string | null; - admissionDate?: Date | null; - chargeAmount?: string | null; - dischargeDate?: Date | null; - distanceKilometres?: number | null; - duplicateServiceOverrideInd?: string | null; - itemNumber: string; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - numberOfTeeth?: string | null; - opticalScriptCode?: string | null; - restrictiveOverrideCode?: string | null; - secondDeviceInd?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - toothNumber?: string | null; - upperLowerJawCode?: string | null; - } - - export interface VeteranPatientType extends PatientType { - veteranMembership?: VeteranMembershipType; - } - - export interface VeteranMembershipType { - veteranNumber: string; - } - - export interface PatientType { - identity: IdentityType; - residentialAddress?: AddressType; - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postcode?: string | null; - } - - export interface AlliedHealthClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAClaimRequestType { - claim: DVAClaimType; - } - - export interface DVAClaimType { - hospitalInd?: string | null; - serviceTypeCode: string; - medicalEvent: Array; - serviceProvider: ProviderType; - payeeProvider?: ProviderType; - } - - export interface DVAMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - referralOverrideCode?: string | null; - submissionAuthorityInd: string; - treatmentLocationCode?: string | null; - acceptedDisability?: AcceptedDisabilityType; - referral?: ReferralType; - patient: VeteranPatientType; - service: Array; - } - - export interface DVAServiceType extends ServiceType { - accountReferenceNumber?: string | null; - distanceKilometres?: number | null; - } - - export interface DVAClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface DVAPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface DVAProcessingReportResponseType { - claimAssessment?: DVAClaimAssessmentType; - status: string; - } - - export interface DVAClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface DVAMedicalEventAssessmentType { - patient?: VeteranMembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface VeteranMembershipStatusType { - currentMembership?: VeteranMembershipResponseType; - currentMember?: IdentityType; - status?: StatusType; - processDate?: Date | null; - } - - export interface DVAServiceAssessmentType { - id?: string | null; - accountReferenceNumber?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - gstInd?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface VeteranMembershipResponseType extends VeteranMembershipType { - entitlementCode?: string | null; - } - - export interface EnterpriseConcessionVerificationRequestType { - timeout?: number | null; - concessionVerificationRequest: Array; - } - - export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { - id: string; - } - - export interface ConcessionVerificationRequestType { - patient: MedicarePatientType; - dateOfService?: Date | null; - } - - export interface EnterpriseConcessionVerificationResponseType { - status: string; - concessionVerificationResponse?: Array; - } - - export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { - id: string; - } - - export interface ConcessionVerificationResponseType { - medicareStatus: MembershipStatusType; - concessionStatus: ConcessionStatusType; - } - - export interface ConcessionStatusType { - status?: StatusType; - processDate?: Date | null; - } - - export interface EnterprisePatientVerificationRequestType { - timeout?: number | null; - patientVerificationRequest: Array; - } - - export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { - id: string; - } - - export interface PatientVerificationRequestType { - patient: FundPatientType; - provider?: ProviderType; - dateOfService?: Date | null; - typeCode: string; - } - - export interface FundPatientType extends PatientType { - alsoKnownAs?: IdentityType; - medicare?: MembershipType; - healthFund?: FundMembershipType; - } - - export interface FundMembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - organisation?: string | null; - } - - export interface EnterprisePatientVerificationResponseType { - status: string; - patientVerificationResponse?: Array; - } - - export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { - id: string; - } - - export interface PatientVerificationResponseType { - medicareStatus?: MembershipStatusType; - healthFundStatus?: FundMembershipStatusType; - } - - export interface FundMembershipStatusType { - status?: StatusType; - currentMembership?: FundMembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface EnterpriseVeteranVerificationRequestType { - timeout?: number | null; - veteranVerificationRequest: Array; - } - - export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { - id: string; - } - - export interface VeteranVerificationRequestType { - patient: VeteranPatientType; - } - - export interface EnterpriseVeteranVerificationResponseType { - status: string; - veteranVerificationResponse?: Array; - } - - export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { - id?: string | null; - } - - export interface VeteranVerificationResponseType { - veteranStatus?: VeteranMembershipStatusType; - } - - export interface PatientClaimInteractiveRequestType { - patientClaimInteractive: PatientClaimInteractiveType; - } - - export interface PatientClaimInteractiveType { - patient: MedicarePatientType; - referral?: ReferralType; - claimant: ClaimantType; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - referralOverrideCode?: string | null; - accountPaidInd: string; - accountReferenceId?: string | null; - submissionAuthorityInd: string; - authorisationDate: Date; - } - - export interface PCIMedicalEventType { - service: Array; - id: string; - medicalEventDate: Date; - medicalEventTime?: string | null; - } - - export interface PCIServiceType extends ServiceType { - patientContribAmount?: string | null; - facilityId?: string | null; - hospitalInd?: string | null; - } - - export interface ClaimantType extends MedicarePatientType { - eftDetails?: BankAccountType; - residentialAddress?: AddressType; - contactDetails?: ContactType; - } - - export interface ContactType { - emailAddress?: string | null; - name?: string | null; - phoneNumber?: string | null; - } - - export interface PatientClaimInteractiveResponseType { - claimAssessment: PCIAssessmentType; - status: string; - } - - export interface PCIAssessmentType { - claimant?: CurrentMembershipType; - patient?: CurrentMembershipType; - medicalEvent?: Array; - error?: StatusType; - claimId: string; - } - - export interface CurrentMembershipType { - currentMembership: MembershipType; - } - - export interface PCIMedicalEventResponseType { - service?: Array; - eventDate?: Date | null; - id?: string | null; - } - - export interface RetrieveReportRequestType { - transactionId: Array; - } - - export interface RetrieveReportResponseType { - content?: Array; - } - - export interface ContentType { - transactionId?: string | null; - status?: string | null; - } - - export interface EnterpriseConcessionVerificationReportContentType extends ContentType { - report?: EnterpriseConcessionVerificationResponseType; - } - - export interface EnterprisePatientVerificationReportContentType extends ContentType { - report?: EnterprisePatientVerificationResponseType; - } - - export interface EnterpriseVeteranVerificationReportContentType extends ContentType { - report?: EnterpriseVeteranVerificationResponseType; - } - - export interface SameDayDeleteRequestType { - sameDayDelete: SameDayDeleteType; - } - - export interface SameDayDeleteType { - patient: MedicarePatientType; - reasonCode: string; - } - - export interface SameDayDeleteResponseType { - status: string; - } - - export interface StatusReportRequestType { - transactionId?: Array; - associateName?: string | null; - fromDateTime?: Date | null; - toDateTime?: Date | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - status?: string | null; - } - - export interface StatusReportResponseType { - transactionStatus?: Array; - status: string; - } - - export interface TransactionStatusType { - associateName?: string | null; - lodgementDateTime?: Date | null; - processStatus?: string | null; - reference?: string | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - transactionId?: string | null; - } - - export class McpClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This is the request - * Post mcp/bulkbillpaymentreport/v1 - * @return {BBSPaymentReportResponseType} successful operation - */ - McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillprocessingreport/v1 - * @return {BBSProcessingReportResponseType} successful operation - */ - McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/general/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/pathology/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/specialist/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/allied/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/communitynursing/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/dental/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/optical/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/psych/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/speechpathology/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/general/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/pathology/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/specialist/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvapaymentreport/v1 - * @return {DVAPaymentReportResponseType} successful operation - */ - McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaprocessingreport/v1 - * @return {DVAProcessingReportResponseType} successful operation - */ - McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/v1 - * @return {EnterpriseConcessionVerificationResponseType} successful operation - */ - McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/v1 - * @return {EnterprisePatientVerificationResponseType} successful operation - */ - McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/v1 - * @return {EnterpriseVeteranVerificationResponseType} successful operation - */ - McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/general/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/pathology/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/specialist/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/hf/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/medicare/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/samedaydelete/v1 - * @return {SameDayDeleteResponseType} successful operation - */ - McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/statusreport/v1 - * @return {StatusReportResponseType} successful operation - */ - McpStatusReport1Eigw(requestBody: StatusReportRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This is the request - * Post mcp/veteranverification/v1 - * @return {VeteranVerificationResponseType} successful operation - */ - McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Promise { - return Axios.post(this.baseUri + 'mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface BBSReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface ProviderType { + providerNumber: string; + } + + export interface BBSPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface PaymentRunType { + payerName?: string | null; + runDate?: Date | null; + runNumber?: string | null; + } + + export interface PaymentType { + accountInfo: BankAccountType; + depositAmount?: string | null; + paymentReference?: string | null; + } + + export interface BankAccountType { + accountName?: string | null; + accountNumber?: string | null; + bsbCode?: string | null; + } + + export interface ClaimSummaryType { + accountReferenceId?: string | null; + benefit?: string | null; + chargeAmount?: string | null; + claimChannelCode?: string | null; + claimId?: string | null; + lodgementDate?: Date | null; + transactionId?: string | null; + } + + export interface ServiceMessagesType { + highestSeverity: ServiceMessagesTypeHighestSeverity; + serviceMessage: Array; + } + + export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } + + export interface ServiceMessageType { + code: string; + severity: ServiceMessagesTypeHighestSeverity; + reason: string; + } + + export interface BBSProcessingReportResponseType { + claimAssessment?: ClaimAssessmentType; + status: string; + } + + export interface ClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface MedicalEventResponseType { + patient?: MembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface MembershipStatusType { + status?: StatusType; + currentMembership?: MembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface StatusType { + code?: number | null; + text?: string | null; + } + + export interface MembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + } + + export interface IdentityType { + dateOfBirth?: Date | null; + familyName?: string | null; + givenName?: string | null; + secondInitial?: string | null; + sex?: string | null; + } + + export interface ServiceResponseType { + error?: StatusType; + id?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface BulkBillStoreForwardRequestType { + claim: BulkBillClaimStoreForwardClaimType; + } + + export interface BulkBillClaimStoreForwardClaimType { + facilityId?: string | null; + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface BBSMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + medicalEventDate: Date; + medicalEventTime?: string | null; + patient: MedicarePatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface MedicarePatientType { + identity: IdentityType; + medicare: MembershipType; + } + + export interface ReferralType { + issueDate: Date; + period?: string | null; + periodCode?: string | null; + provider: ProviderType; + typeCode: string; + } + + export interface ServiceType { + id: string; + accessionDateTime?: Date | null; + aftercareOverrideInd?: string | null; + chargeAmount?: string | null; + collectionDateTime?: Date | null; + duplicateServiceOverrideInd?: string | null; + fieldQuantity?: string | null; + itemNumber?: string | null; + lspNumber?: string | null; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + restrictiveOverrideCode?: string | null; + rule3ExemptInd?: string | null; + s4b3ExemptInd?: string | null; + scpId?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + } + + export interface BulkBillStoreForwardResponseType { + claimId: string; + status: string; + } + + export interface AlliedHealthClaimRequestType { + claim: VAAClaimType; + } + + export interface VAAClaimType { + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface VAAMedicalEventType { + id: string; + acceptedDisability?: AcceptedDisabilityType; + authorisationDate: Date; + breakInEpisodeEndDate?: Date | null; + breakInEpisodeOfCareNumber?: string | null; + breakInEpisodeStartDate?: Date | null; + numberOfCNCHours?: string | null; + numberOfCNCVisits?: string | null; + createDateTime: Date; + numberOfENHours?: string | null; + numberOfENVisits?: string | null; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + numberOfNSSHours?: string | null; + numberOfNSSVisits?: string | null; + patient: VeteranPatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + numberOfRNHours?: string | null; + numberOfRNVisits?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface AcceptedDisabilityType { + code: string; + ind: string; + } + + export interface VAAServiceType { + id: string; + accountReferenceNumber?: string | null; + admissionDate?: Date | null; + chargeAmount?: string | null; + dischargeDate?: Date | null; + distanceKilometres?: number | null; + duplicateServiceOverrideInd?: string | null; + itemNumber: string; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + numberOfTeeth?: string | null; + opticalScriptCode?: string | null; + restrictiveOverrideCode?: string | null; + secondDeviceInd?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + toothNumber?: string | null; + upperLowerJawCode?: string | null; + } + + export interface VeteranPatientType extends PatientType { + veteranMembership?: VeteranMembershipType; + } + + export interface VeteranMembershipType { + veteranNumber: string; + } + + export interface PatientType { + identity: IdentityType; + residentialAddress?: AddressType; + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postcode?: string | null; + } + + export interface AlliedHealthClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAClaimRequestType { + claim: DVAClaimType; + } + + export interface DVAClaimType { + hospitalInd?: string | null; + serviceTypeCode: string; + medicalEvent: Array; + serviceProvider: ProviderType; + payeeProvider?: ProviderType; + } + + export interface DVAMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + referralOverrideCode?: string | null; + submissionAuthorityInd: string; + treatmentLocationCode?: string | null; + acceptedDisability?: AcceptedDisabilityType; + referral?: ReferralType; + patient: VeteranPatientType; + service: Array; + } + + export interface DVAServiceType extends ServiceType { + accountReferenceNumber?: string | null; + distanceKilometres?: number | null; + } + + export interface DVAClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface DVAPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface DVAProcessingReportResponseType { + claimAssessment?: DVAClaimAssessmentType; + status: string; + } + + export interface DVAClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface DVAMedicalEventAssessmentType { + patient?: VeteranMembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface VeteranMembershipStatusType { + currentMembership?: VeteranMembershipResponseType; + currentMember?: IdentityType; + status?: StatusType; + processDate?: Date | null; + } + + export interface DVAServiceAssessmentType { + id?: string | null; + accountReferenceNumber?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + gstInd?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface VeteranMembershipResponseType extends VeteranMembershipType { + entitlementCode?: string | null; + } + + export interface EnterpriseConcessionVerificationRequestType { + timeout?: number | null; + concessionVerificationRequest: Array; + } + + export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { + id: string; + } + + export interface ConcessionVerificationRequestType { + patient: MedicarePatientType; + dateOfService?: Date | null; + } + + export interface EnterpriseConcessionVerificationResponseType { + status: string; + concessionVerificationResponse?: Array; + } + + export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { + id: string; + } + + export interface ConcessionVerificationResponseType { + medicareStatus: MembershipStatusType; + concessionStatus: ConcessionStatusType; + } + + export interface ConcessionStatusType { + status?: StatusType; + processDate?: Date | null; + } + + export interface EnterprisePatientVerificationRequestType { + timeout?: number | null; + patientVerificationRequest: Array; + } + + export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { + id: string; + } + + export interface PatientVerificationRequestType { + patient: FundPatientType; + provider?: ProviderType; + dateOfService?: Date | null; + typeCode: string; + } + + export interface FundPatientType extends PatientType { + alsoKnownAs?: IdentityType; + medicare?: MembershipType; + healthFund?: FundMembershipType; + } + + export interface FundMembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + organisation?: string | null; + } + + export interface EnterprisePatientVerificationResponseType { + status: string; + patientVerificationResponse?: Array; + } + + export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { + id: string; + } + + export interface PatientVerificationResponseType { + medicareStatus?: MembershipStatusType; + healthFundStatus?: FundMembershipStatusType; + } + + export interface FundMembershipStatusType { + status?: StatusType; + currentMembership?: FundMembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface EnterpriseVeteranVerificationRequestType { + timeout?: number | null; + veteranVerificationRequest: Array; + } + + export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { + id: string; + } + + export interface VeteranVerificationRequestType { + patient: VeteranPatientType; + } + + export interface EnterpriseVeteranVerificationResponseType { + status: string; + veteranVerificationResponse?: Array; + } + + export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { + id?: string | null; + } + + export interface VeteranVerificationResponseType { + veteranStatus?: VeteranMembershipStatusType; + } + + export interface PatientClaimInteractiveRequestType { + patientClaimInteractive: PatientClaimInteractiveType; + } + + export interface PatientClaimInteractiveType { + patient: MedicarePatientType; + referral?: ReferralType; + claimant: ClaimantType; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + referralOverrideCode?: string | null; + accountPaidInd: string; + accountReferenceId?: string | null; + submissionAuthorityInd: string; + authorisationDate: Date; + } + + export interface PCIMedicalEventType { + service: Array; + id: string; + medicalEventDate: Date; + medicalEventTime?: string | null; + } + + export interface PCIServiceType extends ServiceType { + patientContribAmount?: string | null; + facilityId?: string | null; + hospitalInd?: string | null; + } + + export interface ClaimantType extends MedicarePatientType { + eftDetails?: BankAccountType; + residentialAddress?: AddressType; + contactDetails?: ContactType; + } + + export interface ContactType { + emailAddress?: string | null; + name?: string | null; + phoneNumber?: string | null; + } + + export interface PatientClaimInteractiveResponseType { + claimAssessment: PCIAssessmentType; + status: string; + } + + export interface PCIAssessmentType { + claimant?: CurrentMembershipType; + patient?: CurrentMembershipType; + medicalEvent?: Array; + error?: StatusType; + claimId: string; + } + + export interface CurrentMembershipType { + currentMembership: MembershipType; + } + + export interface PCIMedicalEventResponseType { + service?: Array; + eventDate?: Date | null; + id?: string | null; + } + + export interface RetrieveReportRequestType { + transactionId: Array; + } + + export interface RetrieveReportResponseType { + content?: Array; + } + + export interface ContentType { + transactionId?: string | null; + status?: string | null; + } + + export interface EnterpriseConcessionVerificationReportContentType extends ContentType { + report?: EnterpriseConcessionVerificationResponseType; + } + + export interface EnterprisePatientVerificationReportContentType extends ContentType { + report?: EnterprisePatientVerificationResponseType; + } + + export interface EnterpriseVeteranVerificationReportContentType extends ContentType { + report?: EnterpriseVeteranVerificationResponseType; + } + + export interface SameDayDeleteRequestType { + sameDayDelete: SameDayDeleteType; + } + + export interface SameDayDeleteType { + patient: MedicarePatientType; + reasonCode: string; + } + + export interface SameDayDeleteResponseType { + status: string; + } + + export interface StatusReportRequestType { + transactionId?: Array; + associateName?: string | null; + fromDateTime?: Date | null; + toDateTime?: Date | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + status?: string | null; + } + + export interface StatusReportResponseType { + transactionStatus?: Array; + status: string; + } + + export interface TransactionStatusType { + associateName?: string | null; + lodgementDateTime?: Date | null; + processStatus?: string | null; + reference?: string | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + transactionId?: string | null; + } + + export class McpClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This is the request + * Post mcp/bulkbillpaymentreport/v1 + * @return {BBSPaymentReportResponseType} successful operation + */ + McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillprocessingreport/v1 + * @return {BBSProcessingReportResponseType} successful operation + */ + McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/general/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/pathology/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/specialist/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/allied/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/communitynursing/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/dental/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/optical/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/psych/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/speechpathology/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/general/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/pathology/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/specialist/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvapaymentreport/v1 + * @return {DVAPaymentReportResponseType} successful operation + */ + McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaprocessingreport/v1 + * @return {DVAProcessingReportResponseType} successful operation + */ + McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/v1 + * @return {EnterpriseConcessionVerificationResponseType} successful operation + */ + McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/v1 + * @return {EnterprisePatientVerificationResponseType} successful operation + */ + McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/v1 + * @return {EnterpriseVeteranVerificationResponseType} successful operation + */ + McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/general/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/pathology/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/specialist/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/hf/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/medicare/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/samedaydelete/v1 + * @return {SameDayDeleteResponseType} successful operation + */ + McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/statusreport/v1 + * @return {StatusReportResponseType} successful operation + */ + McpStatusReport1Eigw(requestBody: StatusReportRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This is the request + * Post mcp/veteranverification/v1 + * @return {VeteranVerificationResponseType} successful operation + */ + McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Promise { + return Axios.post(this.baseUri + 'mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/redocOpenApi200501.txt b/Tests/SwagTsTests/AxiosResults/redocOpenApi200501.ts similarity index 96% rename from Tests/SwagTsTests/AxiosResults/redocOpenApi200501.txt rename to Tests/SwagTsTests/AxiosResults/redocOpenApi200501.ts index 2d007470..086affb7 100644 --- a/Tests/SwagTsTests/AxiosResults/redocOpenApi200501.txt +++ b/Tests/SwagTsTests/AxiosResults/redocOpenApi200501.ts @@ -1,422 +1,422 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1.0 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1.0 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @return {void} - */ - AddPet(): Promise> { - return Axios.post(this.baseUri + 'pet', null, { responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @return {void} - */ - UpdatePet(): Promise> { - return Axios.put(this.baseUri + 'pet', null, { responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise> { - return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Promise> { - return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class StoreClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1.0 Maximum: 5.0 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1.0 - * @return {void} - */ - DeleteOrder(orderId: string): Promise> { - return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); - } - - /** - * Subscribe to the Store events - * Add subscription for a store events - * Post store/subscribe - * @return {void} - */ - Subscribe(requestBody: SubscribePostBody): Promise> { - return Axios.post(this.baseUri + 'store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise> { - return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise> { - return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise> { - return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @return {void} - */ - CreateUsersWithArrayInput(): Promise> { - return Axios.post(this.baseUri + 'user/createWithArray', null, { responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @return {void} - */ - CreateUsersWithListInput(): Promise> { - return Axios.post(this.baseUri + 'user/createWithList', null, { responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Promise { - return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise> { - return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); - } - } - - export interface SubscribePostBody { - - /** - * This URL will be called by the server when the desired event will occur - * Required - */ - callbackUrl: string; - - /** - * Event name for the subscription - * Required - */ - eventName: SubscribePostBodyEventName; - } - - export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1.0 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1.0 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @return {void} + */ + AddPet(): Promise> { + return Axios.post(this.baseUri + 'pet', null, { responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @return {void} + */ + UpdatePet(): Promise> { + return Axios.put(this.baseUri + 'pet', null, { responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return Axios.get(this.baseUri + 'pet/' + petId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise> { + return Axios.delete(this.baseUri + 'pet/' + petId, { responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Promise> { + return Axios.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class StoreClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return Axios.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return Axios.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1.0 Maximum: 5.0 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return Axios.get(this.baseUri + 'store/order/' + orderId, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1.0 + * @return {void} + */ + DeleteOrder(orderId: string): Promise> { + return Axios.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { responseType: 'text' }); + } + + /** + * Subscribe to the Store events + * Add subscription for a store events + * Post store/subscribe + * @return {void} + */ + Subscribe(requestBody: SubscribePostBody): Promise> { + return Axios.post(this.baseUri + 'store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise> { + return Axios.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return Axios.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise> { + return Axios.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise> { + return Axios.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @return {void} + */ + CreateUsersWithArrayInput(): Promise> { + return Axios.post(this.baseUri + 'user/createWithArray', null, { responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @return {void} + */ + CreateUsersWithListInput(): Promise> { + return Axios.post(this.baseUri + 'user/createWithList', null, { responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Promise { + return Axios.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise> { + return Axios.get(this.baseUri + 'user/logout', { responseType: 'text' }); + } + } + + export interface SubscribePostBody { + + /** + * This URL will be called by the server when the desired event will occur + * Required + */ + callbackUrl: string; + + /** + * Event name for the subscription + * Required + */ + eventName: SubscribePostBodyEventName; + } + + export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_account.txt b/Tests/SwagTsTests/AxiosResults/sell_account.ts similarity index 99% rename from Tests/SwagTsTests/AxiosResults/sell_account.txt rename to Tests/SwagTsTests/AxiosResults/sell_account.ts index 567e22d0..f8644706 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_account.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_account.ts @@ -1,1154 +1,1154 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ - export interface CategoryType { - - /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ - default?: boolean | null; - - /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ - name?: string | null; - } - - - /** A container that describes the details of a deposit. Used only with motor listings. */ - export interface Deposit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - dueIn?: TimeDuration; - - /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ - paymentMethods?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ - export interface PaymentMethod { - - /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ - brands?: Array; - - /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ - paymentMethodType?: string | null; - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - recipientAccountReference?: RecipientAccountReference; - } - - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - export interface RecipientAccountReference { - - /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ - referenceId?: string | null; - - /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ - referenceType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface FulfillmentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ - export interface ShippingOption { - - /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ - costType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - insuranceFee?: Amount; - - /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ - insuranceOffered?: boolean | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ - optionType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - packageHandlingCost?: Amount; - - /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ - rateTableId?: string | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ - shippingServices?: Array; - } - - - /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ - export interface ShippingService { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalShippingCost?: Amount; - - /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForPickup?: boolean | null; - - /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForShipping?: boolean | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - cashOnDeliveryFee?: Amount; - - /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ - freeShipping?: boolean | null; - - /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ - shippingCarrierCode?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - shippingCost?: Amount; - - /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ - shippingServiceCode?: string | null; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** - * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - sortOrder?: number | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - surcharge?: Amount; - } - - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - export interface RegionSet { - - /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ - regionExcluded?: Array; - - /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ - regionIncluded?: Array; - } - - - /** This type defines information for a region. */ - export interface Region { - - /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ - regionName?: string | null; - - /** Reserved for future use. For implementation help, refer to eBay API documentation */ - regionType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface FulfillmentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** The response payload for requests that return a list of fulfillment policies. */ - export interface FulfillmentPolicyResponse { - - /** A list of the seller's fulfillment policies. */ - fulfillmentPolicies?: Array; - - /** Returns a URL link to the result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - export interface InternationalReturnOverrideType { - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ - returnsAccepted?: boolean | null; - - /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface PaymentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - } - - - /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface PaymentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - } - - - /** The response payload for payment policy requests. */ - export interface PaymentPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** A list of the seller's payment policies. */ - paymentPolicies?: Array; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object containing the sellers status with regards to the specified payment program. */ - export interface PaymentsProgramResponse { - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ - paymentsProgramType?: string | null; - - /** For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ - wasPreviouslyOptedIn?: boolean | null; - } - - - /** A seller program in to which a seller can opt-in. */ - export interface Program { - - /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ - programType?: string | null; - } - - - /** A list of the supported seller programs. */ - export interface Programs { - - /** A list of seller programs. */ - programs?: Array; - } - - - /** A complex type that contains information pertaining to a shipping rate table. */ - export interface RateTable { - - /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ - locality?: string | null; - - /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ - name?: string | null; - - /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ - rateTableId?: string | null; - } - - - /** The response container for with information on a seller's shipping rate tables. */ - export interface RateTableResponse { - - /** A list of elements that provide information on the seller-defined shipping rate tables. */ - rateTables?: Array; - } - - - /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface ReturnPolicy { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface ReturnPolicyRequest { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** The response payload for return policy requests. */ - export interface ReturnPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** A list of the seller's return policies. */ - returnPolicies?: Array; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ - export interface SalesTax { - - /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ - salesTaxJurisdictionId?: string | null; - - /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A container that describes the how the sales tax rate is calculated. */ - export interface SalesTaxBase { - - /** The sales tax rate, as a percentage of the sale. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A list of sales tax tables. */ - export interface SalesTaxes { - - /** A list of sales tax tables that have been set up by a seller. */ - salesTaxes?: Array; - } - - - /** Defines the selling limit applied to an eBay seller's account. */ - export interface SellingLimit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** - * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A merchant's selling limit, and the status of their account registration. */ - export interface SellingPrivileges { - - /** If set to true, the seller's registration is completed. */ - sellerRegistrationCompleted?: boolean | null; - - /** Defines the selling limit applied to an eBay seller's account. */ - sellingLimit?: SellingLimit; - } - - - /** Complex type that that gets populated with a response containing a fulfillment policy. */ - export interface SetFulfillmentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** Complex type that that gets populated with a response containing a payment policy. */ - export interface SetPaymentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** Complex type that that gets populated with a response containing a return policy. */ - export interface SetReturnPolicyResponse { - - /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ - restockingFeePercentage?: string | null; - - /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ - returnInstructions?: string | null; - - /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - export class Fulfillment_policyClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {FulfillmentPolicyResponse} Success - */ - GetFulfillmentPolicies(marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post fulfillment_policy/ - * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. - * @return {void} - */ - CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Promise> { - return Axios.post(this.baseUri + 'fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. - * Get fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicy(fulfillmentPolicyId: string): Promise { - return Axios.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. - * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request - * @return {SetFulfillmentPolicyResponse} OK - */ - UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Promise { - return Axios.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. - * Delete fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. - * @return {void} - */ - DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Promise> { - return Axios.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { responseType: 'text' }); - } - - /** - * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicyByName(marketplace_id: string, name: string): Promise { - return Axios.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Payment_policyClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {PaymentPolicyResponse} Success - */ - GetPaymentPolicies(marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post payment_policy/ - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {void} - */ - CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Promise> { - return Axios.post(this.baseUri + 'payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. - * Get payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicy(payment_policy_id: string): Promise { - return Axios.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {SetPaymentPolicyResponse} OK - */ - UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Promise { - return Axios.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. - * Delete payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. - * @return {void} - */ - DeletePaymentPolicy(payment_policy_id: string): Promise> { - return Axios.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicyByName(marketplace_id: string, name: string): Promise { - return Axios.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Payments_programClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. - * Get payments_program/{marketplace_id}/{payments_program_type} - * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. - * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. - * @return {PaymentsProgramResponse} Success - */ - GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Promise { - return Axios.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class PrivilegeClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). - * Get privilege/ - * @return {SellingPrivileges} Success - */ - GetPrivileges(): Promise { - return Axios.get(this.baseUri + 'privilege/', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class ProgramClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method gets a list of the seller programs that the seller has opted-in to. - * Get program/get_opted_in_programs - * @return {Programs} Success - */ - GetOptedInPrograms(): Promise { - return Axios.get(this.baseUri + 'program/get_opted_in_programs', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. - * Post program/opt_in - * @param {Program} requestBody Program being opted-in to. - * @return {string} Success - */ - OptInToProgram(requestBody: Program): Promise { - return Axios.post(this.baseUri + 'program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. - * Post program/opt_out - * @param {Program} requestBody Program being opted-out of. - * @return {string} Success - */ - OptOutOfProgram(requestBody: Program): Promise { - return Axios.post(this.baseUri + 'program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Rate_tableClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. - * Get rate_table/ - * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {RateTableResponse} Success - */ - GetRateTables(country_code: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Return_policyClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/ - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post return_policy/ - * @param {ReturnPolicyRequest} requestBody Return policy request - * @return {void} - */ - CreateReturnPolicy(requestBody: ReturnPolicyRequest): Promise> { - return Axios.post(this.baseUri + 'return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. - * Get return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicy(return_policy_id: string): Promise { - return Axios.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. - * @param {ReturnPolicyRequest} requestBody Container for a return policy request. - * @return {SetReturnPolicyResponse} OK - */ - UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Promise { - return Axios.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. - * Delete return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. - * @return {void} - */ - DeleteReturnPolicy(return_policy_id: string): Promise> { - return Axios.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicyByName(marketplace_id: string, name: string): Promise { - return Axios.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Sales_taxClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. - * Get sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. - * @return {SalesTax} Success - */ - GetSalesTax(countryCode: string, jurisdictionId: string): Promise { - return Axios.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. - * Put sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. - * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. - * @return {void} - */ - CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Promise> { - return Axios.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. - * Delete sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. - * @return {void} - */ - DeleteSalesTax(countryCode: string, jurisdictionId: string): Promise> { - return Axios.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { responseType: 'text' }); - } - - /** - * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. - * Get sales_tax/ - * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {SalesTaxes} Success - */ - GetSalesTaxes(country_code: string): Promise { - return Axios.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ + export interface CategoryType { + + /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ + default?: boolean | null; + + /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ + name?: string | null; + } + + + /** A container that describes the details of a deposit. Used only with motor listings. */ + export interface Deposit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + dueIn?: TimeDuration; + + /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ + paymentMethods?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ + export interface PaymentMethod { + + /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ + brands?: Array; + + /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ + paymentMethodType?: string | null; + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + recipientAccountReference?: RecipientAccountReference; + } + + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + export interface RecipientAccountReference { + + /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ + referenceId?: string | null; + + /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ + referenceType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface FulfillmentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ + export interface ShippingOption { + + /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ + costType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + insuranceFee?: Amount; + + /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ + insuranceOffered?: boolean | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ + optionType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + packageHandlingCost?: Amount; + + /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ + rateTableId?: string | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ + shippingServices?: Array; + } + + + /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ + export interface ShippingService { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalShippingCost?: Amount; + + /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForPickup?: boolean | null; + + /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForShipping?: boolean | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + cashOnDeliveryFee?: Amount; + + /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ + freeShipping?: boolean | null; + + /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ + shippingCarrierCode?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + shippingCost?: Amount; + + /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ + shippingServiceCode?: string | null; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** + * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + sortOrder?: number | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + surcharge?: Amount; + } + + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + export interface RegionSet { + + /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ + regionExcluded?: Array; + + /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ + regionIncluded?: Array; + } + + + /** This type defines information for a region. */ + export interface Region { + + /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ + regionName?: string | null; + + /** Reserved for future use. For implementation help, refer to eBay API documentation */ + regionType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface FulfillmentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** The response payload for requests that return a list of fulfillment policies. */ + export interface FulfillmentPolicyResponse { + + /** A list of the seller's fulfillment policies. */ + fulfillmentPolicies?: Array; + + /** Returns a URL link to the result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + export interface InternationalReturnOverrideType { + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ + returnsAccepted?: boolean | null; + + /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface PaymentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + } + + + /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface PaymentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + } + + + /** The response payload for payment policy requests. */ + export interface PaymentPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** A list of the seller's payment policies. */ + paymentPolicies?: Array; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object containing the sellers status with regards to the specified payment program. */ + export interface PaymentsProgramResponse { + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ + paymentsProgramType?: string | null; + + /** For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ + wasPreviouslyOptedIn?: boolean | null; + } + + + /** A seller program in to which a seller can opt-in. */ + export interface Program { + + /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ + programType?: string | null; + } + + + /** A list of the supported seller programs. */ + export interface Programs { + + /** A list of seller programs. */ + programs?: Array; + } + + + /** A complex type that contains information pertaining to a shipping rate table. */ + export interface RateTable { + + /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ + locality?: string | null; + + /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ + name?: string | null; + + /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ + rateTableId?: string | null; + } + + + /** The response container for with information on a seller's shipping rate tables. */ + export interface RateTableResponse { + + /** A list of elements that provide information on the seller-defined shipping rate tables. */ + rateTables?: Array; + } + + + /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface ReturnPolicy { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface ReturnPolicyRequest { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** The response payload for return policy requests. */ + export interface ReturnPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** A list of the seller's return policies. */ + returnPolicies?: Array; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ + export interface SalesTax { + + /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ + salesTaxJurisdictionId?: string | null; + + /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A container that describes the how the sales tax rate is calculated. */ + export interface SalesTaxBase { + + /** The sales tax rate, as a percentage of the sale. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A list of sales tax tables. */ + export interface SalesTaxes { + + /** A list of sales tax tables that have been set up by a seller. */ + salesTaxes?: Array; + } + + + /** Defines the selling limit applied to an eBay seller's account. */ + export interface SellingLimit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** + * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A merchant's selling limit, and the status of their account registration. */ + export interface SellingPrivileges { + + /** If set to true, the seller's registration is completed. */ + sellerRegistrationCompleted?: boolean | null; + + /** Defines the selling limit applied to an eBay seller's account. */ + sellingLimit?: SellingLimit; + } + + + /** Complex type that that gets populated with a response containing a fulfillment policy. */ + export interface SetFulfillmentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** Complex type that that gets populated with a response containing a payment policy. */ + export interface SetPaymentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** Complex type that that gets populated with a response containing a return policy. */ + export interface SetReturnPolicyResponse { + + /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ + restockingFeePercentage?: string | null; + + /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ + returnInstructions?: string | null; + + /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + export class Fulfillment_policyClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {FulfillmentPolicyResponse} Success + */ + GetFulfillmentPolicies(marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post fulfillment_policy/ + * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. + * @return {void} + */ + CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Promise> { + return Axios.post(this.baseUri + 'fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. + * Get fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicy(fulfillmentPolicyId: string): Promise { + return Axios.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. + * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request + * @return {SetFulfillmentPolicyResponse} OK + */ + UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Promise { + return Axios.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. + * Delete fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. + * @return {void} + */ + DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Promise> { + return Axios.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { responseType: 'text' }); + } + + /** + * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicyByName(marketplace_id: string, name: string): Promise { + return Axios.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Payment_policyClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {PaymentPolicyResponse} Success + */ + GetPaymentPolicies(marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post payment_policy/ + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {void} + */ + CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Promise> { + return Axios.post(this.baseUri + 'payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. + * Get payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicy(payment_policy_id: string): Promise { + return Axios.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {SetPaymentPolicyResponse} OK + */ + UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Promise { + return Axios.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. + * Delete payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. + * @return {void} + */ + DeletePaymentPolicy(payment_policy_id: string): Promise> { + return Axios.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicyByName(marketplace_id: string, name: string): Promise { + return Axios.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Payments_programClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. + * Get payments_program/{marketplace_id}/{payments_program_type} + * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. + * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. + * @return {PaymentsProgramResponse} Success + */ + GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Promise { + return Axios.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class PrivilegeClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). + * Get privilege/ + * @return {SellingPrivileges} Success + */ + GetPrivileges(): Promise { + return Axios.get(this.baseUri + 'privilege/', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class ProgramClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method gets a list of the seller programs that the seller has opted-in to. + * Get program/get_opted_in_programs + * @return {Programs} Success + */ + GetOptedInPrograms(): Promise { + return Axios.get(this.baseUri + 'program/get_opted_in_programs', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. + * Post program/opt_in + * @param {Program} requestBody Program being opted-in to. + * @return {string} Success + */ + OptInToProgram(requestBody: Program): Promise { + return Axios.post(this.baseUri + 'program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. + * Post program/opt_out + * @param {Program} requestBody Program being opted-out of. + * @return {string} Success + */ + OptOutOfProgram(requestBody: Program): Promise { + return Axios.post(this.baseUri + 'program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Rate_tableClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. + * Get rate_table/ + * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {RateTableResponse} Success + */ + GetRateTables(country_code: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Return_policyClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/ + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post return_policy/ + * @param {ReturnPolicyRequest} requestBody Return policy request + * @return {void} + */ + CreateReturnPolicy(requestBody: ReturnPolicyRequest): Promise> { + return Axios.post(this.baseUri + 'return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. + * Get return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicy(return_policy_id: string): Promise { + return Axios.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. + * @param {ReturnPolicyRequest} requestBody Container for a return policy request. + * @return {SetReturnPolicyResponse} OK + */ + UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Promise { + return Axios.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. + * Delete return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. + * @return {void} + */ + DeleteReturnPolicy(return_policy_id: string): Promise> { + return Axios.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicyByName(marketplace_id: string, name: string): Promise { + return Axios.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Sales_taxClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. + * Get sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. + * @return {SalesTax} Success + */ + GetSalesTax(countryCode: string, jurisdictionId: string): Promise { + return Axios.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. + * Put sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. + * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. + * @return {void} + */ + CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Promise> { + return Axios.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. + * Delete sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. + * @return {void} + */ + DeleteSalesTax(countryCode: string, jurisdictionId: string): Promise> { + return Axios.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { responseType: 'text' }); + } + + /** + * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. + * Get sales_tax/ + * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {SalesTaxes} Success + */ + GetSalesTaxes(country_code: string): Promise { + return Axios.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_analytics.txt b/Tests/SwagTsTests/AxiosResults/sell_analytics.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/sell_analytics.txt rename to Tests/SwagTsTests/AxiosResults/sell_analytics.ts index edcf7e3d..639fdc33 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_analytics.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_analytics.ts @@ -1,382 +1,382 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - export interface BenchmarkMetadata { - - /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ - average?: string | null; - } - - - /** A complex type that describes a program cycle. */ - export interface Cycle { - - /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ - cycleType?: string | null; - - /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - evaluationDate?: string | null; - - /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ - evaluationMonth?: string | null; - } - - - /** A complex type that defines a dimension key and metrics in a traffic report. */ - export interface Definition { - - /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The value the dimension or metric parameter as submitted in the request. */ - key?: string | null; - - /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ - localizedName?: string | null; - } - - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - export interface Dimension { - - /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ - dimensionKey?: string | null; - - /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ - name?: string | null; - - /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ - value?: string | null; - } - - - /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ - export interface DimensionMetric { - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - dimension?: Dimension; - - /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ - metrics?: Array; - } - - - /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ - export interface Metric { - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - benchmark?: MetricBenchmark; - - /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ - distributions?: Array; - - /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ - metricKey?: string | null; - - /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ - value?: string | null; - } - - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - export interface MetricBenchmark { - - /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ - adjustment?: string | null; - - /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ - basis?: string | null; - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - metadata?: BenchmarkMetadata; - - /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ - rating?: string | null; - } - - - /** This complex data type describes the metric distribution by basis. */ - export interface MetricDistribution { - - /** This field returns the basis, or the method, by which the metric rating is calculated. */ - basis?: string | null; - - /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ - data?: Array; - } - - - /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ - export interface Distribution { - - /** The name of a distribution in which the seller is active. */ - name?: string | null; - - /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ - value?: string | null; - } - - - /** Type that defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ - category?: string | null; - - /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error than given in the message error field. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** If present, indicates which subsystem in which the error occurred. */ - subdomain?: string | null; - } - - - /** A complex type that defines an error and error message. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - export interface EvaluationCycle { - - /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - endDate?: string | null; - - /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ - evaluationDate?: string | null; - - /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ - evaluationType?: string | null; - - /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - startDate?: string | null; - } - - - /** The response container for a list of seller profiles. */ - export interface FindSellerStandardsProfilesResponse { - - /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ - standardsProfiles?: Array; - } - - - /** A complex type that defines a seller profile. */ - export interface StandardsProfile { - - /** A complex type that describes a program cycle. */ - cycle?: Cycle; - - /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ - defaultProgram?: boolean | null; - - /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ - evaluationReason?: string | null; - - /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ - metrics?: Array; - - /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ - program?: string | null; - - /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ - standardsLevel?: string | null; - } - - - /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ - export interface GetCustomerServiceMetricResponse { - - /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ - dimensionMetrics?: Array; - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - evaluationCycle?: EvaluationCycle; - - /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - export interface Header { - - /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ - dimensionKeys?: Array; - - /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ - metrics?: Array; - } - - - /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ - export interface Metadata { - - /** Type that defines the metadata header fields. */ - metadataHeader?: MetadataHeader; - - /** A list of the individual report records. */ - metadataRecords?: Array; - } - - - /** Type that defines the metadata header fields. */ - export interface MetadataHeader { - - /** The key value used for the report. For example: "key": "LISTING_ID" */ - key?: string | null; - - /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ - metadataKeys?: Array; - } - - - /** A complex type that defines the data records returned in the report. */ - export interface MetadataRecord { - - /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ - metadataValues?: Array; - - /** A complex type that contains a value, plus the veracity of that value. */ - value?: Value; - } - - - /** A complex type that contains a value, plus the veracity of that value. */ - export interface Value { - - /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ - applicable?: boolean | null; - - /** The value of the report data. */ - value?: string | null; - } - - - /** Type that defines the fields of the individual record of the report. */ - export interface Record { - - /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ - dimensionValues?: Array; - - /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ - metricValues?: Array; - } - - - /** The complex type that defines that defines the report. */ - export interface Report { - - /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ - dimensionMetadata?: Array; - - /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - endDate?: string | null; - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - header?: Header; - - /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ - lastUpdatedDate?: string | null; - - /** A complex type containing the individual data records for the traffic report. */ - records?: Array; - - /** The start date of the date range used to calculate the report, in ISO 8601 format. */ - startDate?: string | null; - - /** An array of any process errors or warnings that were generated during the processing of the call processing. */ - warnings?: Array; - } - - export class Customer_service_metricClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. - * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} - * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED - * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html - * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. - * @return {GetCustomerServiceMetricResponse} Success - */ - GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Promise { - return Axios.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Seller_standards_profileClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. - * Get seller_standards_profile - * @return {FindSellerStandardsProfilesResponse} Success - */ - FindSellerStandardsProfiles(): Promise { - return Axios.get(this.baseUri + 'seller_standards_profile', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. - * Get seller_standards_profile/{program}/{cycle} - * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. - * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. - * @return {StandardsProfile} Success - */ - GetSellerStandardsProfile(cycle: string, program: string): Promise { - return Axios.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Traffic_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. - * Get traffic_report - * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. - * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html - * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count - * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html - * @return {Report} Success - */ - GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + export interface BenchmarkMetadata { + + /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ + average?: string | null; + } + + + /** A complex type that describes a program cycle. */ + export interface Cycle { + + /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ + cycleType?: string | null; + + /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + evaluationDate?: string | null; + + /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ + evaluationMonth?: string | null; + } + + + /** A complex type that defines a dimension key and metrics in a traffic report. */ + export interface Definition { + + /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The value the dimension or metric parameter as submitted in the request. */ + key?: string | null; + + /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ + localizedName?: string | null; + } + + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + export interface Dimension { + + /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ + dimensionKey?: string | null; + + /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ + name?: string | null; + + /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ + value?: string | null; + } + + + /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ + export interface DimensionMetric { + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + dimension?: Dimension; + + /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ + metrics?: Array; + } + + + /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ + export interface Metric { + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + benchmark?: MetricBenchmark; + + /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ + distributions?: Array; + + /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ + metricKey?: string | null; + + /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ + value?: string | null; + } + + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + export interface MetricBenchmark { + + /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ + adjustment?: string | null; + + /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ + basis?: string | null; + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + metadata?: BenchmarkMetadata; + + /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ + rating?: string | null; + } + + + /** This complex data type describes the metric distribution by basis. */ + export interface MetricDistribution { + + /** This field returns the basis, or the method, by which the metric rating is calculated. */ + basis?: string | null; + + /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ + data?: Array; + } + + + /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ + export interface Distribution { + + /** The name of a distribution in which the seller is active. */ + name?: string | null; + + /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ + value?: string | null; + } + + + /** Type that defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ + category?: string | null; + + /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error than given in the message error field. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** If present, indicates which subsystem in which the error occurred. */ + subdomain?: string | null; + } + + + /** A complex type that defines an error and error message. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + export interface EvaluationCycle { + + /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + endDate?: string | null; + + /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ + evaluationDate?: string | null; + + /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ + evaluationType?: string | null; + + /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + startDate?: string | null; + } + + + /** The response container for a list of seller profiles. */ + export interface FindSellerStandardsProfilesResponse { + + /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ + standardsProfiles?: Array; + } + + + /** A complex type that defines a seller profile. */ + export interface StandardsProfile { + + /** A complex type that describes a program cycle. */ + cycle?: Cycle; + + /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ + defaultProgram?: boolean | null; + + /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ + evaluationReason?: string | null; + + /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ + metrics?: Array; + + /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ + program?: string | null; + + /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ + standardsLevel?: string | null; + } + + + /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ + export interface GetCustomerServiceMetricResponse { + + /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ + dimensionMetrics?: Array; + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + evaluationCycle?: EvaluationCycle; + + /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + export interface Header { + + /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ + dimensionKeys?: Array; + + /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ + metrics?: Array; + } + + + /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ + export interface Metadata { + + /** Type that defines the metadata header fields. */ + metadataHeader?: MetadataHeader; + + /** A list of the individual report records. */ + metadataRecords?: Array; + } + + + /** Type that defines the metadata header fields. */ + export interface MetadataHeader { + + /** The key value used for the report. For example: "key": "LISTING_ID" */ + key?: string | null; + + /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ + metadataKeys?: Array; + } + + + /** A complex type that defines the data records returned in the report. */ + export interface MetadataRecord { + + /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ + metadataValues?: Array; + + /** A complex type that contains a value, plus the veracity of that value. */ + value?: Value; + } + + + /** A complex type that contains a value, plus the veracity of that value. */ + export interface Value { + + /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ + applicable?: boolean | null; + + /** The value of the report data. */ + value?: string | null; + } + + + /** Type that defines the fields of the individual record of the report. */ + export interface Record { + + /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ + dimensionValues?: Array; + + /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ + metricValues?: Array; + } + + + /** The complex type that defines that defines the report. */ + export interface Report { + + /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ + dimensionMetadata?: Array; + + /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + endDate?: string | null; + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + header?: Header; + + /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ + lastUpdatedDate?: string | null; + + /** A complex type containing the individual data records for the traffic report. */ + records?: Array; + + /** The start date of the date range used to calculate the report, in ISO 8601 format. */ + startDate?: string | null; + + /** An array of any process errors or warnings that were generated during the processing of the call processing. */ + warnings?: Array; + } + + export class Customer_service_metricClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. + * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} + * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED + * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html + * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. + * @return {GetCustomerServiceMetricResponse} Success + */ + GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Promise { + return Axios.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Seller_standards_profileClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. + * Get seller_standards_profile + * @return {FindSellerStandardsProfilesResponse} Success + */ + FindSellerStandardsProfiles(): Promise { + return Axios.get(this.baseUri + 'seller_standards_profile', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. + * Get seller_standards_profile/{program}/{cycle} + * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. + * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. + * @return {StandardsProfile} Success + */ + GetSellerStandardsProfile(cycle: string, program: string): Promise { + return Axios.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Traffic_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. + * Get traffic_report + * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. + * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html + * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count + * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html + * @return {Report} Success + */ + GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_compliance.txt b/Tests/SwagTsTests/AxiosResults/sell_compliance.ts similarity index 99% rename from Tests/SwagTsTests/AxiosResults/sell_compliance.txt rename to Tests/SwagTsTests/AxiosResults/sell_compliance.ts index a8eeecc6..a130c3d1 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_compliance.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_compliance.ts @@ -1,259 +1,259 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ - export interface AspectRecommendations { - - /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ - localizedAspectName?: string | null; - - /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ - suggestedValues?: Array; - } - - - /** This type is used by each listing violation that is returned under the violations container. */ - export interface ComplianceDetail { - - /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ - reasonCode?: string | null; - - /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ - message?: string | null; - - /** This type is used to identify the product variation that has the listing violation. */ - variation?: VariationDetails; - - /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ - violationData?: Array; - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - correctiveRecommendations?: CorrectiveRecommendations; - - /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ - complianceState?: string | null; - } - - - /** This type is used to identify the product variation that has the listing violation. */ - export interface VariationDetails { - - /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ - sku?: string | null; - - /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ - variationAspects?: Array; - } - - - /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ - export interface NameValueList { - - /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - name?: string | null; - - /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - value?: string | null; - } - - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - export interface CorrectiveRecommendations { - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - productRecommendation?: ProductRecommendation; - - /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ - aspectRecommendations?: Array; - } - - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - export interface ProductRecommendation { - - /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ - epid?: string | null; - } - - - /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ - export interface ComplianceSummary { - - /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ - violationSummaries?: Array; - } - - - /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ - export interface ComplianceSummaryInfo { - - /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - listingCount?: number | null; - } - - - /** This type is used by each listing violation that is returned under the listingViolations container. */ - export interface ComplianceViolation { - - /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ - listingId?: string | null; - - /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ - sku?: string | null; - - /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ - offerId?: string | null; - - /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ - violations?: Array; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is the base response type of the getListingViolations method. */ - export interface PagedComplianceViolationCollection { - - /** - * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI of the getListingViolations call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ - next?: string | null; - - /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ - prev?: string | null; - - /** - * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ - listingViolations?: Array; - } - - - /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ - export interface SuppressViolationRequest { - - /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ - listingId?: string | null; - } - - export class Listing_violation_summaryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * Get listing_violation_summary - * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * @return {void} Success - */ - GetListingViolationsSummary(compliance_type: string | null | undefined): Promise> { - return Axios.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { responseType: 'text' }); - } - } - - export class Listing_violationClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. - * Get listing_violation - * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. - * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) - * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. - * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 - * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} - * @return {void} Success - */ - GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Promise> { - return Axios.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { responseType: 'text' }); - } - - /** - * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. - * Post suppress_listing_violation - * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. - * @return {void} - */ - SuppressViolation(requestBody: SuppressViolationRequest): Promise> { - return Axios.post(this.baseUri + 'suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ + export interface AspectRecommendations { + + /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ + localizedAspectName?: string | null; + + /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ + suggestedValues?: Array; + } + + + /** This type is used by each listing violation that is returned under the violations container. */ + export interface ComplianceDetail { + + /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ + reasonCode?: string | null; + + /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ + message?: string | null; + + /** This type is used to identify the product variation that has the listing violation. */ + variation?: VariationDetails; + + /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ + violationData?: Array; + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + correctiveRecommendations?: CorrectiveRecommendations; + + /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ + complianceState?: string | null; + } + + + /** This type is used to identify the product variation that has the listing violation. */ + export interface VariationDetails { + + /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ + sku?: string | null; + + /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ + variationAspects?: Array; + } + + + /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ + export interface NameValueList { + + /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + name?: string | null; + + /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + value?: string | null; + } + + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + export interface CorrectiveRecommendations { + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + productRecommendation?: ProductRecommendation; + + /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ + aspectRecommendations?: Array; + } + + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + export interface ProductRecommendation { + + /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ + epid?: string | null; + } + + + /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ + export interface ComplianceSummary { + + /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ + violationSummaries?: Array; + } + + + /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ + export interface ComplianceSummaryInfo { + + /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + listingCount?: number | null; + } + + + /** This type is used by each listing violation that is returned under the listingViolations container. */ + export interface ComplianceViolation { + + /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ + listingId?: string | null; + + /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ + sku?: string | null; + + /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ + offerId?: string | null; + + /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ + violations?: Array; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is the base response type of the getListingViolations method. */ + export interface PagedComplianceViolationCollection { + + /** + * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI of the getListingViolations call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ + next?: string | null; + + /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ + prev?: string | null; + + /** + * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ + listingViolations?: Array; + } + + + /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ + export interface SuppressViolationRequest { + + /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ + listingId?: string | null; + } + + export class Listing_violation_summaryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * Get listing_violation_summary + * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * @return {void} Success + */ + GetListingViolationsSummary(compliance_type: string | null | undefined): Promise> { + return Axios.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { responseType: 'text' }); + } + } + + export class Listing_violationClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. + * Get listing_violation + * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. + * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) + * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. + * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 + * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} + * @return {void} Success + */ + GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Promise> { + return Axios.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { responseType: 'text' }); + } + + /** + * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. + * Post suppress_listing_violation + * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. + * @return {void} + */ + SuppressViolation(requestBody: SuppressViolationRequest): Promise> { + return Axios.post(this.baseUri + 'suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_finances.txt b/Tests/SwagTsTests/AxiosResults/sell_finances.ts similarity index 99% rename from Tests/SwagTsTests/AxiosResults/sell_finances.txt rename to Tests/SwagTsTests/AxiosResults/sell_finances.ts index dc5bda79..e3c1539b 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_finances.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_finances.ts @@ -1,401 +1,401 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - export interface Amount { - - /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ - value?: string | null; - } - - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - export interface Buyer { - - /** The eBay user ID of the order's buyer. */ - username?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ - export interface Payout { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ - payoutDate?: string | null; - - /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ - payoutId?: string | null; - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - payoutInstrument?: PayoutInstrument; - - /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ - payoutStatus?: string | null; - - /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ - payoutStatusDescription?: string | null; - - /** - * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - export interface PayoutInstrument { - - /** This string value is the last four digits of the seller's account number. */ - accountLastFourDigits?: string | null; - - /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ - instrumentType?: string | null; - - /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ - nickname?: string | null; - } - - - /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ - export interface PayoutSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** - * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - payoutCount?: number | null; - - /** - * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ - export interface Payouts { - - /** The URI of the getPayouts call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ - payouts?: Array; - - /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ - export interface SellerFundsSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - availableFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - fundsOnHold?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - processingFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - totalFunds?: Amount; - } - - - /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ - export interface Transaction { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ - bookingEntry?: string | null; - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - buyer?: Buyer; - - /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ - orderId?: string | null; - - /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ - payoutId?: string | null; - - /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ - salesRecordReference?: string | null; - - /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ - transactionDate?: string | null; - - /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ - transactionId?: string | null; - - /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ - transactionMemo?: string | null; - - /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ - transactionStatus?: string | null; - - /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ - transactionType?: string | null; - } - - - /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ - export interface TransactionSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - creditAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ - creditBookingEntry?: string | null; - - /** - * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - creditCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - disputeAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ - disputeBookingEntry?: string | null; - - /** - * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - disputeCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - onHoldAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ - onHoldBookingEntry?: string | null; - - /** - * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - onHoldCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - refundAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ - refundBookingEntry?: string | null; - - /** - * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - refundCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - shippingLabelAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ - shippingLabelBookingEntry?: string | null; - - /** - * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - shippingLabelCount?: number | null; - } - - - /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ - export interface Transactions { - - /** The URI of the getTransactions method request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ - transactions?: Array; - } - - export class PayoutClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. - * Get payout/{payout_Id} - * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. - * @return {Payout} Success - */ - GetPayout(payout_Id: string): Promise { - return Axios.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. - * Get payout - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) - * @return {Payouts} Success - */ - GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. - * Get payout_summary - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {PayoutSummaryResponse} Success - */ - GetPayoutSummary(filter: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class TransactionClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. - * Get transaction - * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * @return {Transactions} Success - */ - GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). - * Get transaction_summary - * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {TransactionSummaryResponse} Success - */ - GetTransactionSummary(filter: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Seller_funds_summaryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. - * Get seller_funds_summary - * @return {SellerFundsSummaryResponse} Success - */ - GetSellerFundsSummary(): Promise { - return Axios.get(this.baseUri + 'seller_funds_summary', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + export interface Amount { + + /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ + value?: string | null; + } + + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + export interface Buyer { + + /** The eBay user ID of the order's buyer. */ + username?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ + export interface Payout { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ + payoutDate?: string | null; + + /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ + payoutId?: string | null; + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + payoutInstrument?: PayoutInstrument; + + /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ + payoutStatus?: string | null; + + /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ + payoutStatusDescription?: string | null; + + /** + * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + export interface PayoutInstrument { + + /** This string value is the last four digits of the seller's account number. */ + accountLastFourDigits?: string | null; + + /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ + instrumentType?: string | null; + + /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ + nickname?: string | null; + } + + + /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ + export interface PayoutSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** + * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + payoutCount?: number | null; + + /** + * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ + export interface Payouts { + + /** The URI of the getPayouts call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ + payouts?: Array; + + /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ + export interface SellerFundsSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + availableFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + fundsOnHold?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + processingFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + totalFunds?: Amount; + } + + + /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ + export interface Transaction { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ + bookingEntry?: string | null; + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + buyer?: Buyer; + + /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ + orderId?: string | null; + + /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ + payoutId?: string | null; + + /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ + salesRecordReference?: string | null; + + /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ + transactionDate?: string | null; + + /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ + transactionId?: string | null; + + /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ + transactionMemo?: string | null; + + /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ + transactionStatus?: string | null; + + /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ + transactionType?: string | null; + } + + + /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ + export interface TransactionSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + creditAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ + creditBookingEntry?: string | null; + + /** + * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + creditCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + disputeAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ + disputeBookingEntry?: string | null; + + /** + * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + disputeCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + onHoldAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ + onHoldBookingEntry?: string | null; + + /** + * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + onHoldCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + refundAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ + refundBookingEntry?: string | null; + + /** + * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + refundCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + shippingLabelAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ + shippingLabelBookingEntry?: string | null; + + /** + * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + shippingLabelCount?: number | null; + } + + + /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ + export interface Transactions { + + /** The URI of the getTransactions method request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ + transactions?: Array; + } + + export class PayoutClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. + * Get payout/{payout_Id} + * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. + * @return {Payout} Success + */ + GetPayout(payout_Id: string): Promise { + return Axios.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. + * Get payout + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) + * @return {Payouts} Success + */ + GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. + * Get payout_summary + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {PayoutSummaryResponse} Success + */ + GetPayoutSummary(filter: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class TransactionClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. + * Get transaction + * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * @return {Transactions} Success + */ + GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). + * Get transaction_summary + * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {TransactionSummaryResponse} Success + */ + GetTransactionSummary(filter: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Seller_funds_summaryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. + * Get seller_funds_summary + * @return {SellerFundsSummaryResponse} Success + */ + GetSellerFundsSummary(): Promise { + return Axios.get(this.baseUri + 'seller_funds_summary', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_inventory.txt b/Tests/SwagTsTests/AxiosResults/sell_inventory.ts similarity index 99% rename from Tests/SwagTsTests/AxiosResults/sell_inventory.txt rename to Tests/SwagTsTests/AxiosResults/sell_inventory.ts index 5ad7f402..3c156f5e 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_inventory.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_inventory.ts @@ -1,1848 +1,1848 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** This type is used to define the physical address of an inventory location. */ - export interface Address { - - /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine1?: string | null; - - /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine2?: string | null; - - /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ - city?: string | null; - - /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ - country?: string | null; - - /** The county in which the address resides. This field is returned if defined for an inventory location. */ - county?: string | null; - - /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ - postalCode?: string | null; - - /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ - stateOrProvince?: string | null; - } - - - /** This type is used to express a dollar value and the applicable currency. */ - export interface Amount { - - /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ - currency?: string | null; - - /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ - value?: string | null; - } - - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - export interface Availability { - - /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - pickupAtLocationAvailability?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - } - - - /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ - export interface PickupAtLocationAvailability { - - /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ - availabilityType?: string | null; - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - fulfillmentTime?: TimeDuration; - - /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ - merchantLocationKey?: string | null; - - /** - * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - export interface TimeDuration { - - /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - export interface ShipToLocationAvailability { - - /** - * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ - export interface BaseResponse { - - /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ - warnings?: Array; - } - - - /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ - export interface Error { - - /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ - category?: string | null; - - /** The name of the domain in which the error or warning occurred. */ - domain?: string | null; - - /** - * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ - longMessage?: string | null; - - /** A description of the condition that caused the error or warning. */ - message?: string | null; - - /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ - outputRefIds?: Array; - - /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. */ - subdomain?: string | null; - } - - - /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ - export interface ErrorParameter { - - /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ - name?: string | null; - - /** This is the actual value that was passed in for the element specified in the name field. */ - value?: string | null; - } - - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - export interface BestOffer { - - /** This type is used to express a dollar value and the applicable currency. */ - autoAcceptPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - autoDeclinePrice?: Amount; - - /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ - bestOfferEnabled?: boolean | null; - } - - - /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ - export interface BulkEbayOfferDetailsWithKeys { - - /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ - requests?: Array; - } - - - /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ - export interface EbayOfferDetailsWithKeys { - - /** - * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - - /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ - donationPercentage?: string | null; - } - - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - export interface ListingPolicies { - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - bestOfferTerms?: BestOffer; - - /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - eBayPlusIfEligible?: boolean | null; - - /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - fulfillmentPolicyId?: string | null; - - /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - paymentPolicyId?: string | null; - - /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - returnPolicyId?: string | null; - - /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ - shippingCostOverrides?: Array; - } - - - /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ - export interface ShippingCostOverride { - - /** This type is used to express a dollar value and the applicable currency. */ - additionalShippingCost?: Amount; - - /** - * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - priority?: number | null; - - /** This type is used to express a dollar value and the applicable currency. */ - shippingCost?: Amount; - - /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ - shippingServiceType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - surcharge?: Amount; - } - - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - export interface PricingSummary { - - /** This type is used to express a dollar value and the applicable currency. */ - minimumAdvertisedPrice?: Amount; - - /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - originallySoldForRetailPriceOn?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - originalRetailPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - - /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - pricingVisibility?: string | null; - } - - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - export interface Tax { - - /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ - applyTax?: boolean | null; - - /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ - thirdPartyTaxCategory?: string | null; - - /** - * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. - * Type: double - */ - vatPercentage?: number | null; - } - - - /** This type is used by the base request of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItem { - - /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ - requests?: Array; - } - - - /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ - export interface GetInventoryItem { - - /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemResponse { - - /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ - export interface GetInventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ - errors?: Array; - - /** This type is used to provide details about each retrieved inventory item record. */ - inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ - warnings?: Array; - } - - - /** This type is used to provide details about each retrieved inventory item record. */ - export interface InventoryItemWithSkuLocaleGroupKeys { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface PackageWeightAndSize { - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - dimensions?: Dimension; - - /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ - packageType?: string | null; - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - weight?: Weight; - } - - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Dimension { - - /** - * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - height?: number | null; - - /** - * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - length?: number | null; - - /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - width?: number | null; - } - - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Weight { - - /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } - * Type: double - */ - value?: number | null; - } - - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - export interface Product { - - /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ - aspects?: Array; - - /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ - brand?: string | null; - - /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ - description?: string | null; - - /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ - ean?: Array; - - /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ - epid?: string | null; - - /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ - imageUrls?: Array; - - /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ - isbn?: Array; - - /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ - mpn?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ - title?: string | null; - - /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ - upc?: Array; - } - - - /** The base request of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItem { - - /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ - requests?: Array; - } - - - /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ - export interface InventoryItemWithSkuLocale { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemResponse { - - /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ - export interface InventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ - errors?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base container of the bulkMigrateListings request payload. */ - export interface BulkMigrateListing { - - /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ - requests?: Array; - } - - - /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ - export interface MigrateListing { - - /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ - listingId?: string | null; - } - - - /** This type is used by the response payload of the bulkMigrateListings call. */ - export interface BulkMigrateListingResponse { - - /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ - responses?: Array; - } - - - /** This type is used to display the results of each listing that the seller attempted to migrate. */ - export interface MigrateListingResponse { - - /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ - errors?: Array; - - /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ - inventoryItemGroupKey?: string | null; - - /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ - inventoryItems?: Array; - - /** The unique identifier of the eBay listing that the seller attempted to migrate. */ - listingId?: string | null; - - /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ - warnings?: Array; - } - - - /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ - export interface InventoryItemListing { - - /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ - offerId?: string | null; - - /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ - sku?: string | null; - } - - - /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ - export interface BulkOffer { - - /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ - requests?: Array; - } - - - /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ - export interface OfferKeyWithId { - - /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ - offerId?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOffer method. */ - export interface BulkOfferResponse { - - /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ - export interface OfferSkuResponse { - - /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ - errors?: Array; - - /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ - offerId?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ - sku?: string | null; - - /** - * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ - warnings?: Array; - } - - - /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - export interface BulkPriceQuantity { - - /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - requests?: Array; - } - - - /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ - export interface PriceQuantity { - - /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ - offers?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - - /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ - export interface OfferPriceQuantity { - - /** - * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ - offerId?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - } - - - /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - export interface BulkPriceQuantityResponse { - - /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - responses?: Array; - } - - - /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ - export interface PriceQuantityResponse { - - /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ - errors?: Array; - - /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ - offerId?: string | null; - - /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ - sku?: string | null; - - /** - * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base response of the bulkPublishOffer method. */ - export interface BulkPublishResponse { - - /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ - responses?: Array; - } - - - /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ - export interface OfferResponseWithListingId { - - /** This container will be returned if there were one or more errors associated with publishing the offer. */ - errors?: Array; - - /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ - listingId?: string | null; - - /** The unique identifier of the offer that the seller published (or attempted to publish). */ - offerId?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with publishing the offer. */ - warnings?: Array; - } - - - /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ - export interface Compatibility { - - /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ - compatibleProducts?: Array; - - /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ - sku?: string | null; - } - - - /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ - export interface CompatibleProduct { - - /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ - compatibilityProperties?: Array; - - /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ - notes?: string | null; - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - productFamilyProperties?: ProductFamilyProperties; - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - productIdentifier?: ProductIdentifier; - } - - - /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ - export interface NameValueList { - - /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ - name?: string | null; - - /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ - value?: string | null; - } - - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - export interface ProductFamilyProperties { - - /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ - engine?: string | null; - - /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ - make?: string | null; - - /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ - model?: string | null; - - /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ - trim?: string | null; - - /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ - year?: string | null; - } - - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - export interface ProductIdentifier { - - /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ - epid?: string | null; - - /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ - gtin?: string | null; - - /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ - ktype?: string | null; - } - - - /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ - export interface EbayOfferDetailsWithAll { - - /** - * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - listing?: ListingDetails; - - /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ - merchantLocationKey?: string | null; - - /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ - offerId?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ - sku?: string | null; - - /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - export interface ListingDetails { - - /** The unique identifier of the eBay listing that is associated with the published offer. */ - listingId?: string | null; - - /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ - listingStatus?: string | null; - - /** - * This integer value indicates the quantity of the product that has been sold for the published offer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - soldQuantity?: number | null; - } - - - /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ - export interface EbayOfferDetailsWithId { - - /** - * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ - export interface Fee { - - /** This type is used to express a dollar value and the applicable currency. */ - amount?: Amount; - - /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - feeType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - promotionalDiscount?: Amount; - } - - - /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ - export interface FeeSummary { - - /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - fees?: Array; - - /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response payload for the getListingFees call. */ - export interface FeesSummaryResponse { - - /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ - feeSummaries?: Array; - } - - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - export interface GeoCoordinates { - - /** - * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - longitude?: number | null; - } - - - /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ - export interface Interval { - - /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - close?: string | null; - - /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - open?: string | null; - } - - - /** This type is used to provide detailed information about an inventory item. */ - export interface InventoryItem { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - } - - - /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ - export interface InventoryItemGroup { - - /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ - aspects?: Array; - - /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ - description?: string | null; - - /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ - imageUrls?: Array; - - /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ - inventoryItemGroupKey?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ - title?: string | null; - - /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ - variantSKUs?: Array; - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - variesBy?: VariesBy; - } - - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - export interface VariesBy { - - /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ - aspectsImageVariesBy?: Array; - - /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ - specifications?: Array; - } - - - /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ - export interface Specification { - - /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ - name?: string | null; - - /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ - values?: Array; - } - - export interface InventoryItemWithSkuLocaleGroupid { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ - groupIds?: Array; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used by the base response payload of getInventoryItems call. */ - export interface InventoryItems { - - /** This is the URL to the current page of inventory items. */ - href?: string | null; - - /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ - inventoryItems?: Array; - - /** - * This integer value is the number of inventory items that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ - next?: string | null; - - /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ - prev?: string | null; - - /** - * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ - export interface InventoryLocation { - - /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ - locationInstructions?: string | null; - - /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ - locationWebUrl?: string | null; - - /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ - name?: string | null; - - /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ - operatingHours?: Array; - - /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ - phone?: string | null; - - /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ - specialHours?: Array; - } - - - /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ - export interface OperatingHours { - - /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ - dayOfWeekEnum?: string | null; - - /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ - intervals?: Array; - } - - - /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ - export interface SpecialHours { - - /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ - date?: string | null; - - /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ - intervals?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ - export interface InventoryLocationFull { - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - location?: LocationDetails; - - /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ - locationInstructions?: string | null; - - /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ - locationTypes?: Array; - - /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ - phone?: string | null; - - /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ - specialHours?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - export interface LocationDetails { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - } - - - /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ - export interface InventoryLocationResponse { - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - location?: Location; - - /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ - locationInstructions?: string | null; - - /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ - locationTypes?: Array; - - /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ - phone?: string | null; - - /** This container shows the special operating hours for a store location on a specific date or dates. */ - specialHours?: Array; - } - - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - export interface Location { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - - /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ - locationId?: string | null; - } - - - /** This type is used by the base response payload for the getInventoryLocations call. */ - export interface LocationResponse { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of one or more of the merchant's inventory locations. */ - locations?: Array; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the base request payload of the getListingFees call. */ - export interface OfferKeysWithId { - - /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ - offers?: Array; - } - - - /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ - export interface OfferResponse { - - /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ - offerId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ - export interface Offers { - - /** This is the URL to the current page of offers. */ - href?: string | null; - - /** - * This integer value is the number of offers that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ - next?: string | null; - - /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ - offers?: Array; - - /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ - prev?: string | null; - - /** - * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ - export interface PublishByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ - export interface PublishResponse { - - /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ - listingId?: string | null; - - /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ - warnings?: Array; - } - - - /** This type is used to show the version number and instance of the service or API. */ - export interface Version { - - /** This type is used to show the version number and instance of the service or API. */ - instance?: Version; - - /** The version number of the service or API. */ - version?: string | null; - } - - - /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ - export interface WithdrawByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** The base response of the withdrawOffer call. */ - export interface WithdrawResponse { - - /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ - listingId?: string | null; - - /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ - warnings?: Array; - } - - export class LocationClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 - * @return {InventoryLocationResponse} Success - */ - GetInventoryLocation(merchantLocationKey: string): Promise { - return Axios.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 - * @param {InventoryLocationFull} requestBody Inventory Location details - * @return {void} - */ - CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Promise> { - return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. - * Delete location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 - * @return {void} - */ - DeleteInventoryLocation(merchantLocationKey: string): Promise> { - return Axios.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { responseType: 'text' }); - } - - /** - * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/disable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 - * @return {string} Success - */ - DisableInventoryLocation(merchantLocationKey: string): Promise { - return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/enable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 - * @return {string} Success - */ - EnableInventoryLocation(merchantLocationKey: string): Promise { - return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 - * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {LocationResponse} Success - */ - GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey}/update_location_details - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 - * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). - * @return {void} - */ - UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Promise> { - return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class Inventory_itemClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Get inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. - * @return {InventoryItemWithSkuLocaleGroupid} Success - */ - GetInventoryItem(sku: string): Promise { - return Axios.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. - * Put inventory_item/{sku} - * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. - * @param {InventoryItem} requestBody Details of the inventory item record. - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Promise { - return Axios.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Delete inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. - * @return {void} - */ - DeleteInventoryItem(sku: string): Promise> { - return Axios.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { responseType: 'text' }); - } - - /** - * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. - * Get inventory_item - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {InventoryItems} Success - */ - GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Post bulk_update_price_quantity - * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace - * @return {BulkPriceQuantityResponse} Success - */ - BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Promise { - return Axios.post(this.baseUri + 'bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. - * Post bulk_create_or_replace_inventory_item - * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkInventoryItemResponse} Success - */ - BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Promise { - return Axios.post(this.baseUri + 'bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Post bulk_get_inventory_item - * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkGetInventoryItemResponse} Success - */ - BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Promise { - return Axios.post(this.baseUri + 'bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Product_compatibilityClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Get inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {Compatibility} Success - */ - GetProductCompatibility(sku: string): Promise { - return Axios.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @param {Compatibility} requestBody Details of the compatibility - * @return {BaseResponse} Success - */ - CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Promise { - return Axios.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Delete inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {void} - */ - DeleteProductCompatibility(sku: string): Promise> { - return Axios.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { responseType: 'text' }); - } - } - - export class OfferClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer - * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. - * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. - * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {Offers} Success - */ - GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. - * Post offer - * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {void} - */ - CreateOffer(requestBody: EbayOfferDetailsWithKeys): Promise> { - return Axios.post(this.baseUri + 'offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is to be retrieved. - * @return {EbayOfferDetailsWithAll} Success - */ - GetOffer(offerId: string): Promise { - return Axios.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. - * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel - * @return {OfferResponse} Success - */ - UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Promise { - return Axios.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. - * Delete offer/{offerId} - * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. - * @return {void} - */ - DeleteOffer(offerId: string): Promise> { - return Axios.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { responseType: 'text' }); - } - - /** - * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post offer/{offerId}/publish/ - * @param {string} offerId The unique identifier of the offer that is to be published. - * @return {PublishResponse} Success - */ - PublishOffer(offerId: string): Promise { - return Axios.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. - * Post offer/publish_by_inventory_item_group/ - * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. - * @return {PublishResponse} Success - */ - PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Promise { - return Axios.post(this.baseUri + 'offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. - * Post offer/withdraw_by_inventory_item_group - * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. - * @return {void} - */ - WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Promise> { - return Axios.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. - * Post offer/get_listing_fees - * @param {OfferKeysWithId} requestBody List of offers that needs fee information - * @return {FeesSummaryResponse} Success - */ - GetListingFees(requestBody: OfferKeysWithId): Promise { - return Axios.post(this.baseUri + 'offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. - * Post bulk_create_offer - * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {BulkOfferResponse} Success - */ - BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Promise { - return Axios.post(this.baseUri + 'bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post bulk_publish_offer - * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. - * @return {BulkPublishResponse} Success - */ - BulkPublishOffer(requestBody: BulkOffer): Promise { - return Axios.post(this.baseUri + 'bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. - * Post offer/{offerId}/withdraw - * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. - * @return {WithdrawResponse} Success - */ - WithdrawOffer(offerId: string): Promise { - return Axios.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Inventory_item_groupClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. - * Get inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. - * @return {InventoryItemGroup} Success - */ - GetInventoryItemGroup(inventoryItemGroupKey: string): Promise { - return Axios.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. - * @param {InventoryItemGroup} requestBody Details of the inventory Item Group - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Promise { - return Axios.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call deletes the inventory item group for a given inventoryItemGroupKey value. - * Delete inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. - * @return {void} - */ - DeleteInventoryItemGroup(inventoryItemGroupKey: string): Promise> { - return Axios.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { responseType: 'text' }); - } - } - - export class ListingClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. - * Post bulk_migrate_listing - * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory - * @return {BulkMigrateListingResponse} Success - */ - BulkMigrateListing(requestBody: BulkMigrateListing): Promise { - return Axios.post(this.baseUri + 'bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** This type is used to define the physical address of an inventory location. */ + export interface Address { + + /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine1?: string | null; + + /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine2?: string | null; + + /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ + city?: string | null; + + /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ + country?: string | null; + + /** The county in which the address resides. This field is returned if defined for an inventory location. */ + county?: string | null; + + /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ + postalCode?: string | null; + + /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ + stateOrProvince?: string | null; + } + + + /** This type is used to express a dollar value and the applicable currency. */ + export interface Amount { + + /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ + currency?: string | null; + + /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ + value?: string | null; + } + + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + export interface Availability { + + /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + pickupAtLocationAvailability?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + } + + + /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ + export interface PickupAtLocationAvailability { + + /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ + availabilityType?: string | null; + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + fulfillmentTime?: TimeDuration; + + /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ + merchantLocationKey?: string | null; + + /** + * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + export interface TimeDuration { + + /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + export interface ShipToLocationAvailability { + + /** + * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ + export interface BaseResponse { + + /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ + warnings?: Array; + } + + + /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ + export interface Error { + + /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ + category?: string | null; + + /** The name of the domain in which the error or warning occurred. */ + domain?: string | null; + + /** + * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ + longMessage?: string | null; + + /** A description of the condition that caused the error or warning. */ + message?: string | null; + + /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ + outputRefIds?: Array; + + /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. */ + subdomain?: string | null; + } + + + /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ + export interface ErrorParameter { + + /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ + name?: string | null; + + /** This is the actual value that was passed in for the element specified in the name field. */ + value?: string | null; + } + + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + export interface BestOffer { + + /** This type is used to express a dollar value and the applicable currency. */ + autoAcceptPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + autoDeclinePrice?: Amount; + + /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ + bestOfferEnabled?: boolean | null; + } + + + /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ + export interface BulkEbayOfferDetailsWithKeys { + + /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ + requests?: Array; + } + + + /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ + export interface EbayOfferDetailsWithKeys { + + /** + * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + + /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ + donationPercentage?: string | null; + } + + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + export interface ListingPolicies { + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + bestOfferTerms?: BestOffer; + + /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + eBayPlusIfEligible?: boolean | null; + + /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + fulfillmentPolicyId?: string | null; + + /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + paymentPolicyId?: string | null; + + /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + returnPolicyId?: string | null; + + /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ + shippingCostOverrides?: Array; + } + + + /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ + export interface ShippingCostOverride { + + /** This type is used to express a dollar value and the applicable currency. */ + additionalShippingCost?: Amount; + + /** + * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + priority?: number | null; + + /** This type is used to express a dollar value and the applicable currency. */ + shippingCost?: Amount; + + /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ + shippingServiceType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + surcharge?: Amount; + } + + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + export interface PricingSummary { + + /** This type is used to express a dollar value and the applicable currency. */ + minimumAdvertisedPrice?: Amount; + + /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + originallySoldForRetailPriceOn?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + originalRetailPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + + /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + pricingVisibility?: string | null; + } + + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + export interface Tax { + + /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ + applyTax?: boolean | null; + + /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ + thirdPartyTaxCategory?: string | null; + + /** + * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. + * Type: double + */ + vatPercentage?: number | null; + } + + + /** This type is used by the base request of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItem { + + /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ + requests?: Array; + } + + + /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ + export interface GetInventoryItem { + + /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemResponse { + + /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ + export interface GetInventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ + errors?: Array; + + /** This type is used to provide details about each retrieved inventory item record. */ + inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ + warnings?: Array; + } + + + /** This type is used to provide details about each retrieved inventory item record. */ + export interface InventoryItemWithSkuLocaleGroupKeys { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface PackageWeightAndSize { + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + dimensions?: Dimension; + + /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ + packageType?: string | null; + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + weight?: Weight; + } + + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Dimension { + + /** + * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + height?: number | null; + + /** + * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + length?: number | null; + + /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + width?: number | null; + } + + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Weight { + + /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } + * Type: double + */ + value?: number | null; + } + + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + export interface Product { + + /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ + aspects?: Array; + + /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ + brand?: string | null; + + /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ + description?: string | null; + + /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ + ean?: Array; + + /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ + epid?: string | null; + + /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ + imageUrls?: Array; + + /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ + isbn?: Array; + + /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ + mpn?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ + title?: string | null; + + /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ + upc?: Array; + } + + + /** The base request of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItem { + + /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ + requests?: Array; + } + + + /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ + export interface InventoryItemWithSkuLocale { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemResponse { + + /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ + export interface InventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ + errors?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base container of the bulkMigrateListings request payload. */ + export interface BulkMigrateListing { + + /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ + requests?: Array; + } + + + /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ + export interface MigrateListing { + + /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ + listingId?: string | null; + } + + + /** This type is used by the response payload of the bulkMigrateListings call. */ + export interface BulkMigrateListingResponse { + + /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ + responses?: Array; + } + + + /** This type is used to display the results of each listing that the seller attempted to migrate. */ + export interface MigrateListingResponse { + + /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ + errors?: Array; + + /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ + inventoryItemGroupKey?: string | null; + + /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ + inventoryItems?: Array; + + /** The unique identifier of the eBay listing that the seller attempted to migrate. */ + listingId?: string | null; + + /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ + warnings?: Array; + } + + + /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ + export interface InventoryItemListing { + + /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ + offerId?: string | null; + + /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ + sku?: string | null; + } + + + /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ + export interface BulkOffer { + + /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ + requests?: Array; + } + + + /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ + export interface OfferKeyWithId { + + /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ + offerId?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOffer method. */ + export interface BulkOfferResponse { + + /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ + export interface OfferSkuResponse { + + /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ + errors?: Array; + + /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ + offerId?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ + sku?: string | null; + + /** + * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ + warnings?: Array; + } + + + /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + export interface BulkPriceQuantity { + + /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + requests?: Array; + } + + + /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ + export interface PriceQuantity { + + /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ + offers?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + + /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ + export interface OfferPriceQuantity { + + /** + * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ + offerId?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + } + + + /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + export interface BulkPriceQuantityResponse { + + /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + responses?: Array; + } + + + /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ + export interface PriceQuantityResponse { + + /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ + errors?: Array; + + /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ + offerId?: string | null; + + /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ + sku?: string | null; + + /** + * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base response of the bulkPublishOffer method. */ + export interface BulkPublishResponse { + + /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ + responses?: Array; + } + + + /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ + export interface OfferResponseWithListingId { + + /** This container will be returned if there were one or more errors associated with publishing the offer. */ + errors?: Array; + + /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ + listingId?: string | null; + + /** The unique identifier of the offer that the seller published (or attempted to publish). */ + offerId?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with publishing the offer. */ + warnings?: Array; + } + + + /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ + export interface Compatibility { + + /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ + compatibleProducts?: Array; + + /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ + sku?: string | null; + } + + + /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ + export interface CompatibleProduct { + + /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ + compatibilityProperties?: Array; + + /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ + notes?: string | null; + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + productFamilyProperties?: ProductFamilyProperties; + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + productIdentifier?: ProductIdentifier; + } + + + /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ + export interface NameValueList { + + /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ + name?: string | null; + + /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ + value?: string | null; + } + + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + export interface ProductFamilyProperties { + + /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ + engine?: string | null; + + /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ + make?: string | null; + + /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ + model?: string | null; + + /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ + trim?: string | null; + + /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ + year?: string | null; + } + + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + export interface ProductIdentifier { + + /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ + epid?: string | null; + + /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ + gtin?: string | null; + + /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ + ktype?: string | null; + } + + + /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ + export interface EbayOfferDetailsWithAll { + + /** + * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + listing?: ListingDetails; + + /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ + merchantLocationKey?: string | null; + + /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ + offerId?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ + sku?: string | null; + + /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + export interface ListingDetails { + + /** The unique identifier of the eBay listing that is associated with the published offer. */ + listingId?: string | null; + + /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ + listingStatus?: string | null; + + /** + * This integer value indicates the quantity of the product that has been sold for the published offer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + soldQuantity?: number | null; + } + + + /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ + export interface EbayOfferDetailsWithId { + + /** + * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ + export interface Fee { + + /** This type is used to express a dollar value and the applicable currency. */ + amount?: Amount; + + /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + feeType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + promotionalDiscount?: Amount; + } + + + /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ + export interface FeeSummary { + + /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + fees?: Array; + + /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response payload for the getListingFees call. */ + export interface FeesSummaryResponse { + + /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ + feeSummaries?: Array; + } + + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + export interface GeoCoordinates { + + /** + * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + longitude?: number | null; + } + + + /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ + export interface Interval { + + /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + close?: string | null; + + /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + open?: string | null; + } + + + /** This type is used to provide detailed information about an inventory item. */ + export interface InventoryItem { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + } + + + /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ + export interface InventoryItemGroup { + + /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ + aspects?: Array; + + /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ + description?: string | null; + + /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ + imageUrls?: Array; + + /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ + inventoryItemGroupKey?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ + title?: string | null; + + /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ + variantSKUs?: Array; + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + variesBy?: VariesBy; + } + + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + export interface VariesBy { + + /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ + aspectsImageVariesBy?: Array; + + /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ + specifications?: Array; + } + + + /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ + export interface Specification { + + /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ + name?: string | null; + + /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ + values?: Array; + } + + export interface InventoryItemWithSkuLocaleGroupid { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ + groupIds?: Array; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used by the base response payload of getInventoryItems call. */ + export interface InventoryItems { + + /** This is the URL to the current page of inventory items. */ + href?: string | null; + + /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ + inventoryItems?: Array; + + /** + * This integer value is the number of inventory items that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ + next?: string | null; + + /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ + prev?: string | null; + + /** + * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ + export interface InventoryLocation { + + /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ + locationInstructions?: string | null; + + /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ + locationWebUrl?: string | null; + + /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ + name?: string | null; + + /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ + operatingHours?: Array; + + /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ + phone?: string | null; + + /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ + specialHours?: Array; + } + + + /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ + export interface OperatingHours { + + /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ + dayOfWeekEnum?: string | null; + + /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ + intervals?: Array; + } + + + /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ + export interface SpecialHours { + + /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ + date?: string | null; + + /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ + intervals?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ + export interface InventoryLocationFull { + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + location?: LocationDetails; + + /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ + locationInstructions?: string | null; + + /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ + locationTypes?: Array; + + /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ + phone?: string | null; + + /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ + specialHours?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + export interface LocationDetails { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + } + + + /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ + export interface InventoryLocationResponse { + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + location?: Location; + + /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ + locationInstructions?: string | null; + + /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ + locationTypes?: Array; + + /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ + phone?: string | null; + + /** This container shows the special operating hours for a store location on a specific date or dates. */ + specialHours?: Array; + } + + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + export interface Location { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + + /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ + locationId?: string | null; + } + + + /** This type is used by the base response payload for the getInventoryLocations call. */ + export interface LocationResponse { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of one or more of the merchant's inventory locations. */ + locations?: Array; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the base request payload of the getListingFees call. */ + export interface OfferKeysWithId { + + /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ + offers?: Array; + } + + + /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ + export interface OfferResponse { + + /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ + offerId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ + export interface Offers { + + /** This is the URL to the current page of offers. */ + href?: string | null; + + /** + * This integer value is the number of offers that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ + next?: string | null; + + /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ + offers?: Array; + + /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ + prev?: string | null; + + /** + * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ + export interface PublishByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ + export interface PublishResponse { + + /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ + listingId?: string | null; + + /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ + warnings?: Array; + } + + + /** This type is used to show the version number and instance of the service or API. */ + export interface Version { + + /** This type is used to show the version number and instance of the service or API. */ + instance?: Version; + + /** The version number of the service or API. */ + version?: string | null; + } + + + /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ + export interface WithdrawByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** The base response of the withdrawOffer call. */ + export interface WithdrawResponse { + + /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ + listingId?: string | null; + + /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ + warnings?: Array; + } + + export class LocationClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 + * @return {InventoryLocationResponse} Success + */ + GetInventoryLocation(merchantLocationKey: string): Promise { + return Axios.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 + * @param {InventoryLocationFull} requestBody Inventory Location details + * @return {void} + */ + CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Promise> { + return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. + * Delete location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 + * @return {void} + */ + DeleteInventoryLocation(merchantLocationKey: string): Promise> { + return Axios.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { responseType: 'text' }); + } + + /** + * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/disable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 + * @return {string} Success + */ + DisableInventoryLocation(merchantLocationKey: string): Promise { + return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/enable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 + * @return {string} Success + */ + EnableInventoryLocation(merchantLocationKey: string): Promise { + return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, { responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 + * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {LocationResponse} Success + */ + GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey}/update_location_details + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 + * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). + * @return {void} + */ + UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Promise> { + return Axios.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class Inventory_itemClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Get inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. + * @return {InventoryItemWithSkuLocaleGroupid} Success + */ + GetInventoryItem(sku: string): Promise { + return Axios.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. + * Put inventory_item/{sku} + * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. + * @param {InventoryItem} requestBody Details of the inventory item record. + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Promise { + return Axios.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Delete inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. + * @return {void} + */ + DeleteInventoryItem(sku: string): Promise> { + return Axios.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { responseType: 'text' }); + } + + /** + * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. + * Get inventory_item + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {InventoryItems} Success + */ + GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Post bulk_update_price_quantity + * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace + * @return {BulkPriceQuantityResponse} Success + */ + BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Promise { + return Axios.post(this.baseUri + 'bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. + * Post bulk_create_or_replace_inventory_item + * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkInventoryItemResponse} Success + */ + BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Promise { + return Axios.post(this.baseUri + 'bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Post bulk_get_inventory_item + * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkGetInventoryItemResponse} Success + */ + BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Promise { + return Axios.post(this.baseUri + 'bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Product_compatibilityClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Get inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {Compatibility} Success + */ + GetProductCompatibility(sku: string): Promise { + return Axios.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @param {Compatibility} requestBody Details of the compatibility + * @return {BaseResponse} Success + */ + CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Promise { + return Axios.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Delete inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {void} + */ + DeleteProductCompatibility(sku: string): Promise> { + return Axios.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { responseType: 'text' }); + } + } + + export class OfferClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer + * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. + * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. + * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {Offers} Success + */ + GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. + * Post offer + * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {void} + */ + CreateOffer(requestBody: EbayOfferDetailsWithKeys): Promise> { + return Axios.post(this.baseUri + 'offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is to be retrieved. + * @return {EbayOfferDetailsWithAll} Success + */ + GetOffer(offerId: string): Promise { + return Axios.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. + * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel + * @return {OfferResponse} Success + */ + UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Promise { + return Axios.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. + * Delete offer/{offerId} + * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. + * @return {void} + */ + DeleteOffer(offerId: string): Promise> { + return Axios.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { responseType: 'text' }); + } + + /** + * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post offer/{offerId}/publish/ + * @param {string} offerId The unique identifier of the offer that is to be published. + * @return {PublishResponse} Success + */ + PublishOffer(offerId: string): Promise { + return Axios.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. + * Post offer/publish_by_inventory_item_group/ + * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. + * @return {PublishResponse} Success + */ + PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Promise { + return Axios.post(this.baseUri + 'offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. + * Post offer/withdraw_by_inventory_item_group + * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. + * @return {void} + */ + WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Promise> { + return Axios.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. + * Post offer/get_listing_fees + * @param {OfferKeysWithId} requestBody List of offers that needs fee information + * @return {FeesSummaryResponse} Success + */ + GetListingFees(requestBody: OfferKeysWithId): Promise { + return Axios.post(this.baseUri + 'offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. + * Post bulk_create_offer + * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {BulkOfferResponse} Success + */ + BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Promise { + return Axios.post(this.baseUri + 'bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post bulk_publish_offer + * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. + * @return {BulkPublishResponse} Success + */ + BulkPublishOffer(requestBody: BulkOffer): Promise { + return Axios.post(this.baseUri + 'bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. + * Post offer/{offerId}/withdraw + * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. + * @return {WithdrawResponse} Success + */ + WithdrawOffer(offerId: string): Promise { + return Axios.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Inventory_item_groupClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. + * Get inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. + * @return {InventoryItemGroup} Success + */ + GetInventoryItemGroup(inventoryItemGroupKey: string): Promise { + return Axios.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. + * @param {InventoryItemGroup} requestBody Details of the inventory Item Group + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Promise { + return Axios.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call deletes the inventory item group for a given inventoryItemGroupKey value. + * Delete inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. + * @return {void} + */ + DeleteInventoryItemGroup(inventoryItemGroupKey: string): Promise> { + return Axios.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { responseType: 'text' }); + } + } + + export class ListingClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. + * Post bulk_migrate_listing + * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory + * @return {BulkMigrateListingResponse} Success + */ + BulkMigrateListing(requestBody: BulkMigrateListing): Promise { + return Axios.post(this.baseUri + 'bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_listing.txt b/Tests/SwagTsTests/AxiosResults/sell_listing.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/sell_listing.txt rename to Tests/SwagTsTests/AxiosResults/sell_listing.ts index f7445977..16e273b6 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_listing.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_listing.ts @@ -1,170 +1,170 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** The type that defines the fields for the currency and a monetary amount. */ - export interface Amount { - - /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. */ - value?: string | null; - } - - - /** The type that defines the fields for the item aspects. */ - export interface Aspect { - - /** The name of an aspect, such and Brand. */ - name?: string | null; - - /** A list of potential values for this aspect. */ - values?: Array; - } - - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ - donationPercentage?: string | null; - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** The type that defines the fields for the listing details. */ - export interface ItemDraft { - - /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - categoryId?: string | null; - - /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The type that defines the fields for the price details for an item. */ - pricingSummary?: PricingSummary; - - /** The type that defines the fields for the aspects of a product. */ - product?: Product; - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - } - - - /** The type that defines the fields for the price details for an item. */ - export interface PricingSummary { - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionReservePrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionStartPrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - price?: Amount; - } - - - /** The type that defines the fields for the aspects of a product. */ - export interface Product { - - /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ - aspects?: Array; - - /** The name brand of the item, such as Nike, Apple, etc. */ - brand?: string | null; - - /** The description of the item that was created by the seller. This can be plain text or rich content. */ - description?: string | null; - - /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - epid?: string | null; - - /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ - imageUrls?: Array; - - /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ - title?: string | null; - } - - - /** The type that defines the field for the createItemDraft response. */ - export interface ItemDraftResponse { - - /** The eBay generated ID of the listing draft. */ - itemDraftId?: string | null; - - /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ - sellFlowNativeUri?: string | null; - - /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ - sellFlowUrl?: string | null; - } - - export class Item_draftClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. - * Post item_draft/ - * @return {void} - */ - CreateItemDraft(requestBody: ItemDraft): Promise> { - return Axios.post(this.baseUri + 'item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** The type that defines the fields for the currency and a monetary amount. */ + export interface Amount { + + /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. */ + value?: string | null; + } + + + /** The type that defines the fields for the item aspects. */ + export interface Aspect { + + /** The name of an aspect, such and Brand. */ + name?: string | null; + + /** A list of potential values for this aspect. */ + values?: Array; + } + + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ + donationPercentage?: string | null; + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** The type that defines the fields for the listing details. */ + export interface ItemDraft { + + /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + categoryId?: string | null; + + /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The type that defines the fields for the price details for an item. */ + pricingSummary?: PricingSummary; + + /** The type that defines the fields for the aspects of a product. */ + product?: Product; + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + } + + + /** The type that defines the fields for the price details for an item. */ + export interface PricingSummary { + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionReservePrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionStartPrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + price?: Amount; + } + + + /** The type that defines the fields for the aspects of a product. */ + export interface Product { + + /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ + aspects?: Array; + + /** The name brand of the item, such as Nike, Apple, etc. */ + brand?: string | null; + + /** The description of the item that was created by the seller. This can be plain text or rich content. */ + description?: string | null; + + /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + epid?: string | null; + + /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ + imageUrls?: Array; + + /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ + title?: string | null; + } + + + /** The type that defines the field for the createItemDraft response. */ + export interface ItemDraftResponse { + + /** The eBay generated ID of the listing draft. */ + itemDraftId?: string | null; + + /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ + sellFlowNativeUri?: string | null; + + /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ + sellFlowUrl?: string | null; + } + + export class Item_draftClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. + * Post item_draft/ + * @return {void} + */ + CreateItemDraft(requestBody: ItemDraft): Promise> { + return Axios.post(this.baseUri + 'item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_logistics.txt b/Tests/SwagTsTests/AxiosResults/sell_logistics.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/sell_logistics.txt rename to Tests/SwagTsTests/AxiosResults/sell_logistics.ts index 0145719e..90b575aa 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_logistics.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_logistics.ts @@ -1,485 +1,485 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ - export interface AdditionalOption { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalCost?: Amount; - - /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ - optionType?: string | null; - } - - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains contact information for an individual buyer or seller. */ - export interface Contact { - - /** The company name with which the contact is associated. */ - companyName?: string | null; - - /** This complex type specifies the details of a geographical address. */ - contactAddress?: ContactAddress; - - /** The contact's full name. */ - fullName?: string | null; - - /** This complex type contains a string field representing a telephone number. */ - primaryPhone?: PhoneNumber; - } - - - /** This complex type specifies the details of a geographical address. */ - export interface ContactAddress { - - /** The first line of the street address. */ - addressLine1?: string | null; - - /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ - addressLine2?: string | null; - - /** The city in which the address is located. */ - city?: string | null; - - /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ - county?: string | null; - - /** The postal code of the address. */ - postalCode?: string | null; - - /** The state or province in which the address is located. States and provinces often contain multiple counties. */ - stateOrProvince?: string | null; - } - - - /** This complex type contains a string field representing a telephone number. */ - export interface PhoneNumber { - - /** A telephone number. */ - phoneNumber?: string | null; - } - - - /** This complex type contains the request payload for the createFromShippingQuote method. */ - export interface CreateShipmentFromQuoteRequest { - - /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ - additionalOptions?: Array; - - /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ - labelCustomMessage?: string | null; - - /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ - labelSize?: string | null; - - /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ - rateId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ - shippingQuoteId?: string | null; - } - - - /** This complex type defines the dimensions of a package to be shipped. */ - export interface Dimensions { - - /** The numeric value of the height of the package. */ - height?: string | null; - - /** The numeric value of the length of the package. */ - length?: string | null; - - /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the width of the package. */ - width?: string | null; - } - - - /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ - export interface Order { - - /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ - channel?: string | null; - - /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ - orderId?: string | null; - } - - - /** This complex type specifies the dimensions and weight of a package. */ - export interface PackageSpecification { - - /** This complex type defines the dimensions of a package to be shipped. */ - dimensions?: Dimensions; - - /** This complex type contains information about the weight of an object such as a shipping package. */ - weight?: Weight; - } - - - /** This complex type contains information about the weight of an object such as a shipping package. */ - export interface Weight { - - /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the weight of the package, as measured by the value of unit. */ - value?: string | null; - } - - - /** This complex type defines a time window for the pickup of a package. */ - export interface PickupSlot { - - /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ - pickupSlotEndTime?: string | null; - - /** Seller-defined name for the pickup slot. */ - pickupSlotId?: string | null; - - /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ - pickupSlotStartTime?: string | null; - - /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ - pickupSlotTimeZone?: string | null; - } - - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - export interface PurchasedRate { - - /** An list of additional, optional features that have been purchased for the shipment. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ - destinationTimeZone?: string | null; - - /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - maxEstimatedDeliveryDate?: string | null; - - /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ - pickupSlotId?: string | null; - - /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ - rateId?: string | null; - - /** The ID code for the carrier that was selected for the package shipment. */ - shippingCarrierCode?: string | null; - - /** The name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ - shippingQuoteId?: string | null; - - /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ - shippingServiceCode?: string | null; - - /** The name of the shipping service. */ - shippingServiceName?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - totalShippingCost?: Amount; - } - - - /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ - export interface Rate { - - /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ - destinationTimeZone?: string | null; - - /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ - maxEstimatedDeliveryDate?: string | null; - - /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** A list of available pickup slots for the package. */ - pickupSlots?: Array; - - /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The unique eBay-assigned ID for this shipping rate. */ - rateId?: string | null; - - /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ - rateRecommendation?: Array; - - /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ - shippingCarrierCode?: string | null; - - /** The common name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ - shippingServiceCode?: string | null; - - /** The common name of the shipping service. */ - shippingServiceName?: string | null; - } - - - /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ - export interface Shipment { - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - cancellation?: ShipmentCancellation; - - /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - creationDate?: string | null; - - /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ - labelCustomMessage?: string | null; - - /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ - labelDownloadUrl?: string | null; - - /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ - labelSize?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - rate?: PurchasedRate; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ - shipmentId?: string | null; - - /** A unique carrier-assigned ID string that can be used to track the shipment. */ - shipmentTrackingNumber?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - export interface ShipmentCancellation { - - /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ - cancellationRequestedDate?: string | null; - - /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ - cancellationStatus?: string | null; - } - - - /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ - export interface ShippingQuote { - - /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ - creationDate?: string | null; - - /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ - expirationDate?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ - rates?: Array; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ - shippingQuoteId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - - /** A list of any warnings triggered by the request. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning message. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ - export interface ShippingQuoteRequest { - - /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - export class ShipmentClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. - * Post shipment/create_from_shipping_quote - * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. - * @return {void} - */ - CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Promise> { - return Axios.post(this.baseUri + 'shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. - * Get shipment/{shipmentId} - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - GetShipment(shipmentId: string): Promise { - return Axios.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. - * Get shipment/{shipmentId}/download_label_file - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {void} Success - */ - DownloadLabelFile(shipmentId: string): Promise> { - return Axios.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { responseType: 'text' }); - } - - /** - * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. - * Post shipment/{shipmentId}/cancel - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - CancelShipment(shipmentId: string): Promise { - return Axios.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Shipping_quoteClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. - * Post shipping_quote - * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. - * @return {void} - */ - CreateShippingQuote(requestBody: ShippingQuoteRequest): Promise> { - return Axios.post(this.baseUri + 'shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. - * Get shipping_quote/{shippingQuoteId} - * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. - * @return {ShippingQuote} Success - */ - GetShippingQuote(shippingQuoteId: string): Promise { - return Axios.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ + export interface AdditionalOption { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalCost?: Amount; + + /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ + optionType?: string | null; + } + + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains contact information for an individual buyer or seller. */ + export interface Contact { + + /** The company name with which the contact is associated. */ + companyName?: string | null; + + /** This complex type specifies the details of a geographical address. */ + contactAddress?: ContactAddress; + + /** The contact's full name. */ + fullName?: string | null; + + /** This complex type contains a string field representing a telephone number. */ + primaryPhone?: PhoneNumber; + } + + + /** This complex type specifies the details of a geographical address. */ + export interface ContactAddress { + + /** The first line of the street address. */ + addressLine1?: string | null; + + /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ + addressLine2?: string | null; + + /** The city in which the address is located. */ + city?: string | null; + + /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ + county?: string | null; + + /** The postal code of the address. */ + postalCode?: string | null; + + /** The state or province in which the address is located. States and provinces often contain multiple counties. */ + stateOrProvince?: string | null; + } + + + /** This complex type contains a string field representing a telephone number. */ + export interface PhoneNumber { + + /** A telephone number. */ + phoneNumber?: string | null; + } + + + /** This complex type contains the request payload for the createFromShippingQuote method. */ + export interface CreateShipmentFromQuoteRequest { + + /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ + additionalOptions?: Array; + + /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ + labelCustomMessage?: string | null; + + /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ + labelSize?: string | null; + + /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ + rateId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ + shippingQuoteId?: string | null; + } + + + /** This complex type defines the dimensions of a package to be shipped. */ + export interface Dimensions { + + /** The numeric value of the height of the package. */ + height?: string | null; + + /** The numeric value of the length of the package. */ + length?: string | null; + + /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the width of the package. */ + width?: string | null; + } + + + /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ + export interface Order { + + /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ + channel?: string | null; + + /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ + orderId?: string | null; + } + + + /** This complex type specifies the dimensions and weight of a package. */ + export interface PackageSpecification { + + /** This complex type defines the dimensions of a package to be shipped. */ + dimensions?: Dimensions; + + /** This complex type contains information about the weight of an object such as a shipping package. */ + weight?: Weight; + } + + + /** This complex type contains information about the weight of an object such as a shipping package. */ + export interface Weight { + + /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the weight of the package, as measured by the value of unit. */ + value?: string | null; + } + + + /** This complex type defines a time window for the pickup of a package. */ + export interface PickupSlot { + + /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ + pickupSlotEndTime?: string | null; + + /** Seller-defined name for the pickup slot. */ + pickupSlotId?: string | null; + + /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ + pickupSlotStartTime?: string | null; + + /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ + pickupSlotTimeZone?: string | null; + } + + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + export interface PurchasedRate { + + /** An list of additional, optional features that have been purchased for the shipment. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ + destinationTimeZone?: string | null; + + /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + maxEstimatedDeliveryDate?: string | null; + + /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ + pickupSlotId?: string | null; + + /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ + rateId?: string | null; + + /** The ID code for the carrier that was selected for the package shipment. */ + shippingCarrierCode?: string | null; + + /** The name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ + shippingQuoteId?: string | null; + + /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ + shippingServiceCode?: string | null; + + /** The name of the shipping service. */ + shippingServiceName?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + totalShippingCost?: Amount; + } + + + /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ + export interface Rate { + + /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ + destinationTimeZone?: string | null; + + /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ + maxEstimatedDeliveryDate?: string | null; + + /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** A list of available pickup slots for the package. */ + pickupSlots?: Array; + + /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The unique eBay-assigned ID for this shipping rate. */ + rateId?: string | null; + + /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ + rateRecommendation?: Array; + + /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ + shippingCarrierCode?: string | null; + + /** The common name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ + shippingServiceCode?: string | null; + + /** The common name of the shipping service. */ + shippingServiceName?: string | null; + } + + + /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ + export interface Shipment { + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + cancellation?: ShipmentCancellation; + + /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + creationDate?: string | null; + + /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ + labelCustomMessage?: string | null; + + /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ + labelDownloadUrl?: string | null; + + /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ + labelSize?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + rate?: PurchasedRate; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ + shipmentId?: string | null; + + /** A unique carrier-assigned ID string that can be used to track the shipment. */ + shipmentTrackingNumber?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + export interface ShipmentCancellation { + + /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ + cancellationRequestedDate?: string | null; + + /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ + cancellationStatus?: string | null; + } + + + /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ + export interface ShippingQuote { + + /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ + creationDate?: string | null; + + /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ + expirationDate?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ + rates?: Array; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ + shippingQuoteId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + + /** A list of any warnings triggered by the request. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning message. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ + export interface ShippingQuoteRequest { + + /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + export class ShipmentClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. + * Post shipment/create_from_shipping_quote + * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. + * @return {void} + */ + CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Promise> { + return Axios.post(this.baseUri + 'shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. + * Get shipment/{shipmentId} + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + GetShipment(shipmentId: string): Promise { + return Axios.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. + * Get shipment/{shipmentId}/download_label_file + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {void} Success + */ + DownloadLabelFile(shipmentId: string): Promise> { + return Axios.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { responseType: 'text' }); + } + + /** + * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. + * Post shipment/{shipmentId}/cancel + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + CancelShipment(shipmentId: string): Promise { + return Axios.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Shipping_quoteClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. + * Post shipping_quote + * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. + * @return {void} + */ + CreateShippingQuote(requestBody: ShippingQuoteRequest): Promise> { + return Axios.post(this.baseUri + 'shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. + * Get shipping_quote/{shippingQuoteId} + * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. + * @return {ShippingQuote} Success + */ + GetShippingQuote(shippingQuoteId: string): Promise { + return Axios.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_marketing.txt b/Tests/SwagTsTests/AxiosResults/sell_marketing.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/sell_marketing.txt rename to Tests/SwagTsTests/AxiosResults/sell_marketing.ts index c86a3ae8..5f5a0d2b 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_marketing.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_marketing.ts @@ -1,1763 +1,1763 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** This type defines the fields for an ad. */ - export interface Ad { - - /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ - adId?: string | null; - - /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type is a container for a list of ad IDs. */ - export interface AdIds { - - /** A list of ad ID's. */ - adIds?: Array; - } - - - /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface AdPagedCollection { - - /** A list of ads contained on this page from the paginated response. */ - ads?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for an ad ID and its associated URL. */ - export interface AdReference { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** The URI of an ad. You can use this URI to retrieve the ad. */ - href?: string | null; - } - - - /** This type is a container for a list of ad IDs and their associated URIs. */ - export interface AdReferences { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines the fields returned in an ad response. */ - export interface AdResponse { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** An array of errors associated with the request. */ - errors?: Array; - - /** The URI that points to the ad. */ - href?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields returned in an error condition. */ - export interface Error { - - /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** The name of the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ - longMessage?: string | null; - - /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ - message?: string | null; - - /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** A name/value pair that provides parameter details regarding a warning or error condition. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** The value that was set for the element specified in the name field. */ - value?: string | null; - } - - - /** This type defines the container for an array of ads. */ - export interface Ads { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - export interface Amount { - - /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ - value?: string | null; - } - - - /** This type defines the fields for any warning error messages. */ - export interface BaseResponse { - - /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ - warnings?: Array; - } - - - /** This type defines the fields for the create ads in bulk response. */ - export interface BulkAdResponse { - - /** A list of ads processed by the call. */ - responses?: Array; - } - - - /** This type defines the fields for the create ads in bulk by listing IDs. */ - export interface BulkCreateAdRequest { - - /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ - requests?: Array; - } - - - /** This type defines the fields for the create ad request. */ - export interface CreateAdRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ - export interface BulkCreateAdsByInventoryReferenceRequest { - - /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to create ads by inventory reference ID request. */ - export interface CreateAdsByInventoryReferenceRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ - export interface BulkCreateAdsByInventoryReferenceResponse { - - /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ - responses?: Array; - } - - - /** This type defines the fields returned when you create an ad by inventory reference ID. */ - export interface CreateAdsByInventoryReferenceResponse { - - /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ - ads?: Array; - - /** An array of errors or warnings associated with the create-ads request. */ - errors?: Array; - - /** The seller's inventory reference ID that's associated with the ad. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that the call uses to remove ads in bulk. */ - export interface BulkDeleteAdRequest { - - /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - requests?: Array; - } - - - /** This type defines the fields used in a delete-ad request. */ - export interface DeleteAdRequest { - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ - export interface BulkDeleteAdResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned in a delete-ad response. */ - export interface DeleteAdResponse { - - /** The ID of the ad that was deleted. */ - adId?: string | null; - - /** An array of the errors or warnings associated with the request. */ - errors?: Array; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ - export interface BulkDeleteAdsByInventoryReferenceRequest { - - /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ - export interface DeleteAdsByInventoryReferenceRequest { - - /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ - export interface BulkDeleteAdsByInventoryReferenceResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ - export interface DeleteAdsByInventoryReferenceResponse { - - /** The list of ad IDs that were removed from the campaign. */ - adIds?: Array; - - /** The container for the errors associated with the request. */ - errors?: Array; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that describe an ad campaign. */ - export interface Campaign { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ - campaignId?: string | null; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ - campaignStatus?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - export interface CampaignCriterion { - - /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ - criterionType?: string | null; - - /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ - selectionRules?: Array; - } - - - /** This type specifies the selection rules used to create a campaign. */ - export interface SelectionRule { - - /** A list of the brands of the items to be included in the campaign. */ - brands?: Array; - - /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ - categoryIds?: Array; - - /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ - categoryScope?: string | null; - - /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ - listingConditionIds?: Array; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - maxPrice?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minPrice?: Amount; - } - - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - export interface FundingStrategy { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ - fundingModel?: string | null; - } - - - /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface CampaignPagedCollection { - - /** A list of campaigns contained on this page from the paginated response. */ - campaigns?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type contains a list of campaigns. */ - export interface Campaigns { - - /** An array of campaigns and their details. */ - campaigns?: Array; - } - - - /** This type defines the fields needed for a clone-campaign request. */ - export interface CloneCampaignRequest { - - /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ - export interface CreateCampaignRequest { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ - export interface CreateReportTask { - - /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ - dimensions?: Array; - - /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ - inventoryReferences?: Array; - - /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ - listingIds?: Array; - - /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ - metricKeys?: Array; - - /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ - export interface Dimension { - - /** A list of annotations associated with the dimension of the report. */ - annotationKeys?: Array; - - /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ - dimensionKey?: string | null; - } - - - /** This type defines the fields contained in an inventory reference ID. */ - export interface InventoryReference { - - /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ - inventoryReferenceId?: string | null; - - /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ - export interface DimensionKeyAnnotation { - - /** An annotation key associated with the dimension. */ - annotationKey?: string | null; - - /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - } - - - /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ - export interface DimensionMetadata { - - /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the dimension used to create the report. */ - dimensionKey?: string | null; - - /** An list of annotation keys associated with the specified dimension of the report. */ - dimensionKeyAnnotations?: Array; - } - - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - export interface DiscountBenefit { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffItem?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffOrder?: Amount; - - /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ - percentageOffItem?: string | null; - - /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ - percentageOffOrder?: string | null; - } - - - /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ - export interface DiscountRule { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountSpecification?: DiscountSpecification; - - /** - * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - export interface DiscountSpecification { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - forEachAmount?: Amount; - - /** - * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - forEachQuantity?: number | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minAmount?: Amount; - - /** - * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - minQuantity?: number | null; - - /** - * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfDiscountedItems?: number | null; - } - - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - export interface InventoryCriterion { - - /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ - inventoryCriterionType?: string | null; - - /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ - inventoryItems?: Array; - - /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ - listingIds?: Array; - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - ruleCriteria?: RuleCriteria; - } - - - /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ - export interface InventoryItem { - - /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ - inventoryReferenceId?: string | null; - } - - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - export interface RuleCriteria { - - /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeInventoryItems?: Array; - - /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeListingIds?: Array; - - /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ - markupInventoryItems?: Array; - - /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ - markupListingIds?: Array; - - /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ - selectionRules?: Array; - } - - - /** This type defines the fields used to describe an item price markdown promotion. */ - export interface ItemPriceMarkdown { - - /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ - applyFreeShipping?: boolean | null; - - /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ - blockPriceIncreaseInItemRevision?: boolean | null; - - /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ - selectedInventoryDiscounts?: Array; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ - export interface SelectedInventoryDiscount { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ - discountId?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** - * For markdown promotions, this field is reserved for future use. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ - export interface ItemPromotion { - - /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This complex type defines the fields returned for a promotion. */ - export interface ItemPromotionResponse { - - /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the name and data type of a metric. */ - export interface MetricMetadata { - - /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the metric. */ - metricKey?: string | null; - } - - - /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ - export interface PromotionDetail { - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** The URI of the promotion details. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields in a promotion-level report. */ - export interface PromotionReportDetail { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemRevenue?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderRevenue?: Amount; - - /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ - averageOrderSize?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** - * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemsSoldQuantity?: number | null; - - /** - * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfOrdersSold?: number | null; - - /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ - percentageSalesLift?: string | null; - - /** The URI of the promotion report. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ - promotionReportId?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ - promotions?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsReportPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list of promotionReports contained in the paginated result set. */ - promotionReports?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields included in the report. */ - export interface ReportMetadata { - - /** A list containing the metadata for the dimension used in the report. */ - dimensionMetadata?: Array; - - /** - * The maximum number of dimensions that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfDimensionsToRequest?: number | null; - - /** - * The maximum number of metrics that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfMetricsToRequest?: number | null; - - /** A list containing the metadata for the metrics in the report. */ - metricMetadata?: Array; - - /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the metadata used by the all report types. */ - export interface ReportMetadatas { - - /** A list of the metadata for the associated report type. */ - reportMetadata?: Array; - } - - - /** This type defines the fields in a report task. */ - export interface ReportTask { - - /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** A list containing the dimension in the report. */ - dimensions?: Array; - - /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ - inventoryReferences?: Array; - - /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingIds?: Array; - - /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A list of metrics for the report task. */ - metricKeys?: Array; - - /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportExpirationDate?: string | null; - - /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The URL of the generated report, which can be used to download the report once it has been generated. */ - reportHref?: string | null; - - /** A unique eBay-assigned ID for the report. */ - reportId?: string | null; - - /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ - reportName?: string | null; - - /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCompletionDate?: string | null; - - /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCreationDate?: string | null; - - /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskExpectedCompletionDate?: string | null; - - /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ - reportTaskId?: string | null; - - /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ - reportTaskStatus?: string | null; - - /** A status message with additional information about the report task. */ - reportTaskStatusMessage?: string | null; - - /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface ReportTaskPagedCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** A list of report tasks contained on this page from the paginated response. */ - reportTasks?: Array; - } - - - /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ - export interface SummaryReportResponse { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** The date the report was generated. */ - lastUpdated?: string | null; - - /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ - percentageSalesLift?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type specifies the bid percentage for an ad campaign. */ - export interface UpdateBidPercentageRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - } - - - /** This type specifies the updated name, and start and end dates for an update-campaign request. */ - export interface UpdateCampaignIdentificationRequest { - - /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ - campaignName?: string | null; - - /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ - startDate?: string | null; - } - - export class AdClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @return {BulkAdResponse} Success - */ - BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. - * @return {BulkDeleteAdsByInventoryReferenceResponse} Success - */ - BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Promise { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. - * @return {BulkDeleteAdResponse} Success - */ - BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Promise { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. - * @return {BulkAdResponse} Success - */ - BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {AdPagedCollection} Success - */ - GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. - * @return {void} - */ - CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. - * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. - * @return {void} - */ - CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. - * Get ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Ad} Success - */ - GetAd(ad_id: string, campaign_id: string): Promise { - return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. - * Delete ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteAd(ad_id: string, campaign_id: string): Promise> { - return Axios.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { responseType: 'text' }); - } - - /** - * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. - * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. - * @return {AdIds} Success - */ - DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Promise { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. - * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. - * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. - * @return {Ads} Success - */ - GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Promise { - return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. - * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid - * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. - * @return {void} - */ - UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class CampaignClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). - * Post ad_campaign/{campaign_id}/clone - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. - * @return {void} - */ - CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign - * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name - * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status - * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. - * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. - * @return {CampaignPagedCollection} Success - */ - GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. - * Post ad_campaign - * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. - * @return {void} - */ - CreateCampaign(requestBody: CreateCampaignRequest): Promise> { - return Axios.post(this.baseUri + 'ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Campaign} Success - */ - GetCampaign(campaign_id: string): Promise { - return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Delete ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteCampaign(campaign_id: string): Promise> { - return Axios.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { responseType: 'text' }); - } - - /** - * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/end - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - EndCampaign(campaign_id: string): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, { responseType: 'text' }); - } - - /** - * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/find_campaign_by_ad_reference - * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} listing_id Identifier of the eBay listing associated with the ad. - * @return {Campaigns} Success - */ - FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/get_campaign_by_name - * @param {string} campaign_name Name of the campaign. - * @return {Campaign} Success - */ - GetCampaignByName(campaign_name: string): Promise { - return Axios.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/pause - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - PauseCampaign(campaign_id: string): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, { responseType: 'text' }); - } - - /** - * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/resume - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - ResumeCampaign(campaign_id: string): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, { responseType: 'text' }); - } - - /** - * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. - * Post ad_campaign/{campaign_id}/update_campaign_identification - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. - * @return {void} - */ - UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Promise> { - return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - - export class Ad_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. - * Get ad_report/{report_id} - * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. - * @return {void} Success - */ - GetReport(report_id: string): Promise> { - return Axios.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { responseType: 'text' }); - } - } - - export class Ad_report_metadataClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. - * Get ad_report_metadata - * @return {ReportMetadatas} Success - */ - GetReportMetadata(): Promise { - return Axios.get(this.baseUri + 'ad_report_metadata', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. - * Get ad_report_metadata/{report_type} - * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT - * @return {ReportMetadata} Success - */ - GetReportMetadataForReportType(report_type: string): Promise { - return Axios.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Ad_report_taskClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. - * Get ad_report_task - * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 - * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED - * @return {ReportTaskPagedCollection} Success - */ - GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. - * Post ad_report_task - * @param {CreateReportTask} requestBody The container for the fields that define the report task. - * @return {void} - */ - CreateReportTask(requestBody: CreateReportTask): Promise> { - return Axios.post(this.baseUri + 'ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Get ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {ReportTask} Success - */ - GetReportTask(report_task_id: string): Promise { - return Axios.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Delete ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {void} - */ - DeleteReportTask(report_task_id: string): Promise> { - return Axios.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { responseType: 'text' }); - } - } - - export class Item_price_markdownClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. - * Post item_price_markdown - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {void} - */ - CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Promise> { - return Axios.post(this.baseUri + 'item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPriceMarkdown} Success - */ - GetItemPriceMarkdownPromotion(promotion_id: string): Promise { - return Axios.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. - * Put item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {string} Success - */ - UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Promise { - return Axios.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. - * Delete item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPriceMarkdownPromotion(promotion_id: string): Promise> { - return Axios.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { responseType: 'text' }); - } - } - - export class Item_promotionClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. - * Post item_promotion - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {void} - */ - CreateItemPromotion(requestBody: ItemPromotion): Promise> { - return Axios.post(this.baseUri + 'item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPromotionResponse} Success - */ - GetItemPromotion(promotion_id: string): Promise { - return Axios.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. - * Put item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {BaseResponse} Success - */ - UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Promise { - return Axios.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. - * Delete item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPromotion(promotion_id: string): Promise> { - return Axios.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { responseType: 'text' }); - } - } - - export class PromotionClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 - * Get promotion/{promotion_id}/get_listing_set - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {string} q Reserved for future use. - * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html - * @return {void} - */ - GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Promise> { - return Axios.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { responseType: 'text' }); - } - - /** - * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 - * Get promotion - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 - * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @return {PromotionsPagedCollection} Success - */ - GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). - * Post promotion/{promotion_id}/pause - * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - PausePromotion(promotion_id: string): Promise> { - return Axios.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, { responseType: 'text' }); - } - - /** - * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. - * Post promotion/{promotion_id}/resume - * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - ResumePromotion(promotion_id: string): Promise> { - return Axios.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, { responseType: 'text' }); - } - } - - export class Promotion_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. - * Get promotion_report - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 - * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @return {PromotionsReportPagedCollection} Success - */ - GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class Promotion_summary_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. - * Get promotion_summary_report - * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @return {SummaryReportResponse} Success - */ - GetPromotionSummaryReport(marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** This type defines the fields for an ad. */ + export interface Ad { + + /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ + adId?: string | null; + + /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type is a container for a list of ad IDs. */ + export interface AdIds { + + /** A list of ad ID's. */ + adIds?: Array; + } + + + /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface AdPagedCollection { + + /** A list of ads contained on this page from the paginated response. */ + ads?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for an ad ID and its associated URL. */ + export interface AdReference { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** The URI of an ad. You can use this URI to retrieve the ad. */ + href?: string | null; + } + + + /** This type is a container for a list of ad IDs and their associated URIs. */ + export interface AdReferences { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines the fields returned in an ad response. */ + export interface AdResponse { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** An array of errors associated with the request. */ + errors?: Array; + + /** The URI that points to the ad. */ + href?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields returned in an error condition. */ + export interface Error { + + /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** The name of the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ + longMessage?: string | null; + + /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ + message?: string | null; + + /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** A name/value pair that provides parameter details regarding a warning or error condition. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** The value that was set for the element specified in the name field. */ + value?: string | null; + } + + + /** This type defines the container for an array of ads. */ + export interface Ads { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + export interface Amount { + + /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ + value?: string | null; + } + + + /** This type defines the fields for any warning error messages. */ + export interface BaseResponse { + + /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ + warnings?: Array; + } + + + /** This type defines the fields for the create ads in bulk response. */ + export interface BulkAdResponse { + + /** A list of ads processed by the call. */ + responses?: Array; + } + + + /** This type defines the fields for the create ads in bulk by listing IDs. */ + export interface BulkCreateAdRequest { + + /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ + requests?: Array; + } + + + /** This type defines the fields for the create ad request. */ + export interface CreateAdRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ + export interface BulkCreateAdsByInventoryReferenceRequest { + + /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to create ads by inventory reference ID request. */ + export interface CreateAdsByInventoryReferenceRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ + export interface BulkCreateAdsByInventoryReferenceResponse { + + /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ + responses?: Array; + } + + + /** This type defines the fields returned when you create an ad by inventory reference ID. */ + export interface CreateAdsByInventoryReferenceResponse { + + /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ + ads?: Array; + + /** An array of errors or warnings associated with the create-ads request. */ + errors?: Array; + + /** The seller's inventory reference ID that's associated with the ad. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that the call uses to remove ads in bulk. */ + export interface BulkDeleteAdRequest { + + /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + requests?: Array; + } + + + /** This type defines the fields used in a delete-ad request. */ + export interface DeleteAdRequest { + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ + export interface BulkDeleteAdResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned in a delete-ad response. */ + export interface DeleteAdResponse { + + /** The ID of the ad that was deleted. */ + adId?: string | null; + + /** An array of the errors or warnings associated with the request. */ + errors?: Array; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ + export interface BulkDeleteAdsByInventoryReferenceRequest { + + /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ + export interface DeleteAdsByInventoryReferenceRequest { + + /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ + export interface BulkDeleteAdsByInventoryReferenceResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ + export interface DeleteAdsByInventoryReferenceResponse { + + /** The list of ad IDs that were removed from the campaign. */ + adIds?: Array; + + /** The container for the errors associated with the request. */ + errors?: Array; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that describe an ad campaign. */ + export interface Campaign { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ + campaignId?: string | null; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ + campaignStatus?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + export interface CampaignCriterion { + + /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ + criterionType?: string | null; + + /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ + selectionRules?: Array; + } + + + /** This type specifies the selection rules used to create a campaign. */ + export interface SelectionRule { + + /** A list of the brands of the items to be included in the campaign. */ + brands?: Array; + + /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ + categoryIds?: Array; + + /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ + categoryScope?: string | null; + + /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ + listingConditionIds?: Array; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + maxPrice?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minPrice?: Amount; + } + + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + export interface FundingStrategy { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ + fundingModel?: string | null; + } + + + /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface CampaignPagedCollection { + + /** A list of campaigns contained on this page from the paginated response. */ + campaigns?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type contains a list of campaigns. */ + export interface Campaigns { + + /** An array of campaigns and their details. */ + campaigns?: Array; + } + + + /** This type defines the fields needed for a clone-campaign request. */ + export interface CloneCampaignRequest { + + /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ + export interface CreateCampaignRequest { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ + export interface CreateReportTask { + + /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ + dimensions?: Array; + + /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ + inventoryReferences?: Array; + + /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ + listingIds?: Array; + + /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ + metricKeys?: Array; + + /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ + export interface Dimension { + + /** A list of annotations associated with the dimension of the report. */ + annotationKeys?: Array; + + /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ + dimensionKey?: string | null; + } + + + /** This type defines the fields contained in an inventory reference ID. */ + export interface InventoryReference { + + /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ + inventoryReferenceId?: string | null; + + /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ + export interface DimensionKeyAnnotation { + + /** An annotation key associated with the dimension. */ + annotationKey?: string | null; + + /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + } + + + /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ + export interface DimensionMetadata { + + /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the dimension used to create the report. */ + dimensionKey?: string | null; + + /** An list of annotation keys associated with the specified dimension of the report. */ + dimensionKeyAnnotations?: Array; + } + + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + export interface DiscountBenefit { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffItem?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffOrder?: Amount; + + /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ + percentageOffItem?: string | null; + + /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ + percentageOffOrder?: string | null; + } + + + /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ + export interface DiscountRule { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountSpecification?: DiscountSpecification; + + /** + * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + export interface DiscountSpecification { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + forEachAmount?: Amount; + + /** + * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + forEachQuantity?: number | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minAmount?: Amount; + + /** + * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + minQuantity?: number | null; + + /** + * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfDiscountedItems?: number | null; + } + + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + export interface InventoryCriterion { + + /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ + inventoryCriterionType?: string | null; + + /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ + inventoryItems?: Array; + + /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ + listingIds?: Array; + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + ruleCriteria?: RuleCriteria; + } + + + /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ + export interface InventoryItem { + + /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ + inventoryReferenceId?: string | null; + } + + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + export interface RuleCriteria { + + /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeInventoryItems?: Array; + + /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeListingIds?: Array; + + /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ + markupInventoryItems?: Array; + + /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ + markupListingIds?: Array; + + /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ + selectionRules?: Array; + } + + + /** This type defines the fields used to describe an item price markdown promotion. */ + export interface ItemPriceMarkdown { + + /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ + applyFreeShipping?: boolean | null; + + /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ + blockPriceIncreaseInItemRevision?: boolean | null; + + /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ + selectedInventoryDiscounts?: Array; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ + export interface SelectedInventoryDiscount { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ + discountId?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** + * For markdown promotions, this field is reserved for future use. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ + export interface ItemPromotion { + + /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This complex type defines the fields returned for a promotion. */ + export interface ItemPromotionResponse { + + /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the name and data type of a metric. */ + export interface MetricMetadata { + + /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the metric. */ + metricKey?: string | null; + } + + + /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ + export interface PromotionDetail { + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** The URI of the promotion details. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields in a promotion-level report. */ + export interface PromotionReportDetail { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemRevenue?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderRevenue?: Amount; + + /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ + averageOrderSize?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** + * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemsSoldQuantity?: number | null; + + /** + * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfOrdersSold?: number | null; + + /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ + percentageSalesLift?: string | null; + + /** The URI of the promotion report. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ + promotionReportId?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ + promotions?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsReportPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list of promotionReports contained in the paginated result set. */ + promotionReports?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields included in the report. */ + export interface ReportMetadata { + + /** A list containing the metadata for the dimension used in the report. */ + dimensionMetadata?: Array; + + /** + * The maximum number of dimensions that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfDimensionsToRequest?: number | null; + + /** + * The maximum number of metrics that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfMetricsToRequest?: number | null; + + /** A list containing the metadata for the metrics in the report. */ + metricMetadata?: Array; + + /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the metadata used by the all report types. */ + export interface ReportMetadatas { + + /** A list of the metadata for the associated report type. */ + reportMetadata?: Array; + } + + + /** This type defines the fields in a report task. */ + export interface ReportTask { + + /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** A list containing the dimension in the report. */ + dimensions?: Array; + + /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ + inventoryReferences?: Array; + + /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingIds?: Array; + + /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A list of metrics for the report task. */ + metricKeys?: Array; + + /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportExpirationDate?: string | null; + + /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The URL of the generated report, which can be used to download the report once it has been generated. */ + reportHref?: string | null; + + /** A unique eBay-assigned ID for the report. */ + reportId?: string | null; + + /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ + reportName?: string | null; + + /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCompletionDate?: string | null; + + /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCreationDate?: string | null; + + /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskExpectedCompletionDate?: string | null; + + /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ + reportTaskId?: string | null; + + /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ + reportTaskStatus?: string | null; + + /** A status message with additional information about the report task. */ + reportTaskStatusMessage?: string | null; + + /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface ReportTaskPagedCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** A list of report tasks contained on this page from the paginated response. */ + reportTasks?: Array; + } + + + /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ + export interface SummaryReportResponse { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** The date the report was generated. */ + lastUpdated?: string | null; + + /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ + percentageSalesLift?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type specifies the bid percentage for an ad campaign. */ + export interface UpdateBidPercentageRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + } + + + /** This type specifies the updated name, and start and end dates for an update-campaign request. */ + export interface UpdateCampaignIdentificationRequest { + + /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ + campaignName?: string | null; + + /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ + startDate?: string | null; + } + + export class AdClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @return {BulkAdResponse} Success + */ + BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. + * @return {BulkDeleteAdsByInventoryReferenceResponse} Success + */ + BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Promise { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. + * @return {BulkDeleteAdResponse} Success + */ + BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Promise { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. + * @return {BulkAdResponse} Success + */ + BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {AdPagedCollection} Success + */ + GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. + * @return {void} + */ + CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. + * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. + * @return {void} + */ + CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. + * Get ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Ad} Success + */ + GetAd(ad_id: string, campaign_id: string): Promise { + return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. + * Delete ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteAd(ad_id: string, campaign_id: string): Promise> { + return Axios.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { responseType: 'text' }); + } + + /** + * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. + * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. + * @return {AdIds} Success + */ + DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Promise { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. + * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. + * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. + * @return {Ads} Success + */ + GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Promise { + return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. + * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid + * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. + * @return {void} + */ + UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class CampaignClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). + * Post ad_campaign/{campaign_id}/clone + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. + * @return {void} + */ + CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign + * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name + * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status + * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. + * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. + * @return {CampaignPagedCollection} Success + */ + GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. + * Post ad_campaign + * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. + * @return {void} + */ + CreateCampaign(requestBody: CreateCampaignRequest): Promise> { + return Axios.post(this.baseUri + 'ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Campaign} Success + */ + GetCampaign(campaign_id: string): Promise { + return Axios.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Delete ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteCampaign(campaign_id: string): Promise> { + return Axios.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { responseType: 'text' }); + } + + /** + * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/end + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + EndCampaign(campaign_id: string): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, { responseType: 'text' }); + } + + /** + * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/find_campaign_by_ad_reference + * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} listing_id Identifier of the eBay listing associated with the ad. + * @return {Campaigns} Success + */ + FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/get_campaign_by_name + * @param {string} campaign_name Name of the campaign. + * @return {Campaign} Success + */ + GetCampaignByName(campaign_name: string): Promise { + return Axios.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/pause + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + PauseCampaign(campaign_id: string): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, { responseType: 'text' }); + } + + /** + * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/resume + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + ResumeCampaign(campaign_id: string): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, { responseType: 'text' }); + } + + /** + * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. + * Post ad_campaign/{campaign_id}/update_campaign_identification + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. + * @return {void} + */ + UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Promise> { + return Axios.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + + export class Ad_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. + * Get ad_report/{report_id} + * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. + * @return {void} Success + */ + GetReport(report_id: string): Promise> { + return Axios.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { responseType: 'text' }); + } + } + + export class Ad_report_metadataClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. + * Get ad_report_metadata + * @return {ReportMetadatas} Success + */ + GetReportMetadata(): Promise { + return Axios.get(this.baseUri + 'ad_report_metadata', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. + * Get ad_report_metadata/{report_type} + * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT + * @return {ReportMetadata} Success + */ + GetReportMetadataForReportType(report_type: string): Promise { + return Axios.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Ad_report_taskClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. + * Get ad_report_task + * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 + * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED + * @return {ReportTaskPagedCollection} Success + */ + GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. + * Post ad_report_task + * @param {CreateReportTask} requestBody The container for the fields that define the report task. + * @return {void} + */ + CreateReportTask(requestBody: CreateReportTask): Promise> { + return Axios.post(this.baseUri + 'ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Get ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {ReportTask} Success + */ + GetReportTask(report_task_id: string): Promise { + return Axios.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Delete ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {void} + */ + DeleteReportTask(report_task_id: string): Promise> { + return Axios.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { responseType: 'text' }); + } + } + + export class Item_price_markdownClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. + * Post item_price_markdown + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {void} + */ + CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Promise> { + return Axios.post(this.baseUri + 'item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPriceMarkdown} Success + */ + GetItemPriceMarkdownPromotion(promotion_id: string): Promise { + return Axios.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. + * Put item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {string} Success + */ + UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Promise { + return Axios.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. + * Delete item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPriceMarkdownPromotion(promotion_id: string): Promise> { + return Axios.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { responseType: 'text' }); + } + } + + export class Item_promotionClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. + * Post item_promotion + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {void} + */ + CreateItemPromotion(requestBody: ItemPromotion): Promise> { + return Axios.post(this.baseUri + 'item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPromotionResponse} Success + */ + GetItemPromotion(promotion_id: string): Promise { + return Axios.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. + * Put item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {BaseResponse} Success + */ + UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Promise { + return Axios.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. + * Delete item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPromotion(promotion_id: string): Promise> { + return Axios.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { responseType: 'text' }); + } + } + + export class PromotionClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 + * Get promotion/{promotion_id}/get_listing_set + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {string} q Reserved for future use. + * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html + * @return {void} + */ + GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Promise> { + return Axios.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { responseType: 'text' }); + } + + /** + * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 + * Get promotion + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 + * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @return {PromotionsPagedCollection} Success + */ + GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). + * Post promotion/{promotion_id}/pause + * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + PausePromotion(promotion_id: string): Promise> { + return Axios.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, { responseType: 'text' }); + } + + /** + * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. + * Post promotion/{promotion_id}/resume + * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + ResumePromotion(promotion_id: string): Promise> { + return Axios.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, { responseType: 'text' }); + } + } + + export class Promotion_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. + * Get promotion_report + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 + * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @return {PromotionsReportPagedCollection} Success + */ + GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class Promotion_summary_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. + * Get promotion_summary_report + * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @return {SummaryReportResponse} Success + */ + GetPromotionSummaryReport(marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_metadata.txt b/Tests/SwagTsTests/AxiosResults/sell_metadata.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/sell_metadata.txt rename to Tests/SwagTsTests/AxiosResults/sell_metadata.ts index 135b9c3b..5bb1f778 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_metadata.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_metadata.ts @@ -1,364 +1,364 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** A unique ID for a sales tax jurisdiction. */ - export interface SalesTaxJurisdiction { - - /** The unique ID for a sales tax jurisdiction. */ - salesTaxJurisdictionId?: string | null; - } - - - /** This complex type contains a list of sales tax jurisdictions. */ - export interface SalesTaxJurisdictions { - - /** A list of sales tax jurisdictions. */ - salesTaxJurisdictions?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An amount of time, as measured by the time-measurement units specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for a error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - export interface AutomotivePartsCompatibilityPolicy { - - /** The category ID to which the automotive-parts-compatibility policies apply. */ - categoryId?: string | null; - - /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ - compatibilityBasedOn?: string | null; - - /** Indicates the compatibility classification of the part based on high-level vehicle types. */ - compatibleVehicleTypes?: Array; - - /** - * Specifies the maximum number of compatible vehicle-applications allowed per item. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfCompatibleVehicles?: number | null; - } - - export interface AutomotivePartsCompatibilityPolicyResponse { - - /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ - automotivePartsCompatibilityPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - export interface Exclusion { - - /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ - brands?: Array; - } - - export interface ItemCondition { - - /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ - conditionDescription?: string | null; - - /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ - conditionId?: string | null; - } - - export interface ItemConditionPolicy { - - /** The category ID to which the item-condition policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ - itemConditionRequired?: boolean | null; - - /** The item-condition values allowed in the category. */ - itemConditions?: Array; - } - - export interface ItemConditionPolicyResponse { - - /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ - itemConditionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ListingStructurePolicy { - - /** The category ID to which the listing-structure policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ - variationsSupported?: boolean | null; - } - - export interface ListingStructurePolicyResponse { - - /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ - listingStructurePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface NegotiatedPricePolicy { - - /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ - bestOfferAutoAcceptEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ - bestOfferAutoDeclineEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ - bestOfferCounterEnabled?: boolean | null; - - /** The category ID to which the negotiated-price policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - } - - export interface NegotiatedPricePolicyResponse { - - /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ - negotiatedPricePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ - export interface ProductAdoptionPolicy { - - /** The category ID to which the listing policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - exclusion?: Exclusion; - - /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ - productRequired?: boolean | null; - } - - - /** This is the response object returned by a call to getProductAdoptionPolicies. */ - export interface ProductAdoptionPolicyResponse { - - /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ - productAdoptionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ReturnPolicy { - - /** The category ID to which the return policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - domestic?: ReturnPolicyDetails; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - international?: ReturnPolicyDetails; - - /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ - required?: boolean | null; - } - - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - export interface ReturnPolicyDetails { - - /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ - policyDescriptionEnabled?: boolean | null; - - /** A list of refund methods allowed for the associated category. */ - refundMethods?: Array; - - /** A list of return methods allowed for the associated category. */ - returnMethods?: Array; - - /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ - returnPeriods?: Array; - - /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ - returnsAcceptanceEnabled?: boolean | null; - - /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ - returnShippingCostPayers?: Array; - } - - export interface ReturnPolicyResponse { - - /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ - returnPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export class CountryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. - * Get country/{countryCode}/sales_tax_jurisdiction - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. - * @return {SalesTaxJurisdictions} Success - */ - GetSalesTaxJurisdictions(countryCode: string): Promise { - return Axios.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - - export class MarketplaceClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT - * @return {AutomotivePartsCompatibilityPolicyResponse} Success - */ - GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_item_condition_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ItemConditionPolicyResponse} Success - */ - GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_listing_structure_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ListingStructurePolicyResponse} Success - */ - GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_negotiated_price_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {NegotiatedPricePolicyResponse} Success - */ - GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_product_adoption_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ProductAdoptionPolicyResponse} Success - */ - GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_return_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** A unique ID for a sales tax jurisdiction. */ + export interface SalesTaxJurisdiction { + + /** The unique ID for a sales tax jurisdiction. */ + salesTaxJurisdictionId?: string | null; + } + + + /** This complex type contains a list of sales tax jurisdictions. */ + export interface SalesTaxJurisdictions { + + /** A list of sales tax jurisdictions. */ + salesTaxJurisdictions?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An amount of time, as measured by the time-measurement units specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for a error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + export interface AutomotivePartsCompatibilityPolicy { + + /** The category ID to which the automotive-parts-compatibility policies apply. */ + categoryId?: string | null; + + /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ + compatibilityBasedOn?: string | null; + + /** Indicates the compatibility classification of the part based on high-level vehicle types. */ + compatibleVehicleTypes?: Array; + + /** + * Specifies the maximum number of compatible vehicle-applications allowed per item. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfCompatibleVehicles?: number | null; + } + + export interface AutomotivePartsCompatibilityPolicyResponse { + + /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ + automotivePartsCompatibilityPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + export interface Exclusion { + + /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ + brands?: Array; + } + + export interface ItemCondition { + + /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ + conditionDescription?: string | null; + + /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ + conditionId?: string | null; + } + + export interface ItemConditionPolicy { + + /** The category ID to which the item-condition policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ + itemConditionRequired?: boolean | null; + + /** The item-condition values allowed in the category. */ + itemConditions?: Array; + } + + export interface ItemConditionPolicyResponse { + + /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ + itemConditionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ListingStructurePolicy { + + /** The category ID to which the listing-structure policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ + variationsSupported?: boolean | null; + } + + export interface ListingStructurePolicyResponse { + + /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ + listingStructurePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface NegotiatedPricePolicy { + + /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ + bestOfferAutoAcceptEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ + bestOfferAutoDeclineEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ + bestOfferCounterEnabled?: boolean | null; + + /** The category ID to which the negotiated-price policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + } + + export interface NegotiatedPricePolicyResponse { + + /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ + negotiatedPricePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ + export interface ProductAdoptionPolicy { + + /** The category ID to which the listing policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + exclusion?: Exclusion; + + /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ + productRequired?: boolean | null; + } + + + /** This is the response object returned by a call to getProductAdoptionPolicies. */ + export interface ProductAdoptionPolicyResponse { + + /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ + productAdoptionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ReturnPolicy { + + /** The category ID to which the return policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + domestic?: ReturnPolicyDetails; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + international?: ReturnPolicyDetails; + + /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ + required?: boolean | null; + } + + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + export interface ReturnPolicyDetails { + + /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ + policyDescriptionEnabled?: boolean | null; + + /** A list of refund methods allowed for the associated category. */ + refundMethods?: Array; + + /** A list of return methods allowed for the associated category. */ + returnMethods?: Array; + + /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ + returnPeriods?: Array; + + /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ + returnsAcceptanceEnabled?: boolean | null; + + /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ + returnShippingCostPayers?: Array; + } + + export interface ReturnPolicyResponse { + + /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ + returnPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export class CountryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. + * Get country/{countryCode}/sales_tax_jurisdiction + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. + * @return {SalesTaxJurisdictions} Success + */ + GetSalesTaxJurisdictions(countryCode: string): Promise { + return Axios.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + + export class MarketplaceClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT + * @return {AutomotivePartsCompatibilityPolicyResponse} Success + */ + GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_item_condition_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ItemConditionPolicyResponse} Success + */ + GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_listing_structure_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ListingStructurePolicyResponse} Success + */ + GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_negotiated_price_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {NegotiatedPricePolicyResponse} Success + */ + GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_product_adoption_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ProductAdoptionPolicyResponse} Success + */ + GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_return_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return Axios.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_negotiation.txt b/Tests/SwagTsTests/AxiosResults/sell_negotiation.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/sell_negotiation.txt rename to Tests/SwagTsTests/AxiosResults/sell_negotiation.ts index 1053524a..2968ad74 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_negotiation.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_negotiation.ts @@ -1,237 +1,237 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ - export interface CreateOffersRequest { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ - allowCounterOffer?: boolean | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ - offeredItems?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A complex type that defines the offer being made to an "interested" buyer. */ - export interface OfferedItem { - - /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ - discountPercentage?: string | null; - - /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ - listingId?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - price?: Amount; - - /** - * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ - export interface EligibleItem { - - /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ - listingId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** A complex type that defines an offer that a seller makes to eligible buyers. */ - export interface Offer { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ - allowCounterOffer?: boolean | null; - - /** This complex type identifies an eBay user. */ - buyer?: User; - - /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - creationDate?: string | null; - - /** The eBay UserName of the user (seller) who initiated the offer. */ - initiatedBy?: string | null; - - /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ - lastModifiedDate?: string | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ - offeredItems?: Array; - - /** A unique eBay-assigned identifier for the offer. */ - offerId?: string | null; - - /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ - offerStatus?: string | null; - - /** The type of offer being made. For implementation help, refer to eBay API documentation */ - offerType?: string | null; - - /** A unique, eBay-assigned ID for the revision of the offer. */ - revision?: string | null; - } - - - /** This complex type identifies an eBay user. */ - export interface User { - - /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ - maskedUsername?: string | null; - } - - - /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ - export interface PagedEligibleItemCollection { - - /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ - eligibleItems?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object returned from a SendOfferToInterestedBuyers request. */ - export interface SendOfferToInterestedBuyersCollectionResponse { - - /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ - offers?: Array; - } - - export class OfferClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Get find_eligible_items - * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 - * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {PagedEligibleItemCollection} Success - */ - FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Promise { - return Axios.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); - } - - /** - * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Post send_offer_to_interested_buyers - * @param {CreateOffersRequest} requestBody Send offer to eligible items request. - * @return {SendOfferToInterestedBuyersCollectionResponse} Success - */ - SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Promise { - return Axios.post(this.baseUri + 'send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ + export interface CreateOffersRequest { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ + allowCounterOffer?: boolean | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ + offeredItems?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A complex type that defines the offer being made to an "interested" buyer. */ + export interface OfferedItem { + + /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ + discountPercentage?: string | null; + + /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ + listingId?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + price?: Amount; + + /** + * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ + export interface EligibleItem { + + /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ + listingId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** A complex type that defines an offer that a seller makes to eligible buyers. */ + export interface Offer { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ + allowCounterOffer?: boolean | null; + + /** This complex type identifies an eBay user. */ + buyer?: User; + + /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + creationDate?: string | null; + + /** The eBay UserName of the user (seller) who initiated the offer. */ + initiatedBy?: string | null; + + /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ + lastModifiedDate?: string | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ + offeredItems?: Array; + + /** A unique eBay-assigned identifier for the offer. */ + offerId?: string | null; + + /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ + offerStatus?: string | null; + + /** The type of offer being made. For implementation help, refer to eBay API documentation */ + offerType?: string | null; + + /** A unique, eBay-assigned ID for the revision of the offer. */ + revision?: string | null; + } + + + /** This complex type identifies an eBay user. */ + export interface User { + + /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ + maskedUsername?: string | null; + } + + + /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ + export interface PagedEligibleItemCollection { + + /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ + eligibleItems?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object returned from a SendOfferToInterestedBuyers request. */ + export interface SendOfferToInterestedBuyersCollectionResponse { + + /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ + offers?: Array; + } + + export class OfferClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Get find_eligible_items + * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 + * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {PagedEligibleItemCollection} Success + */ + FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Promise { + return Axios.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}).then(d => {if (d.status<=204) return d.data; throw d;}); + } + + /** + * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Post send_offer_to_interested_buyers + * @param {CreateOffersRequest} requestBody Send offer to eligible items request. + * @return {SendOfferToInterestedBuyersCollectionResponse} Success + */ + SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Promise { + return Axios.post(this.baseUri + 'send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }).then(d => {if (d.status<=204) return d.data; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/AxiosResults/sell_recommendation.txt b/Tests/SwagTsTests/AxiosResults/sell_recommendation.ts similarity index 98% rename from Tests/SwagTsTests/AxiosResults/sell_recommendation.txt rename to Tests/SwagTsTests/AxiosResults/sell_recommendation.ts index 02eb5888..364853ce 100644 --- a/Tests/SwagTsTests/AxiosResults/sell_recommendation.txt +++ b/Tests/SwagTsTests/AxiosResults/sell_recommendation.ts @@ -1,161 +1,161 @@ -import Axios from 'axios'; -import { AxiosResponse } from 'axios'; -export namespace MyNS { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - export interface Ad { - - /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ - bidPercentages?: Array; - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - promoteWithAd?: PromoteWithAd; - } - - - /** A complex type that returns data related to Promoted Listings bid percentages. */ - export interface BidPercentages { - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - basis?: Basis; - - /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ - value?: string | null; - } - - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - export enum Basis { TRENDING = 0 } - - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ - export interface FindListingRecommendationRequest { - - /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ - listingIds?: Array; - } - - - /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ - export interface ListingRecommendation { - - /** An ID that identifies the active listing associated with the eBay recommendations. */ - listingId?: string | null; - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - marketing?: MarketingRecommendation; - } - - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - export interface MarketingRecommendation { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - ad?: Ad; - - /** A message that can conditionally accompany the listing information. */ - message?: string | null; - } - - - /** The high-level object used to return a set of Promoted Listings ad recommendations. */ - export interface PagedListingRecommendationCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ - listingRecommendations?: Array; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - export class Listing_recommendationClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. - * Post find - * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} - * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {void} Success - */ - FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Promise> { - return Axios.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - } - -} - +import Axios from 'axios'; +import { AxiosResponse } from 'axios'; +export namespace MyNS { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + export interface Ad { + + /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ + bidPercentages?: Array; + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + promoteWithAd?: PromoteWithAd; + } + + + /** A complex type that returns data related to Promoted Listings bid percentages. */ + export interface BidPercentages { + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + basis?: Basis; + + /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ + value?: string | null; + } + + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + export enum Basis { TRENDING = 0 } + + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ + export interface FindListingRecommendationRequest { + + /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ + listingIds?: Array; + } + + + /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ + export interface ListingRecommendation { + + /** An ID that identifies the active listing associated with the eBay recommendations. */ + listingId?: string | null; + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + marketing?: MarketingRecommendation; + } + + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + export interface MarketingRecommendation { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + ad?: Ad; + + /** A message that can conditionally accompany the listing information. */ + message?: string | null; + } + + + /** The high-level object used to return a set of Promoted Listings ad recommendations. */ + export interface PagedListingRecommendationCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ + listingRecommendations?: Array; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + export class Listing_recommendationClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. + * Post find + * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} + * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {void} Success + */ + FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Promise> { + return Axios.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/CodeGenAureliaTests.cs b/Tests/SwagTsTests/CodeGenAureliaTests.cs index a0522d10..4abeaab1 100644 --- a/Tests/SwagTsTests/CodeGenAureliaTests.cs +++ b/Tests/SwagTsTests/CodeGenAureliaTests.cs @@ -19,26 +19,26 @@ public CodeGenAureliaTests() [Fact] public void TestValuesPaths() { - helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "AureliaResults/ValuesPaths.txt"); + helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "AureliaResults/ValuesPaths.ts"); } [Fact] public void TestPetDelete() { - helper.GenerateAndAssert("SwagMock/PetDelete.json", "AureliaResults/PetDelete.txt"); + helper.GenerateAndAssert("SwagMock/PetDelete.json", "AureliaResults/PetDelete.ts"); } [Fact] public void TestPet() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "AureliaResults/Pet.txt"); + helper.GenerateAndAssert("SwagMock/pet.yaml", "AureliaResults/Pet.ts"); } [Fact] public void TestPetWithPathAsContainerName() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "AureliaResults/PetPathAsContainer.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml", "AureliaResults/PetPathAsContainer.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "Misc", @@ -51,7 +51,7 @@ public void TestPetWithPathAsContainerName() [Fact] public void TestPetWithGodContainerAndPathAction() { - helper.GenerateAndAssert("SwagMock/pet.yaml" , "AureliaResults/PetGodClass.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml" , "AureliaResults/PetGodClass.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.PathMethodQueryParameters, @@ -63,7 +63,7 @@ public void TestPetWithGodContainerAndPathAction() [Fact] public void TestPetFindByStatus() { - helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "AureliaResults/PetFindByStatus.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "AureliaResults/PetFindByStatus.ts", new Settings() { ClientNamespace = "MyNS", PathPrefixToRemove = "/api", @@ -76,13 +76,13 @@ public void TestPetFindByStatus() [Fact] public void TestPetStore() { - helper.GenerateAndAssert("SwagMock/petStore.yaml", "AureliaResults/PetStore.txt"); + helper.GenerateAndAssert("SwagMock/petStore.yaml", "AureliaResults/PetStore.ts"); } [Fact] public void TestPetStoreExpanded() { - helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "AureliaResults/PetStoreExpanded.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "AureliaResults/PetStoreExpanded.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -93,7 +93,7 @@ public void TestPetStoreExpanded() [Fact] public void TestUspto() { - helper.GenerateAndAssert("SwagMock/uspto.yaml" , "AureliaResults/Uspto.txt", new Settings() + helper.GenerateAndAssert("SwagMock/uspto.yaml" , "AureliaResults/Uspto.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -106,7 +106,7 @@ public void TestUspto() [Fact] public void TestMcp() { - helper.GenerateAndAssert("SwagMock/mcp.yaml", "AureliaResults/mcp.txt", new Settings() + helper.GenerateAndAssert("SwagMock/mcp.yaml", "AureliaResults/mcp.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "McpClient", @@ -120,73 +120,73 @@ public void TestMcp() [Fact] public void TestEBaySellAccount() { - helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "AureliaResults/sell_account.txt"); + helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "AureliaResults/sell_account.ts"); } [Fact] public void TestEBay_sell_analytics() { - helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "AureliaResults/sell_analytics.txt"); + helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "AureliaResults/sell_analytics.ts"); } [Fact] public void TestEBay_sell_compliance() { - helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "AureliaResults/sell_compliance.txt"); + helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "AureliaResults/sell_compliance.ts"); } [Fact] public void TestEBay_sell_finances() { - helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "AureliaResults/sell_finances.txt"); + helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "AureliaResults/sell_finances.ts"); } [Fact] public void TestEBay_sell_inventory() { - helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "AureliaResults/sell_inventory.txt"); + helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "AureliaResults/sell_inventory.ts"); } [Fact] public void TestEBay_sell_listing() { - helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "AureliaResults/sell_listing.txt"); + helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "AureliaResults/sell_listing.ts"); } [Fact] public void TestEBay_sell_logistics() { - helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "AureliaResults/sell_logistics.txt"); + helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "AureliaResults/sell_logistics.ts"); } [Fact] public void TestEBay_sell_negotiation() { - helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "AureliaResults/sell_negotiation.txt"); + helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "AureliaResults/sell_negotiation.ts"); } [Fact] public void TestEBay_sell_marketing() { - helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "AureliaResults/sell_marketing.txt"); + helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "AureliaResults/sell_marketing.ts"); } [Fact] public void TestEBay_sell_metadata() { - helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "AureliaResults/sell_metadata.txt"); + helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "AureliaResults/sell_metadata.ts"); } [Fact] public void TestEBay_sell_recommendation() { - helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "AureliaResults/sell_recommendation.txt"); + helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "AureliaResults/sell_recommendation.ts"); } [Fact] public void TestRedocOpenApi() { - helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "AureliaResults/redocOpenApi200501.txt"); + helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "AureliaResults/redocOpenApi200501.ts"); } } diff --git a/Tests/SwagTsTests/CodeGenAxiosTests.cs b/Tests/SwagTsTests/CodeGenAxiosTests.cs index 3f287acf..a80f1d75 100644 --- a/Tests/SwagTsTests/CodeGenAxiosTests.cs +++ b/Tests/SwagTsTests/CodeGenAxiosTests.cs @@ -19,26 +19,26 @@ public CodeGenAxiosTests() [Fact] public void TestValuesPaths() { - helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "AxiosResults/ValuesPaths.txt"); + helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "AxiosResults/ValuesPaths.ts"); } [Fact] public void TestPetDelete() { - helper.GenerateAndAssert("SwagMock/PetDelete.json", "AxiosResults/PetDelete.txt"); + helper.GenerateAndAssert("SwagMock/PetDelete.json", "AxiosResults/PetDelete.ts"); } [Fact] public void TestPet() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "AxiosResults/Pet.txt"); + helper.GenerateAndAssert("SwagMock/pet.yaml", "AxiosResults/Pet.ts"); } [Fact] public void TestPetWithPathAsContainerName() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "AxiosResults/PetPathAsContainer.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml", "AxiosResults/PetPathAsContainer.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "Misc", @@ -51,7 +51,7 @@ public void TestPetWithPathAsContainerName() [Fact] public void TestPetWithGodContainerAndPathAction() { - helper.GenerateAndAssert("SwagMock/pet.yaml" , "AxiosResults/PetGodClass.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml" , "AxiosResults/PetGodClass.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.PathMethodQueryParameters, @@ -63,7 +63,7 @@ public void TestPetWithGodContainerAndPathAction() [Fact] public void TestPetFindByStatus() { - helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "AxiosResults/PetFindByStatus.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "AxiosResults/PetFindByStatus.ts", new Settings() { ClientNamespace = "MyNS", PathPrefixToRemove = "/api", @@ -76,13 +76,13 @@ public void TestPetFindByStatus() [Fact] public void TestPetStore() { - helper.GenerateAndAssert("SwagMock/petStore.yaml", "AxiosResults/PetStore.txt"); + helper.GenerateAndAssert("SwagMock/petStore.yaml", "AxiosResults/PetStore.ts"); } [Fact] public void TestPetStoreExpanded() { - helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "AxiosResults/PetStoreExpanded.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "AxiosResults/PetStoreExpanded.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -93,7 +93,7 @@ public void TestPetStoreExpanded() [Fact] public void TestUspto() { - helper.GenerateAndAssert("SwagMock/uspto.yaml" , "AxiosResults/Uspto.txt", new Settings() + helper.GenerateAndAssert("SwagMock/uspto.yaml" , "AxiosResults/Uspto.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -106,7 +106,7 @@ public void TestUspto() [Fact] public void TestMcp() { - helper.GenerateAndAssert("SwagMock/mcp.yaml", "AxiosResults/mcp.txt", new Settings() + helper.GenerateAndAssert("SwagMock/mcp.yaml", "AxiosResults/mcp.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "McpClient", @@ -120,73 +120,73 @@ public void TestMcp() [Fact] public void TestEBaySellAccount() { - helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "AxiosResults/sell_account.txt"); + helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "AxiosResults/sell_account.ts"); } [Fact] public void TestEBay_sell_analytics() { - helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "AxiosResults/sell_analytics.txt"); + helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "AxiosResults/sell_analytics.ts"); } [Fact] public void TestEBay_sell_compliance() { - helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "AxiosResults/sell_compliance.txt"); + helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "AxiosResults/sell_compliance.ts"); } [Fact] public void TestEBay_sell_finances() { - helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "AxiosResults/sell_finances.txt"); + helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "AxiosResults/sell_finances.ts"); } [Fact] public void TestEBay_sell_inventory() { - helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "AxiosResults/sell_inventory.txt"); + helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "AxiosResults/sell_inventory.ts"); } [Fact] public void TestEBay_sell_listing() { - helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "AxiosResults/sell_listing.txt"); + helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "AxiosResults/sell_listing.ts"); } [Fact] public void TestEBay_sell_logistics() { - helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "AxiosResults/sell_logistics.txt"); + helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "AxiosResults/sell_logistics.ts"); } [Fact] public void TestEBay_sell_negotiation() { - helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "AxiosResults/sell_negotiation.txt"); + helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "AxiosResults/sell_negotiation.ts"); } [Fact] public void TestEBay_sell_marketing() { - helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "AxiosResults/sell_marketing.txt"); + helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "AxiosResults/sell_marketing.ts"); } [Fact] public void TestEBay_sell_metadata() { - helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "AxiosResults/sell_metadata.txt"); + helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "AxiosResults/sell_metadata.ts"); } [Fact] public void TestEBay_sell_recommendation() { - helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "AxiosResults/sell_recommendation.txt"); + helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "AxiosResults/sell_recommendation.ts"); } [Fact] public void TestRedocOpenApi() { - helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "AxiosResults/redocOpenApi200501.txt"); + helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "AxiosResults/redocOpenApi200501.ts"); } } diff --git a/Tests/SwagTsTests/CodeGenFetchTests.cs b/Tests/SwagTsTests/CodeGenFetchTests.cs index 93241a7d..c41c4e60 100644 --- a/Tests/SwagTsTests/CodeGenFetchTests.cs +++ b/Tests/SwagTsTests/CodeGenFetchTests.cs @@ -19,26 +19,26 @@ public CodeGenFetchTests() [Fact] public void TestValuesPaths() { - helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "FetchResults/ValuesPaths.txt"); + helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "FetchResults/ValuesPaths.ts"); } [Fact] public void TestPetDelete() { - helper.GenerateAndAssert("SwagMock/PetDelete.json", "FetchResults/PetDelete.txt"); + helper.GenerateAndAssert("SwagMock/PetDelete.json", "FetchResults/PetDelete.ts"); } [Fact] public void TestPet() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "FetchResults/Pet.txt"); + helper.GenerateAndAssert("SwagMock/pet.yaml", "FetchResults/Pet.ts"); } [Fact] public void TestPetWithPathAsContainerName() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "FetchResults/PetPathAsContainer.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml", "FetchResults/PetPathAsContainer.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "Misc", @@ -51,7 +51,7 @@ public void TestPetWithPathAsContainerName() [Fact] public void TestPetWithGodContainerAndPathAction() { - helper.GenerateAndAssert("SwagMock/pet.yaml" , "FetchResults/PetGodClass.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml" , "FetchResults/PetGodClass.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.PathMethodQueryParameters, @@ -63,7 +63,7 @@ public void TestPetWithGodContainerAndPathAction() [Fact] public void TestPetFindByStatus() { - helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "FetchResults/PetFindByStatus.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "FetchResults/PetFindByStatus.ts", new Settings() { ClientNamespace = "MyNS", PathPrefixToRemove = "/api", @@ -76,13 +76,13 @@ public void TestPetFindByStatus() [Fact] public void TestPetStore() { - helper.GenerateAndAssert("SwagMock/petStore.yaml", "FetchResults/PetStore.txt"); + helper.GenerateAndAssert("SwagMock/petStore.yaml", "FetchResults/PetStore.ts"); } [Fact] public void TestPetStoreExpanded() { - helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "FetchResults/PetStoreExpanded.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "FetchResults/PetStoreExpanded.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -93,7 +93,7 @@ public void TestPetStoreExpanded() [Fact] public void TestUspto() { - helper.GenerateAndAssert("SwagMock/uspto.yaml" , "FetchResults/Uspto.txt", new Settings() + helper.GenerateAndAssert("SwagMock/uspto.yaml" , "FetchResults/Uspto.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -106,7 +106,7 @@ public void TestUspto() [Fact] public void TestMcp() { - helper.GenerateAndAssert("SwagMock/mcp.yaml", "FetchResults/mcp.txt", new Settings() + helper.GenerateAndAssert("SwagMock/mcp.yaml", "FetchResults/mcp.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "McpClient", @@ -120,73 +120,73 @@ public void TestMcp() [Fact] public void TestEBaySellAccount() { - helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "FetchResults/sell_account.txt"); + helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "FetchResults/sell_account.ts"); } [Fact] public void TestEBay_sell_analytics() { - helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "FetchResults/sell_analytics.txt"); + helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "FetchResults/sell_analytics.ts"); } [Fact] public void TestEBay_sell_compliance() { - helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "FetchResults/sell_compliance.txt"); + helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "FetchResults/sell_compliance.ts"); } [Fact] public void TestEBay_sell_finances() { - helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "FetchResults/sell_finances.txt"); + helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "FetchResults/sell_finances.ts"); } [Fact] public void TestEBay_sell_inventory() { - helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "FetchResults/sell_inventory.txt"); + helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "FetchResults/sell_inventory.ts"); } [Fact] public void TestEBay_sell_listing() { - helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "FetchResults/sell_listing.txt"); + helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "FetchResults/sell_listing.ts"); } [Fact] public void TestEBay_sell_logistics() { - helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "FetchResults/sell_logistics.txt"); + helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "FetchResults/sell_logistics.ts"); } [Fact] public void TestEBay_sell_negotiation() { - helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "FetchResults/sell_negotiation.txt"); + helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "FetchResults/sell_negotiation.ts"); } [Fact] public void TestEBay_sell_marketing() { - helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "FetchResults/sell_marketing.txt"); + helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "FetchResults/sell_marketing.ts"); } [Fact] public void TestEBay_sell_metadata() { - helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "FetchResults/sell_metadata.txt"); + helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "FetchResults/sell_metadata.ts"); } [Fact] public void TestEBay_sell_recommendation() { - helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "FetchResults/sell_recommendation.txt"); + helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "FetchResults/sell_recommendation.ts"); } [Fact] public void TestRedocOpenApi() { - helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "FetchResults/redocOpenApi200501.txt"); + helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "FetchResults/redocOpenApi200501.ts"); } } diff --git a/Tests/SwagTsTests/CodeGenJqTests.cs b/Tests/SwagTsTests/CodeGenJqTests.cs index 0c297376..b31986b9 100644 --- a/Tests/SwagTsTests/CodeGenJqTests.cs +++ b/Tests/SwagTsTests/CodeGenJqTests.cs @@ -19,26 +19,26 @@ public CodeGenJqTests() [Fact] public void TestValuesPaths() { - helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "JqResults/ValuesPaths.txt"); + helper.GenerateAndAssert("SwagMock/ValuesPaths.json", "JqResults/ValuesPaths.ts"); } [Fact] public void TestPetDelete() { - helper.GenerateAndAssert("SwagMock/PetDelete.json", "JqResults/PetDelete.txt"); + helper.GenerateAndAssert("SwagMock/PetDelete.json", "JqResults/PetDelete.ts"); } [Fact] public void TestPet() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "JqResults/Pet.txt"); + helper.GenerateAndAssert("SwagMock/pet.yaml", "JqResults/Pet.ts"); } [Fact] public void TestPetWithPathAsContainerName() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "JqResults/PetPathAsContainer.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml", "JqResults/PetPathAsContainer.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "Misc", @@ -51,7 +51,7 @@ public void TestPetWithPathAsContainerName() [Fact] public void TestPetWithGodContainerAndPathAction() { - helper.GenerateAndAssert("SwagMock/pet.yaml" , "JqResults/PetGodClass.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml" , "JqResults/PetGodClass.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.PathMethodQueryParameters, @@ -63,7 +63,7 @@ public void TestPetWithGodContainerAndPathAction() [Fact] public void TestPetFindByStatus() { - helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "JqResults/PetFindByStatus.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petByStatus.yaml", "JqResults/PetFindByStatus.ts", new Settings() { ClientNamespace = "MyNS", PathPrefixToRemove = "/api", @@ -76,13 +76,13 @@ public void TestPetFindByStatus() [Fact] public void TestPetStore() { - helper.GenerateAndAssert("SwagMock/petStore.yaml", "JqResults/PetStore.txt"); + helper.GenerateAndAssert("SwagMock/petStore.yaml", "JqResults/PetStore.ts"); } [Fact] public void TestPetStoreExpanded() { - helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "JqResults/PetStoreExpanded.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "JqResults/PetStoreExpanded.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -93,7 +93,7 @@ public void TestPetStoreExpanded() [Fact] public void TestUspto() { - helper.GenerateAndAssert("SwagMock/uspto.yaml" , "JqResults/Uspto.txt", new Settings() + helper.GenerateAndAssert("SwagMock/uspto.yaml" , "JqResults/Uspto.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -106,7 +106,7 @@ public void TestUspto() [Fact] public void TestMcp() { - helper.GenerateAndAssert("SwagMock/mcp.yaml", "JqResults/mcp.txt", new Settings() + helper.GenerateAndAssert("SwagMock/mcp.yaml", "JqResults/mcp.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "McpClient", @@ -120,73 +120,73 @@ public void TestMcp() [Fact] public void TestEBaySellAccount() { - helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "JqResults/sell_account.txt"); + helper.GenerateAndAssert("SwagMock/sell_account_v1_oas3.json", "JqResults/sell_account.ts"); } [Fact] public void TestEBay_sell_analytics() { - helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "JqResults/sell_analytics.txt"); + helper.GenerateAndAssert("SwagMock/sell_analytics_v1_oas3.yaml", "JqResults/sell_analytics.ts"); } [Fact] public void TestEBay_sell_compliance() { - helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "JqResults/sell_compliance.txt"); + helper.GenerateAndAssert("SwagMock/sell_compliance_v1_oas3.yaml", "JqResults/sell_compliance.ts"); } [Fact] public void TestEBay_sell_finances() { - helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "JqResults/sell_finances.txt"); + helper.GenerateAndAssert("SwagMock/sell_finances_v1_oas3.yaml", "JqResults/sell_finances.ts"); } [Fact] public void TestEBay_sell_inventory() { - helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "JqResults/sell_inventory.txt"); + helper.GenerateAndAssert("SwagMock/sell_inventory_v1_oas3.yaml", "JqResults/sell_inventory.ts"); } [Fact] public void TestEBay_sell_listing() { - helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "JqResults/sell_listing.txt"); + helper.GenerateAndAssert("SwagMock/sell_listing_v1_beta_oas3.yaml", "JqResults/sell_listing.ts"); } [Fact] public void TestEBay_sell_logistics() { - helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "JqResults/sell_logistics.txt"); + helper.GenerateAndAssert("SwagMock/sell_logistics_v1_oas3.json", "JqResults/sell_logistics.ts"); } [Fact] public void TestEBay_sell_negotiation() { - helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "JqResults/sell_negotiation.txt"); + helper.GenerateAndAssert("SwagMock/sell_negotiation_v1_oas3.yaml", "JqResults/sell_negotiation.ts"); } [Fact] public void TestEBay_sell_marketing() { - helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "JqResults/sell_marketing.txt"); + helper.GenerateAndAssert("SwagMock/sell_marketing_v1_oas3.json", "JqResults/sell_marketing.ts"); } [Fact] public void TestEBay_sell_metadata() { - helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "JqResults/sell_metadata.txt"); + helper.GenerateAndAssert("SwagMock/sell_metadata_v1_oas3.json", "JqResults/sell_metadata.ts"); } [Fact] public void TestEBay_sell_recommendation() { - helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "JqResults/sell_recommendation.txt"); + helper.GenerateAndAssert("SwagMock/sell_recommendation_v1_oas3.yaml", "JqResults/sell_recommendation.ts"); } [Fact] public void TestRedocOpenApi() { - helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "JqResults/redocOpenApi200501.txt"); + helper.GenerateAndAssert("SwagMock/redocOpenApi200501.json", "JqResults/redocOpenApi200501.ts"); } } diff --git a/Tests/SwagTsTests/CodeGenNG2BuildTests.cs b/Tests/SwagTsTests/CodeGenNG2BuildTests.cs index bf17bc6e..3ecd5e1d 100644 --- a/Tests/SwagTsTests/CodeGenNG2BuildTests.cs +++ b/Tests/SwagTsTests/CodeGenNG2BuildTests.cs @@ -20,32 +20,32 @@ public CodeGenNG2BuildTests(ITestOutputHelper output) [Fact] public void TestValuesPaths() { - helper.GenerateAndAssertAndBuild("SwagMock/ValuesPaths.json", "NG2Results/ValuesPaths.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/ValuesPaths.json", "NG2Results/ValuesPaths.ts"); } [Fact] public void TestPetDelete() { - helper.GenerateAndAssertAndBuild("SwagMock/PetDelete.json", "NG2Results/PetDelete.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/PetDelete.json", "NG2Results/PetDelete.ts"); } [Fact] public void TestPet() { - helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2Results/Pet.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2Results/Pet.ts"); } [Fact] public void TestPetReturnNumber() { - helper.GenerateAndAssertAndBuild("SwagMock/petReturnNumber.yaml", "NG2Results/PetReturnNumber.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/petReturnNumber.yaml", "NG2Results/PetReturnNumber.ts"); } [Fact] public void TestPetByTags() { - helper.GenerateAndAssertAndBuild("SwagMock/petByTags.yaml", "NG2Results/PetByTags.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/petByTags.yaml", "NG2Results/PetByTags.ts"); } [Fact] @@ -53,7 +53,7 @@ public void TestPet_EnumToString() { var settings = CodeGenSettings.WithActionNameStrategy(ActionNameStrategy.Default); settings.EnumToString = true; - helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2Results/Pet_EnumToString.txt", settings); + helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2Results/Pet_EnumToString.ts", settings); } /// @@ -62,7 +62,7 @@ public void TestPet_EnumToString() [Fact] public void TestPetWithPathAsContainerName() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "NG2Results/PetPathAsContainer.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml", "NG2Results/PetPathAsContainer.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "MyClient", @@ -78,7 +78,7 @@ public void TestPetWithPathAsContainerName() [Fact] public void TestPetWithGodContainerAndPathAction() { - helper.GenerateAndAssert("SwagMock/pet.yaml" , "NG2Results/PetGodClass.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml" , "NG2Results/PetGodClass.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.PathMethodQueryParameters, @@ -90,7 +90,7 @@ public void TestPetWithGodContainerAndPathAction() [Fact] public void TestPetFindByStatus() { - helper.GenerateAndAssertAndBuild("SwagMock/petByStatus.yaml", "NG2Results/PetFindByStatus.txt", new Settings() + helper.GenerateAndAssertAndBuild("SwagMock/petByStatus.yaml", "NG2Results/PetFindByStatus.ts", new Settings() { ClientNamespace = "MyNS", PathPrefixToRemove = "/api", @@ -103,7 +103,7 @@ public void TestPetFindByStatus() [Fact] public void TestPetStore() { - helper.GenerateAndAssertAndBuild("SwagMock/petStore.yaml", "NG2Results/PetStore.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/petStore.yaml", "NG2Results/PetStore.ts"); } /// @@ -112,7 +112,7 @@ public void TestPetStore() [Fact] public void TestPetStoreExpanded() { - helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "NG2Results/PetStoreExpanded.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml" , "NG2Results/PetStoreExpanded.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -126,7 +126,7 @@ public void TestPetStoreExpanded() [Fact] public void TestUspto() { - helper.GenerateAndAssert("SwagMock/uspto.yaml" , "NG2Results/Uspto.txt", new Settings() + helper.GenerateAndAssert("SwagMock/uspto.yaml" , "NG2Results/Uspto.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -139,7 +139,7 @@ public void TestUspto() [Fact] public void TestMcp() { - helper.GenerateAndAssertAndBuild("SwagMock/mcp.yaml", "NG2Results/mcp.txt", new Settings() + helper.GenerateAndAssertAndBuild("SwagMock/mcp.yaml", "NG2Results/mcp.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "MyClient", @@ -153,7 +153,7 @@ public void TestMcp() [Fact] public void TestAir() { - helper.GenerateAndAssertAndBuild("SwagMock/AirOne.yaml", "NG2Results/AirOne.txt", new Settings() + helper.GenerateAndAssertAndBuild("SwagMock/AirOne.yaml", "NG2Results/AirOne.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "MyClient", @@ -167,115 +167,115 @@ public void TestAir() [Fact] public void TestEBaySellAccount() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_account_v1_oas3.json", "NG2Results/sell_account.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_account_v1_oas3.json", "NG2Results/sell_account.ts"); } [Fact] public void TestEBay_sell_analytics() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_analytics_v1_oas3.yaml", "NG2Results/sell_analytics.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_analytics_v1_oas3.yaml", "NG2Results/sell_analytics.ts"); } [Fact] public void TestEBay_sell_compliance() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_compliance_v1_oas3.yaml", "NG2Results/sell_compliance.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_compliance_v1_oas3.yaml", "NG2Results/sell_compliance.ts"); } [Fact] public void TestEBay_sell_finances() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_finances_v1_oas3.yaml", "NG2Results/sell_finances.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_finances_v1_oas3.yaml", "NG2Results/sell_finances.ts"); } [Fact] public void TestEBay_sell_inventory() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_inventory_v1_oas3.yaml", "NG2Results/sell_inventory.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_inventory_v1_oas3.yaml", "NG2Results/sell_inventory.ts"); } [Fact] public void TestEBay_sell_listing() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_listing_v1_beta_oas3.yaml", "NG2Results/sell_listing.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_listing_v1_beta_oas3.yaml", "NG2Results/sell_listing.ts"); } [Fact] public void TestEBay_sell_logistics() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_logistics_v1_oas3.json", "NG2Results/sell_logistics.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_logistics_v1_oas3.json", "NG2Results/sell_logistics.ts"); } [Fact] public void TestEBay_sell_negotiation() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_negotiation_v1_oas3.yaml", "NG2Results/sell_negotiation.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_negotiation_v1_oas3.yaml", "NG2Results/sell_negotiation.ts"); } [Fact] public void TestEBay_sell_marketing() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_marketing_v1_oas3.json", "NG2Results/sell_marketing.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_marketing_v1_oas3.json", "NG2Results/sell_marketing.ts"); } [Fact] public void TestEBay_sell_metadata() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_metadata_v1_oas3.json", "NG2Results/sell_metadata.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_metadata_v1_oas3.json", "NG2Results/sell_metadata.ts"); } [Fact] public void TestEBay_sell_recommendation() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_recommendation_v1_oas3.yaml", "NG2Results/sell_recommendation.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_recommendation_v1_oas3.yaml", "NG2Results/sell_recommendation.ts"); } [Fact] public void TestRedocOpenApi() { - helper.GenerateAndAssertAndBuild("SwagMock/redocOpenApi200501.json", "NG2Results/redocOpenApi200501.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/redocOpenApi200501.json", "NG2Results/redocOpenApi200501.ts"); } [Fact] public void Testxero_accounting() { - helper.GenerateAndAssertAndBuild("SwagMock/xero_accounting.yaml", "NG2Results/xero_accounting.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero_accounting.yaml", "NG2Results/xero_accounting.ts"); } [Fact] public void Testxero_assets() { - helper.GenerateAndAssertAndBuild("SwagMock/xero_assets.yaml", "NG2Results/xero_assets.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero_assets.yaml", "NG2Results/xero_assets.ts"); } [Fact] public void Testxero_bankfeeds() { - helper.GenerateAndAssertAndBuild("SwagMock/xero_bankfeeds.yaml", "NG2Results/xero_bankfeeds.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero_bankfeeds.yaml", "NG2Results/xero_bankfeeds.ts"); } [Fact] public void Testxero_payroll_au() { - helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-au.yaml", "NG2Results/xero-payroll-au.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-au.yaml", "NG2Results/xero-payroll-au.ts"); } [Fact] public void Testxero_identity() { - helper.GenerateAndAssertAndBuild("SwagMock/xero-identity.yaml", "NG2Results/xero-identity.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero-identity.yaml", "NG2Results/xero-identity.ts"); } [Fact] public void Testxero_payroll_uk() { - helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-uk.yaml", "NG2Results/xero-payroll-uk.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-uk.yaml", "NG2Results/xero-payroll-uk.ts"); } [Fact] public void TestGoogleBooks() { - helper.GenerateAndAssertAndBuild("SwagMock/googleBooksOpenApi.yaml", "NG2Results/googleBooksOpenApi.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/googleBooksOpenApi.yaml", "NG2Results/googleBooksOpenApi.ts"); } diff --git a/Tests/SwagTsTests/CodeGenNG2FormGroupBuildTests.cs b/Tests/SwagTsTests/CodeGenNG2FormGroupBuildTests.cs index 21b2163b..4b517aba 100644 --- a/Tests/SwagTsTests/CodeGenNG2FormGroupBuildTests.cs +++ b/Tests/SwagTsTests/CodeGenNG2FormGroupBuildTests.cs @@ -20,32 +20,32 @@ public CodeGenNG2FormGroupBuildTests(ITestOutputHelper output) [Fact] public void TestValuesPaths() { - helper.GenerateAndAssertAndBuild("SwagMock/ValuesPaths.json", "NG2FormGroupResults/ValuesPaths.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/ValuesPaths.json", "NG2FormGroupResults/ValuesPaths.ts"); } [Fact] public void TestPetDelete() { - helper.GenerateAndAssertAndBuild("SwagMock/PetDelete.json", "NG2FormGroupResults/PetDelete.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/PetDelete.json", "NG2FormGroupResults/PetDelete.ts"); } [Fact] public void TestPet() { - helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2FormGroupResults/Pet.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2FormGroupResults/Pet.ts"); } [Fact] public void TestPetSuper() { - helper.GenerateAndAssertAndBuild("SwagMock/petSuper.yaml", "NG2FormGroupResults/PetSuper.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/petSuper.yaml", "NG2FormGroupResults/PetSuper.ts"); } [Fact] public void TestPetByTags() { - helper.GenerateAndAssertAndBuild("SwagMock/petByTags.yaml", "NG2FormGroupResults/PetByTags.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/petByTags.yaml", "NG2FormGroupResults/PetByTags.ts"); } [Fact] @@ -53,7 +53,7 @@ public void TestPet_EnumToString() { var settings = CodeGenSettings.WithActionNameStrategy(ActionNameStrategy.Default); settings.EnumToString = true; - helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2FormGroupResults/Pet_EnumToString.txt", settings); + helper.GenerateAndAssertAndBuild("SwagMock/pet.yaml", "NG2FormGroupResults/Pet_EnumToString.ts", settings); } /// @@ -62,7 +62,7 @@ public void TestPet_EnumToString() [Fact] public void TestPetWithPathAsContainerName_NoBuild() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "NG2FormGroupResults/PetPathAsContainer.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml", "NG2FormGroupResults/PetPathAsContainer.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "MyClient", @@ -78,7 +78,7 @@ public void TestPetWithPathAsContainerName_NoBuild() [Fact] public void TestPetWithGodContainerAndPathAction_NoBuild() { - helper.GenerateAndAssert("SwagMock/pet.yaml", "NG2FormGroupResults/PetGodClass.txt", new Settings() + helper.GenerateAndAssert("SwagMock/pet.yaml", "NG2FormGroupResults/PetGodClass.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.PathMethodQueryParameters, @@ -90,7 +90,7 @@ public void TestPetWithGodContainerAndPathAction_NoBuild() [Fact] public void TestPetFindByStatus() { - helper.GenerateAndAssertAndBuild("SwagMock/petByStatus.yaml", "NG2FormGroupResults/PetFindByStatus.txt", new Settings() + helper.GenerateAndAssertAndBuild("SwagMock/petByStatus.yaml", "NG2FormGroupResults/PetFindByStatus.ts", new Settings() { ClientNamespace = "MyNS", PathPrefixToRemove = "/api", @@ -103,13 +103,13 @@ public void TestPetFindByStatus() [Fact] public void TestPetStore() { - helper.GenerateAndAssertAndBuild("SwagMock/petStore.yaml", "NG2FormGroupResults/PetStore.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/petStore.yaml", "NG2FormGroupResults/PetStore.ts"); } [Fact] public void TestPetStoreSorted() { - helper.GenerateAndAssertAndBuild("SwagMock/petStore.yaml", "NG2FormGroupResults/PetStoreSorted.txt", new Settings() // based my mySettings + helper.GenerateAndAssertAndBuild("SwagMock/petStore.yaml", "NG2FormGroupResults/PetStoreSorted.ts", new Settings() // based my mySettings { ClientNamespace = "MyNS", ContainerClassName = "MyClient", //the TestBed requires this containerClassName @@ -126,7 +126,7 @@ public void TestPetStoreSorted() [Fact] public void TestPetStoreExpanded() { - helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml", "NG2FormGroupResults/PetStoreExpanded.txt", new Settings() + helper.GenerateAndAssert("SwagMock/petStoreExpanded.yaml", "NG2FormGroupResults/PetStoreExpanded.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -140,7 +140,7 @@ public void TestPetStoreExpanded() [Fact] public void TestUspto() { - helper.GenerateAndAssert("SwagMock/uspto.yaml", "NG2FormGroupResults/Uspto.txt", new Settings() + helper.GenerateAndAssert("SwagMock/uspto.yaml", "NG2FormGroupResults/Uspto.ts", new Settings() { ClientNamespace = "MyNS", ActionNameStrategy = ActionNameStrategy.NormalizedOperationId, @@ -153,7 +153,7 @@ public void TestUspto() [Fact] public void TestMcp() { - helper.GenerateAndAssertAndBuild("SwagMock/mcp.yaml", "NG2FormGroupResults/mcp.txt", new Settings() + helper.GenerateAndAssertAndBuild("SwagMock/mcp.yaml", "NG2FormGroupResults/mcp.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "MyClient", @@ -167,7 +167,7 @@ public void TestMcp() [Fact] public void TestAir() { - helper.GenerateAndAssertAndBuild("SwagMock/AirOne.yaml", "NG2FormGroupResults/AirOne.txt", new Settings() + helper.GenerateAndAssertAndBuild("SwagMock/AirOne.yaml", "NG2FormGroupResults/AirOne.ts", new Settings() { ClientNamespace = "MyNS", ContainerClassName = "MyClient", @@ -181,121 +181,121 @@ public void TestAir() [Fact] public void TestEBaySellAccount() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_account_v1_oas3.json", "NG2FormGroupResults/sell_account.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_account_v1_oas3.json", "NG2FormGroupResults/sell_account.ts"); } [Fact] public void TestEBay_sell_analytics() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_analytics_v1_oas3.yaml", "NG2FormGroupResults/sell_analytics.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_analytics_v1_oas3.yaml", "NG2FormGroupResults/sell_analytics.ts"); } [Fact] public void TestEBay_sell_compliance() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_compliance_v1_oas3.yaml", "NG2FormGroupResults/sell_compliance.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_compliance_v1_oas3.yaml", "NG2FormGroupResults/sell_compliance.ts"); } [Fact] public void TestEBay_sell_finances() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_finances_v1_oas3.yaml", "NG2FormGroupResults/sell_finances.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_finances_v1_oas3.yaml", "NG2FormGroupResults/sell_finances.ts"); } [Fact] public void TestEBay_sell_inventory() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_inventory_v1_oas3.yaml", "NG2FormGroupResults/sell_inventory.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_inventory_v1_oas3.yaml", "NG2FormGroupResults/sell_inventory.ts"); } [Fact] public void TestEBay_sell_listing() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_listing_v1_beta_oas3.yaml", "NG2FormGroupResults/sell_listing.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_listing_v1_beta_oas3.yaml", "NG2FormGroupResults/sell_listing.ts"); } [Fact] public void TestEBay_sell_logistics() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_logistics_v1_oas3.json", "NG2FormGroupResults/sell_logistics.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_logistics_v1_oas3.json", "NG2FormGroupResults/sell_logistics.ts"); } [Fact] public void TestEBay_sell_negotiation() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_negotiation_v1_oas3.yaml", "NG2FormGroupResults/sell_negotiation.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_negotiation_v1_oas3.yaml", "NG2FormGroupResults/sell_negotiation.ts"); } [Fact] public void TestEBay_sell_marketing() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_marketing_v1_oas3.json", "NG2FormGroupResults/sell_marketing.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_marketing_v1_oas3.json", "NG2FormGroupResults/sell_marketing.ts"); } [Fact] public void TestEBay_sell_metadata() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_metadata_v1_oas3.json", "NG2FormGroupResults/sell_metadata.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_metadata_v1_oas3.json", "NG2FormGroupResults/sell_metadata.ts"); } [Fact] public void TestEBay_sell_recommendation() { - helper.GenerateAndAssertAndBuild("SwagMock/sell_recommendation_v1_oas3.yaml", "NG2FormGroupResults/sell_recommendation.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/sell_recommendation_v1_oas3.yaml", "NG2FormGroupResults/sell_recommendation.ts"); } [Fact] public void TestRedocOpenApi() { - helper.GenerateAndAssertAndBuild("SwagMock/redocOpenApi200501.json", "NG2FormGroupResults/redocOpenApi200501.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/redocOpenApi200501.json", "NG2FormGroupResults/redocOpenApi200501.ts"); } [Fact] public void Testxero_accounting() { - helper.GenerateAndAssertAndBuild("SwagMock/xero_accounting.yaml", "NG2FormGroupResults/xero_accounting.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero_accounting.yaml", "NG2FormGroupResults/xero_accounting.ts"); } [Fact] public void Testxero_assets() { - helper.GenerateAndAssertAndBuild("SwagMock/xero_assets.yaml", "NG2FormGroupResults/xero_assets.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero_assets.yaml", "NG2FormGroupResults/xero_assets.ts"); } [Fact] public void Testxero_bankfeeds() { - helper.GenerateAndAssertAndBuild("SwagMock/xero_bankfeeds.yaml", "NG2FormGroupResults/xero_bankfeeds.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero_bankfeeds.yaml", "NG2FormGroupResults/xero_bankfeeds.ts"); } [Fact] public void Testxero_payroll_au() { - helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-au.yaml", "NG2FormGroupResults/xero-payroll-au.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-au.yaml", "NG2FormGroupResults/xero-payroll-au.ts"); } [Fact] public void Testxero_identity() { - helper.GenerateAndAssertAndBuild("SwagMock/xero-identity.yaml", "NG2FormGroupResults/xero-identity.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero-identity.yaml", "NG2FormGroupResults/xero-identity.ts"); } [Fact] public void Testxero_payroll_uk() { - helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-uk.yaml", "NG2FormGroupResults/xero-payroll-uk.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/xero-payroll-uk.yaml", "NG2FormGroupResults/xero-payroll-uk.ts"); } [Fact] public void TestMozillaKinto() { - helper.GenerateAndAssertAndBuild("SwagMock/MozillaKinto.yaml", "NG2FormGroupResults/MozillaKinto.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/MozillaKinto.yaml", "NG2FormGroupResults/MozillaKinto.ts"); } [Fact] public void TestGoogleBooks() { - helper.GenerateAndAssertAndBuild("SwagMock/googleBooksOpenApi.yaml", "NG2FormGroupResults/googleBooksOpenApi.txt"); + helper.GenerateAndAssertAndBuild("SwagMock/googleBooksOpenApi.yaml", "NG2FormGroupResults/googleBooksOpenApi.ts"); } } diff --git a/Tests/SwagTsTests/FetchResults/Pet.txt b/Tests/SwagTsTests/FetchResults/Pet.ts similarity index 96% rename from Tests/SwagTsTests/FetchResults/Pet.txt rename to Tests/SwagTsTests/FetchResults/Pet.ts index acb4ae82..ba5094b6 100644 --- a/Tests/SwagTsTests/FetchResults/Pet.txt +++ b/Tests/SwagTsTests/FetchResults/Pet.ts @@ -1,397 +1,397 @@ -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Promise> { - return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class StoreClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise { - return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Promise { - return fetch(this.baseUri + 'user/createWithArray', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Promise { - return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Promise { - return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise { - return fetch(this.baseUri + 'user/logout', { method: 'get' }); - } - } - -} - +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Promise> { + return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class StoreClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise { + return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Promise { + return fetch(this.baseUri + 'user/createWithArray', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Promise { + return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Promise { + return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise { + return fetch(this.baseUri + 'user/logout', { method: 'get' }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/PetDelete.txt b/Tests/SwagTsTests/FetchResults/PetDelete.ts similarity index 96% rename from Tests/SwagTsTests/FetchResults/PetDelete.txt rename to Tests/SwagTsTests/FetchResults/PetDelete.ts index cea093b8..f5b46e19 100644 --- a/Tests/SwagTsTests/FetchResults/PetDelete.txt +++ b/Tests/SwagTsTests/FetchResults/PetDelete.ts @@ -1,19 +1,19 @@ -export namespace MyNS { - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); - } - } - -} - +export namespace MyNS { + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/PetFindByStatus.txt b/Tests/SwagTsTests/FetchResults/PetFindByStatus.ts similarity index 96% rename from Tests/SwagTsTests/FetchResults/PetFindByStatus.txt rename to Tests/SwagTsTests/FetchResults/PetFindByStatus.ts index bd9ba780..43d6f209 100644 --- a/Tests/SwagTsTests/FetchResults/PetFindByStatus.txt +++ b/Tests/SwagTsTests/FetchResults/PetFindByStatus.ts @@ -1,121 +1,121 @@ -export namespace MyNS { - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export class Misc { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus2 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus2(status: PetStatus): Promise> { - return fetch(this.baseUri + 'pet/findByStatus2?status=' + status, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus3 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus3(status: PetStatus): Promise> { - return fetch(this.baseUri + 'pet/findByStatus3?status=' + status, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export class Misc { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus2 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus2(status: PetStatus): Promise> { + return fetch(this.baseUri + 'pet/findByStatus2?status=' + status, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus3 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus3(status: PetStatus): Promise> { + return fetch(this.baseUri + 'pet/findByStatus3?status=' + status, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/PetGodClass.txt b/Tests/SwagTsTests/FetchResults/PetGodClass.ts similarity index 96% rename from Tests/SwagTsTests/FetchResults/PetGodClass.txt rename to Tests/SwagTsTests/FetchResults/PetGodClass.ts index 0038bc9d..941929fb 100644 --- a/Tests/SwagTsTests/FetchResults/PetGodClass.txt +++ b/Tests/SwagTsTests/FetchResults/PetGodClass.ts @@ -1,334 +1,334 @@ -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - export class Misc { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPost(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPut(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - Pet_petIdGet(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - Pet_petIdDelete(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - PetFindByStatusGetByStatus(status: Array): Promise> { - return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - PetFindByTagsGetByTags(tags: Array): Promise> { - return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - StoreInventoryGet(): Promise<{[id: string]: number }> { - return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - StoreOrderPost(requestBody: Order): Promise { - return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - StoreOrder_orderIdGet(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - StoreOrder_orderIdDelete(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - UserPost(requestBody: User): Promise { - return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - User_usernameGet(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - User_usernamePut(username: string, requestBody: User): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - User_usernameDelete(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithArrayPost(requestBody: Array): Promise { - return fetch(this.baseUri + 'user/createWithArray', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithListPost(requestBody: Array): Promise { - return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - UserLoginGetByUsernameAndPassword(username: string, password: string): Promise { - return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - UserLogoutGet(): Promise { - return fetch(this.baseUri + 'user/logout', { method: 'get' }); - } - } - -} - +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + export class Misc { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPost(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPut(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + Pet_petIdGet(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + Pet_petIdDelete(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + PetFindByStatusGetByStatus(status: Array): Promise> { + return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + PetFindByTagsGetByTags(tags: Array): Promise> { + return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + StoreInventoryGet(): Promise<{[id: string]: number }> { + return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + StoreOrderPost(requestBody: Order): Promise { + return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + StoreOrder_orderIdGet(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + StoreOrder_orderIdDelete(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + UserPost(requestBody: User): Promise { + return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + User_usernameGet(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + User_usernamePut(username: string, requestBody: User): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + User_usernameDelete(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithArrayPost(requestBody: Array): Promise { + return fetch(this.baseUri + 'user/createWithArray', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithListPost(requestBody: Array): Promise { + return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + UserLoginGetByUsernameAndPassword(username: string, password: string): Promise { + return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + UserLogoutGet(): Promise { + return fetch(this.baseUri + 'user/logout', { method: 'get' }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/PetPathAsContainer.txt b/Tests/SwagTsTests/FetchResults/PetPathAsContainer.ts similarity index 96% rename from Tests/SwagTsTests/FetchResults/PetPathAsContainer.txt rename to Tests/SwagTsTests/FetchResults/PetPathAsContainer.ts index 8d9143b4..0a1cb279 100644 --- a/Tests/SwagTsTests/FetchResults/PetPathAsContainer.txt +++ b/Tests/SwagTsTests/FetchResults/PetPathAsContainer.ts @@ -1,399 +1,399 @@ -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Post(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Put(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class Pet_petIdClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - GetByPetId(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - DeleteByPetId(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); - } - } - - export class Pet_petIdUploadImageClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - } - - export class PetFindByStatusClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - GetByStatus(status: Array): Promise> { - return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class PetFindByTagsClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - GetByTags(tags: Array): Promise> { - return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class StoreInventoryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - Get(): Promise<{[id: string]: number }> { - return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class StoreOrderClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - Post(requestBody: Order): Promise { - return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class StoreOrder_orderIdClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - GetByOrderId(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - DeleteByOrderId(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - Post(requestBody: User): Promise { - return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class User_usernameClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetByUsername(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - PutByUsername(username: string, requestBody: User): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteByUsername(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); - } - } - - export class UserCreateWithArrayClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Promise { - return fetch(this.baseUri + 'user/createWithArray', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class UserCreateWithListClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Promise { - return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class UserLoginClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - GetByUsernameAndPassword(username: string, password: string): Promise { - return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - } - - export class UserLogoutClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - Get(): Promise { - return fetch(this.baseUri + 'user/logout', { method: 'get' }); - } - } - -} - +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Post(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Put(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class Pet_petIdClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + GetByPetId(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + DeleteByPetId(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); + } + } + + export class Pet_petIdUploadImageClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + } + + export class PetFindByStatusClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + GetByStatus(status: Array): Promise> { + return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class PetFindByTagsClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + GetByTags(tags: Array): Promise> { + return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class StoreInventoryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + Get(): Promise<{[id: string]: number }> { + return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class StoreOrderClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + Post(requestBody: Order): Promise { + return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class StoreOrder_orderIdClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + GetByOrderId(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + DeleteByOrderId(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + Post(requestBody: User): Promise { + return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class User_usernameClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetByUsername(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + PutByUsername(username: string, requestBody: User): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteByUsername(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); + } + } + + export class UserCreateWithArrayClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Promise { + return fetch(this.baseUri + 'user/createWithArray', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class UserCreateWithListClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Promise { + return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class UserLoginClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + GetByUsernameAndPassword(username: string, password: string): Promise { + return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + } + + export class UserLogoutClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + Get(): Promise { + return fetch(this.baseUri + 'user/logout', { method: 'get' }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/PetStore.txt b/Tests/SwagTsTests/FetchResults/PetStore.ts similarity index 97% rename from Tests/SwagTsTests/FetchResults/PetStore.txt rename to Tests/SwagTsTests/FetchResults/PetStore.ts index a333b253..022cef23 100644 --- a/Tests/SwagTsTests/FetchResults/PetStore.txt +++ b/Tests/SwagTsTests/FetchResults/PetStore.ts @@ -1,310 +1,310 @@ -export namespace MyNS { - export interface Order { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity?: number | null; - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - complete?: boolean | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Customer { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - address?: Array
; - } - - export interface Address { - street?: string | null; - city?: string | null; - state?: string | null; - zip?: string | null; - } - - export interface Category { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - firstName?: string | null; - lastName?: string | null; - email?: string | null; - password?: string | null; - phone?: string | null; - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export interface Tag { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface Pet { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Required */ - name: string; - category?: Category; - - /** Required */ - photoUrls: Array; - tags?: Array; - - /** pet status in the store */ - status?: PetStatus | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Update an existing pet - * Update an existing pet by Id - * Put pet - * @param {Pet} requestBody Update an existent pet in the store - * @return {Pet} Successful operation - */ - UpdatePet(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Add a new pet to the store - * Add a new pet to the store - * Post pet - * @param {Pet} requestBody Create a new pet in the store - * @return {Pet} Successful operation - */ - AddPet(requestBody: Pet): Promise { - return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: PetStatus | null | undefined): Promise> { - return fetch(this.baseUri + 'pet/findByStatus?status=' + status, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array | null | undefined): Promise> { - return fetch(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Updates a pet in the store with form data - * Post pet/{petId} - * @param {string} petId ID of pet that needs to be updated - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @param {string} name Name of pet that needs to be updated - * @param {string} status Status of pet that needs to be updated - * @return {void} - */ - UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise { - return fetch(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { method: 'post' }); - } - - /** - * Deletes a pet - * delete a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); - } - } - - export class StoreClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Place an order for a pet - * Place a new order in the store - * Post store/order - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - * Get store/order/{orderId} - * @param {string} orderId ID of order that needs to be fetched - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeleteOrder(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + orderId, { method: 'delete' }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise { - return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Creates list of users with given input array - * Creates list of users with given input array - * Post user/createWithList - * @return {User} Successful operation - */ - CreateUsersWithListInput(requestBody: Array): Promise { - return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string | null | undefined, password: string | null | undefined): Promise { - return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise { - return fetch(this.baseUri + 'user/logout', { method: 'get' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Update user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Update an existent user in the store - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); - } - } - -} - +export namespace MyNS { + export interface Order { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity?: number | null; + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + complete?: boolean | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Customer { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + address?: Array
; + } + + export interface Address { + street?: string | null; + city?: string | null; + state?: string | null; + zip?: string | null; + } + + export interface Category { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + firstName?: string | null; + lastName?: string | null; + email?: string | null; + password?: string | null; + phone?: string | null; + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export interface Tag { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface Pet { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Required */ + name: string; + category?: Category; + + /** Required */ + photoUrls: Array; + tags?: Array; + + /** pet status in the store */ + status?: PetStatus | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Update an existing pet + * Update an existing pet by Id + * Put pet + * @param {Pet} requestBody Update an existent pet in the store + * @return {Pet} Successful operation + */ + UpdatePet(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Add a new pet to the store + * Add a new pet to the store + * Post pet + * @param {Pet} requestBody Create a new pet in the store + * @return {Pet} Successful operation + */ + AddPet(requestBody: Pet): Promise { + return fetch(this.baseUri + 'pet', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: PetStatus | null | undefined): Promise> { + return fetch(this.baseUri + 'pet/findByStatus?status=' + status, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array | null | undefined): Promise> { + return fetch(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Updates a pet in the store with form data + * Post pet/{petId} + * @param {string} petId ID of pet that needs to be updated + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} name Name of pet that needs to be updated + * @param {string} status Status of pet that needs to be updated + * @return {void} + */ + UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Promise { + return fetch(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { method: 'post' }); + } + + /** + * Deletes a pet + * delete a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); + } + } + + export class StoreClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Place an order for a pet + * Place a new order in the store + * Post store/order + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + * Get store/order/{orderId} + * @param {string} orderId ID of order that needs to be fetched + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeleteOrder(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + orderId, { method: 'delete' }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise { + return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Creates list of users with given input array + * Creates list of users with given input array + * Post user/createWithList + * @return {User} Successful operation + */ + CreateUsersWithListInput(requestBody: Array): Promise { + return fetch(this.baseUri + 'user/createWithList', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string | null | undefined, password: string | null | undefined): Promise { + return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise { + return fetch(this.baseUri + 'user/logout', { method: 'get' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Update user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Update an existent user in the store + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/PetStoreExpanded.txt b/Tests/SwagTsTests/FetchResults/PetStoreExpanded.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/PetStoreExpanded.txt rename to Tests/SwagTsTests/FetchResults/PetStoreExpanded.ts index 5a361ca6..99bb20c7 100644 --- a/Tests/SwagTsTests/FetchResults/PetStoreExpanded.txt +++ b/Tests/SwagTsTests/FetchResults/PetStoreExpanded.ts @@ -1,65 +1,65 @@ -export namespace MyNS { - export interface Pet extends NewPet { - id: string; - } - - export interface NewPet { - name: string; - tag?: string | null; - } - - export interface Error { - code: number; - message: string; - } - - export class Misc { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns all pets from the system that the user has access to - * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - * Get pets - * @param {Array} tags tags to filter by - * @param {number} limit maximum number of results to return - * @return {Array} pet response - */ - FindPets(tags: Array | null | undefined, limit: number | null | undefined): Promise> { - return fetch(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Creates a new pet in the store. Duplicates are allowed - * Post pets - * @param {NewPet} requestBody Pet to add to the store - * @return {Pet} pet response - */ - AddPet(requestBody: NewPet): Promise { - return fetch(this.baseUri + 'pets', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Returns a user based on a single ID, if the user does not have access to the pet - * Get pets/{id} - * @param {string} id ID of pet to fetch - * @return {Pet} pet response - */ - FindPetById(id: string): Promise { - return fetch(this.baseUri + 'pets/' + id, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * deletes a single pet based on the ID supplied - * Delete pets/{id} - * @param {string} id ID of pet to delete - * @return {void} - */ - DeletePet(id: string): Promise { - return fetch(this.baseUri + 'pets/' + id, { method: 'delete' }); - } - } - -} - +export namespace MyNS { + export interface Pet extends NewPet { + id: string; + } + + export interface NewPet { + name: string; + tag?: string | null; + } + + export interface Error { + code: number; + message: string; + } + + export class Misc { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns all pets from the system that the user has access to + * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. + * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. + * Get pets + * @param {Array} tags tags to filter by + * @param {number} limit maximum number of results to return + * @return {Array} pet response + */ + FindPets(tags: Array | null | undefined, limit: number | null | undefined): Promise> { + return fetch(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Creates a new pet in the store. Duplicates are allowed + * Post pets + * @param {NewPet} requestBody Pet to add to the store + * @return {Pet} pet response + */ + AddPet(requestBody: NewPet): Promise { + return fetch(this.baseUri + 'pets', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Returns a user based on a single ID, if the user does not have access to the pet + * Get pets/{id} + * @param {string} id ID of pet to fetch + * @return {Pet} pet response + */ + FindPetById(id: string): Promise { + return fetch(this.baseUri + 'pets/' + id, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * deletes a single pet based on the ID supplied + * Delete pets/{id} + * @param {string} id ID of pet to delete + * @return {void} + */ + DeletePet(id: string): Promise { + return fetch(this.baseUri + 'pets/' + id, { method: 'delete' }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/Uspto.txt b/Tests/SwagTsTests/FetchResults/Uspto.ts similarity index 97% rename from Tests/SwagTsTests/FetchResults/Uspto.txt rename to Tests/SwagTsTests/FetchResults/Uspto.ts index 5f79bbf7..75d8ed14 100644 --- a/Tests/SwagTsTests/FetchResults/Uspto.txt +++ b/Tests/SwagTsTests/FetchResults/Uspto.ts @@ -1,54 +1,54 @@ -export namespace MyNS { - export interface DataSetList { - total?: number | null; - DataSetListApis?: Array; - } - - export interface DataSetListApis { - - /** To be used as a dataset parameter value */ - apiKey?: string | null; - - /** To be used as a version parameter value */ - apiVersionNumber?: string | null; - - /** The URL describing the dataset's fields */ - apiUrl?: string | null; - - /** A URL to the API console for each API */ - apiDocumentationUrl?: string | null; - } - - export class MetadataClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * List available data sets - * Get - * @return {DataSetList} Returns a list of data sets - */ - ListDataSets(): Promise { - return fetch(this.baseUri + '', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Provides the general information about the API and the list of fields that can be used to query the dataset. - * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. - * Get {dataset}/{version}/fields - * @param {string} dataset Name of the dataset. - * @param {string} version Version of the dataset. - * @return {string} The dataset API for the given version is found and it is accessible to consume. - */ - ListSearchableFields(dataset: string, version: string): Promise { - return fetch(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - } - - export class SearchClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - } - -} - +export namespace MyNS { + export interface DataSetList { + total?: number | null; + DataSetListApis?: Array; + } + + export interface DataSetListApis { + + /** To be used as a dataset parameter value */ + apiKey?: string | null; + + /** To be used as a version parameter value */ + apiVersionNumber?: string | null; + + /** The URL describing the dataset's fields */ + apiUrl?: string | null; + + /** A URL to the API console for each API */ + apiDocumentationUrl?: string | null; + } + + export class MetadataClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * List available data sets + * Get + * @return {DataSetList} Returns a list of data sets + */ + ListDataSets(): Promise { + return fetch(this.baseUri + '', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Provides the general information about the API and the list of fields that can be used to query the dataset. + * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. + * Get {dataset}/{version}/fields + * @param {string} dataset Name of the dataset. + * @param {string} version Version of the dataset. + * @return {string} The dataset API for the given version is found and it is accessible to consume. + */ + ListSearchableFields(dataset: string, version: string): Promise { + return fetch(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + } + + export class SearchClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/ValuesPaths.txt b/Tests/SwagTsTests/FetchResults/ValuesPaths.ts similarity index 97% rename from Tests/SwagTsTests/FetchResults/ValuesPaths.txt rename to Tests/SwagTsTests/FetchResults/ValuesPaths.ts index ac93247d..c32b5fdc 100644 --- a/Tests/SwagTsTests/FetchResults/ValuesPaths.txt +++ b/Tests/SwagTsTests/FetchResults/ValuesPaths.ts @@ -1,51 +1,51 @@ -export namespace MyNS { - export class ValuesClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Get api/Values - * @return {Array} Success - */ - ValuesGet(): Promise> { - return fetch(this.baseUri + 'api/Values', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Post api/Values - * @return {string} Success - */ - ValuesPost(requestBody: string): Promise { - return fetch(this.baseUri + 'api/Values', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * Get api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {string} Success - */ - ValuesGetById(id: number): Promise { - return fetch(this.baseUri + 'api/Values/' + id, { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * Put api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesPutById(id: number, requestBody: string): Promise { - return fetch(this.baseUri + 'api/Values/' + id, { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Delete api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesDeleteById(id: number): Promise { - return fetch(this.baseUri + 'api/Values/' + id, { method: 'delete' }); - } - } - -} - +export namespace MyNS { + export class ValuesClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Get api/Values + * @return {Array} Success + */ + ValuesGet(): Promise> { + return fetch(this.baseUri + 'api/Values', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Post api/Values + * @return {string} Success + */ + ValuesPost(requestBody: string): Promise { + return fetch(this.baseUri + 'api/Values', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * Get api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {string} Success + */ + ValuesGetById(id: number): Promise { + return fetch(this.baseUri + 'api/Values/' + id, { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * Put api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesPutById(id: number, requestBody: string): Promise { + return fetch(this.baseUri + 'api/Values/' + id, { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Delete api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesDeleteById(id: number): Promise { + return fetch(this.baseUri + 'api/Values/' + id, { method: 'delete' }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/mcp.txt b/Tests/SwagTsTests/FetchResults/mcp.ts similarity index 97% rename from Tests/SwagTsTests/FetchResults/mcp.txt rename to Tests/SwagTsTests/FetchResults/mcp.ts index d5ddb5b7..32209da4 100644 --- a/Tests/SwagTsTests/FetchResults/mcp.txt +++ b/Tests/SwagTsTests/FetchResults/mcp.ts @@ -1,885 +1,885 @@ -export namespace MyNS { - export interface BBSReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface ProviderType { - providerNumber: string; - } - - export interface BBSPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface PaymentRunType { - payerName?: string | null; - runDate?: Date | null; - runNumber?: string | null; - } - - export interface PaymentType { - accountInfo: BankAccountType; - depositAmount?: string | null; - paymentReference?: string | null; - } - - export interface BankAccountType { - accountName?: string | null; - accountNumber?: string | null; - bsbCode?: string | null; - } - - export interface ClaimSummaryType { - accountReferenceId?: string | null; - benefit?: string | null; - chargeAmount?: string | null; - claimChannelCode?: string | null; - claimId?: string | null; - lodgementDate?: Date | null; - transactionId?: string | null; - } - - export interface ServiceMessagesType { - highestSeverity: ServiceMessagesTypeHighestSeverity; - serviceMessage: Array; - } - - export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } - - export interface ServiceMessageType { - code: string; - severity: ServiceMessagesTypeHighestSeverity; - reason: string; - } - - export interface BBSProcessingReportResponseType { - claimAssessment?: ClaimAssessmentType; - status: string; - } - - export interface ClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface MedicalEventResponseType { - patient?: MembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface MembershipStatusType { - status?: StatusType; - currentMembership?: MembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface StatusType { - code?: number | null; - text?: string | null; - } - - export interface MembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - } - - export interface IdentityType { - dateOfBirth?: Date | null; - familyName?: string | null; - givenName?: string | null; - secondInitial?: string | null; - sex?: string | null; - } - - export interface ServiceResponseType { - error?: StatusType; - id?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface BulkBillStoreForwardRequestType { - claim: BulkBillClaimStoreForwardClaimType; - } - - export interface BulkBillClaimStoreForwardClaimType { - facilityId?: string | null; - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface BBSMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - medicalEventDate: Date; - medicalEventTime?: string | null; - patient: MedicarePatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface MedicarePatientType { - identity: IdentityType; - medicare: MembershipType; - } - - export interface ReferralType { - issueDate: Date; - period?: string | null; - periodCode?: string | null; - provider: ProviderType; - typeCode: string; - } - - export interface ServiceType { - id: string; - accessionDateTime?: Date | null; - aftercareOverrideInd?: string | null; - chargeAmount?: string | null; - collectionDateTime?: Date | null; - duplicateServiceOverrideInd?: string | null; - fieldQuantity?: string | null; - itemNumber?: string | null; - lspNumber?: string | null; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - restrictiveOverrideCode?: string | null; - rule3ExemptInd?: string | null; - s4b3ExemptInd?: string | null; - scpId?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - } - - export interface BulkBillStoreForwardResponseType { - claimId: string; - status: string; - } - - export interface AlliedHealthClaimRequestType { - claim: VAAClaimType; - } - - export interface VAAClaimType { - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface VAAMedicalEventType { - id: string; - acceptedDisability?: AcceptedDisabilityType; - authorisationDate: Date; - breakInEpisodeEndDate?: Date | null; - breakInEpisodeOfCareNumber?: string | null; - breakInEpisodeStartDate?: Date | null; - numberOfCNCHours?: string | null; - numberOfCNCVisits?: string | null; - createDateTime: Date; - numberOfENHours?: string | null; - numberOfENVisits?: string | null; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - numberOfNSSHours?: string | null; - numberOfNSSVisits?: string | null; - patient: VeteranPatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - numberOfRNHours?: string | null; - numberOfRNVisits?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface AcceptedDisabilityType { - code: string; - ind: string; - } - - export interface VAAServiceType { - id: string; - accountReferenceNumber?: string | null; - admissionDate?: Date | null; - chargeAmount?: string | null; - dischargeDate?: Date | null; - distanceKilometres?: number | null; - duplicateServiceOverrideInd?: string | null; - itemNumber: string; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - numberOfTeeth?: string | null; - opticalScriptCode?: string | null; - restrictiveOverrideCode?: string | null; - secondDeviceInd?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - toothNumber?: string | null; - upperLowerJawCode?: string | null; - } - - export interface VeteranPatientType extends PatientType { - veteranMembership?: VeteranMembershipType; - } - - export interface VeteranMembershipType { - veteranNumber: string; - } - - export interface PatientType { - identity: IdentityType; - residentialAddress?: AddressType; - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postcode?: string | null; - } - - export interface AlliedHealthClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAClaimRequestType { - claim: DVAClaimType; - } - - export interface DVAClaimType { - hospitalInd?: string | null; - serviceTypeCode: string; - medicalEvent: Array; - serviceProvider: ProviderType; - payeeProvider?: ProviderType; - } - - export interface DVAMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - referralOverrideCode?: string | null; - submissionAuthorityInd: string; - treatmentLocationCode?: string | null; - acceptedDisability?: AcceptedDisabilityType; - referral?: ReferralType; - patient: VeteranPatientType; - service: Array; - } - - export interface DVAServiceType extends ServiceType { - accountReferenceNumber?: string | null; - distanceKilometres?: number | null; - } - - export interface DVAClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface DVAPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface DVAProcessingReportResponseType { - claimAssessment?: DVAClaimAssessmentType; - status: string; - } - - export interface DVAClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface DVAMedicalEventAssessmentType { - patient?: VeteranMembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface VeteranMembershipStatusType { - currentMembership?: VeteranMembershipResponseType; - currentMember?: IdentityType; - status?: StatusType; - processDate?: Date | null; - } - - export interface DVAServiceAssessmentType { - id?: string | null; - accountReferenceNumber?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - gstInd?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface VeteranMembershipResponseType extends VeteranMembershipType { - entitlementCode?: string | null; - } - - export interface EnterpriseConcessionVerificationRequestType { - timeout?: number | null; - concessionVerificationRequest: Array; - } - - export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { - id: string; - } - - export interface ConcessionVerificationRequestType { - patient: MedicarePatientType; - dateOfService?: Date | null; - } - - export interface EnterpriseConcessionVerificationResponseType { - status: string; - concessionVerificationResponse?: Array; - } - - export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { - id: string; - } - - export interface ConcessionVerificationResponseType { - medicareStatus: MembershipStatusType; - concessionStatus: ConcessionStatusType; - } - - export interface ConcessionStatusType { - status?: StatusType; - processDate?: Date | null; - } - - export interface EnterprisePatientVerificationRequestType { - timeout?: number | null; - patientVerificationRequest: Array; - } - - export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { - id: string; - } - - export interface PatientVerificationRequestType { - patient: FundPatientType; - provider?: ProviderType; - dateOfService?: Date | null; - typeCode: string; - } - - export interface FundPatientType extends PatientType { - alsoKnownAs?: IdentityType; - medicare?: MembershipType; - healthFund?: FundMembershipType; - } - - export interface FundMembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - organisation?: string | null; - } - - export interface EnterprisePatientVerificationResponseType { - status: string; - patientVerificationResponse?: Array; - } - - export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { - id: string; - } - - export interface PatientVerificationResponseType { - medicareStatus?: MembershipStatusType; - healthFundStatus?: FundMembershipStatusType; - } - - export interface FundMembershipStatusType { - status?: StatusType; - currentMembership?: FundMembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface EnterpriseVeteranVerificationRequestType { - timeout?: number | null; - veteranVerificationRequest: Array; - } - - export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { - id: string; - } - - export interface VeteranVerificationRequestType { - patient: VeteranPatientType; - } - - export interface EnterpriseVeteranVerificationResponseType { - status: string; - veteranVerificationResponse?: Array; - } - - export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { - id?: string | null; - } - - export interface VeteranVerificationResponseType { - veteranStatus?: VeteranMembershipStatusType; - } - - export interface PatientClaimInteractiveRequestType { - patientClaimInteractive: PatientClaimInteractiveType; - } - - export interface PatientClaimInteractiveType { - patient: MedicarePatientType; - referral?: ReferralType; - claimant: ClaimantType; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - referralOverrideCode?: string | null; - accountPaidInd: string; - accountReferenceId?: string | null; - submissionAuthorityInd: string; - authorisationDate: Date; - } - - export interface PCIMedicalEventType { - service: Array; - id: string; - medicalEventDate: Date; - medicalEventTime?: string | null; - } - - export interface PCIServiceType extends ServiceType { - patientContribAmount?: string | null; - facilityId?: string | null; - hospitalInd?: string | null; - } - - export interface ClaimantType extends MedicarePatientType { - eftDetails?: BankAccountType; - residentialAddress?: AddressType; - contactDetails?: ContactType; - } - - export interface ContactType { - emailAddress?: string | null; - name?: string | null; - phoneNumber?: string | null; - } - - export interface PatientClaimInteractiveResponseType { - claimAssessment: PCIAssessmentType; - status: string; - } - - export interface PCIAssessmentType { - claimant?: CurrentMembershipType; - patient?: CurrentMembershipType; - medicalEvent?: Array; - error?: StatusType; - claimId: string; - } - - export interface CurrentMembershipType { - currentMembership: MembershipType; - } - - export interface PCIMedicalEventResponseType { - service?: Array; - eventDate?: Date | null; - id?: string | null; - } - - export interface RetrieveReportRequestType { - transactionId: Array; - } - - export interface RetrieveReportResponseType { - content?: Array; - } - - export interface ContentType { - transactionId?: string | null; - status?: string | null; - } - - export interface EnterpriseConcessionVerificationReportContentType extends ContentType { - report?: EnterpriseConcessionVerificationResponseType; - } - - export interface EnterprisePatientVerificationReportContentType extends ContentType { - report?: EnterprisePatientVerificationResponseType; - } - - export interface EnterpriseVeteranVerificationReportContentType extends ContentType { - report?: EnterpriseVeteranVerificationResponseType; - } - - export interface SameDayDeleteRequestType { - sameDayDelete: SameDayDeleteType; - } - - export interface SameDayDeleteType { - patient: MedicarePatientType; - reasonCode: string; - } - - export interface SameDayDeleteResponseType { - status: string; - } - - export interface StatusReportRequestType { - transactionId?: Array; - associateName?: string | null; - fromDateTime?: Date | null; - toDateTime?: Date | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - status?: string | null; - } - - export interface StatusReportResponseType { - transactionStatus?: Array; - status: string; - } - - export interface TransactionStatusType { - associateName?: string | null; - lodgementDateTime?: Date | null; - processStatus?: string | null; - reference?: string | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - transactionId?: string | null; - } - - export class McpClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This is the request - * Post mcp/bulkbillpaymentreport/v1 - * @return {BBSPaymentReportResponseType} successful operation - */ - McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/bulkbillpaymentreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillprocessingreport/v1 - * @return {BBSProcessingReportResponseType} successful operation - */ - McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/bulkbillprocessingreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/general/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return fetch(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/pathology/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return fetch(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/specialist/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { - return fetch(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/allied/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/communitynursing/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/dental/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/optical/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/psych/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/speechpathology/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/general/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaclaim/general/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/pathology/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaclaim/pathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaclaim/specialist/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaclaim/specialist/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvapaymentreport/v1 - * @return {DVAPaymentReportResponseType} successful operation - */ - McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvapaymentreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/dvaprocessingreport/v1 - * @return {DVAProcessingReportResponseType} successful operation - */ - McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/dvaprocessingreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/v1 - * @return {EnterpriseConcessionVerificationResponseType} successful operation - */ - McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Promise { - return fetch(this.baseUri + 'mcp/enterpriseconcessionverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/v1 - * @return {EnterprisePatientVerificationResponseType} successful operation - */ - McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Promise { - return fetch(this.baseUri + 'mcp/enterprisepatientverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/v1 - * @return {EnterpriseVeteranVerificationResponseType} successful operation - */ - McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Promise { - return fetch(this.baseUri + 'mcp/enterpriseveteranverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/general/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return fetch(this.baseUri + 'mcp/patientclaiminteractive/general/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/pathology/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return fetch(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/specialist/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { - return fetch(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Promise { - return fetch(this.baseUri + 'mcp/patientverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/hf/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Promise { - return fetch(this.baseUri + 'mcp/patientverification/hf/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/patientverification/medicare/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Promise { - return fetch(this.baseUri + 'mcp/patientverification/medicare/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/samedaydelete/v1 - * @return {SameDayDeleteResponseType} successful operation - */ - McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Promise { - return fetch(this.baseUri + 'mcp/samedaydelete/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/statusreport/v1 - * @return {StatusReportResponseType} successful operation - */ - McpStatusReport1Eigw(requestBody: StatusReportRequestType): Promise { - return fetch(this.baseUri + 'mcp/statusreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This is the request - * Post mcp/veteranverification/v1 - * @return {VeteranVerificationResponseType} successful operation - */ - McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Promise { - return fetch(this.baseUri + 'mcp/veteranverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + export interface BBSReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface ProviderType { + providerNumber: string; + } + + export interface BBSPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface PaymentRunType { + payerName?: string | null; + runDate?: Date | null; + runNumber?: string | null; + } + + export interface PaymentType { + accountInfo: BankAccountType; + depositAmount?: string | null; + paymentReference?: string | null; + } + + export interface BankAccountType { + accountName?: string | null; + accountNumber?: string | null; + bsbCode?: string | null; + } + + export interface ClaimSummaryType { + accountReferenceId?: string | null; + benefit?: string | null; + chargeAmount?: string | null; + claimChannelCode?: string | null; + claimId?: string | null; + lodgementDate?: Date | null; + transactionId?: string | null; + } + + export interface ServiceMessagesType { + highestSeverity: ServiceMessagesTypeHighestSeverity; + serviceMessage: Array; + } + + export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } + + export interface ServiceMessageType { + code: string; + severity: ServiceMessagesTypeHighestSeverity; + reason: string; + } + + export interface BBSProcessingReportResponseType { + claimAssessment?: ClaimAssessmentType; + status: string; + } + + export interface ClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface MedicalEventResponseType { + patient?: MembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface MembershipStatusType { + status?: StatusType; + currentMembership?: MembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface StatusType { + code?: number | null; + text?: string | null; + } + + export interface MembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + } + + export interface IdentityType { + dateOfBirth?: Date | null; + familyName?: string | null; + givenName?: string | null; + secondInitial?: string | null; + sex?: string | null; + } + + export interface ServiceResponseType { + error?: StatusType; + id?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface BulkBillStoreForwardRequestType { + claim: BulkBillClaimStoreForwardClaimType; + } + + export interface BulkBillClaimStoreForwardClaimType { + facilityId?: string | null; + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface BBSMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + medicalEventDate: Date; + medicalEventTime?: string | null; + patient: MedicarePatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface MedicarePatientType { + identity: IdentityType; + medicare: MembershipType; + } + + export interface ReferralType { + issueDate: Date; + period?: string | null; + periodCode?: string | null; + provider: ProviderType; + typeCode: string; + } + + export interface ServiceType { + id: string; + accessionDateTime?: Date | null; + aftercareOverrideInd?: string | null; + chargeAmount?: string | null; + collectionDateTime?: Date | null; + duplicateServiceOverrideInd?: string | null; + fieldQuantity?: string | null; + itemNumber?: string | null; + lspNumber?: string | null; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + restrictiveOverrideCode?: string | null; + rule3ExemptInd?: string | null; + s4b3ExemptInd?: string | null; + scpId?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + } + + export interface BulkBillStoreForwardResponseType { + claimId: string; + status: string; + } + + export interface AlliedHealthClaimRequestType { + claim: VAAClaimType; + } + + export interface VAAClaimType { + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface VAAMedicalEventType { + id: string; + acceptedDisability?: AcceptedDisabilityType; + authorisationDate: Date; + breakInEpisodeEndDate?: Date | null; + breakInEpisodeOfCareNumber?: string | null; + breakInEpisodeStartDate?: Date | null; + numberOfCNCHours?: string | null; + numberOfCNCVisits?: string | null; + createDateTime: Date; + numberOfENHours?: string | null; + numberOfENVisits?: string | null; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + numberOfNSSHours?: string | null; + numberOfNSSVisits?: string | null; + patient: VeteranPatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + numberOfRNHours?: string | null; + numberOfRNVisits?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface AcceptedDisabilityType { + code: string; + ind: string; + } + + export interface VAAServiceType { + id: string; + accountReferenceNumber?: string | null; + admissionDate?: Date | null; + chargeAmount?: string | null; + dischargeDate?: Date | null; + distanceKilometres?: number | null; + duplicateServiceOverrideInd?: string | null; + itemNumber: string; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + numberOfTeeth?: string | null; + opticalScriptCode?: string | null; + restrictiveOverrideCode?: string | null; + secondDeviceInd?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + toothNumber?: string | null; + upperLowerJawCode?: string | null; + } + + export interface VeteranPatientType extends PatientType { + veteranMembership?: VeteranMembershipType; + } + + export interface VeteranMembershipType { + veteranNumber: string; + } + + export interface PatientType { + identity: IdentityType; + residentialAddress?: AddressType; + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postcode?: string | null; + } + + export interface AlliedHealthClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAClaimRequestType { + claim: DVAClaimType; + } + + export interface DVAClaimType { + hospitalInd?: string | null; + serviceTypeCode: string; + medicalEvent: Array; + serviceProvider: ProviderType; + payeeProvider?: ProviderType; + } + + export interface DVAMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + referralOverrideCode?: string | null; + submissionAuthorityInd: string; + treatmentLocationCode?: string | null; + acceptedDisability?: AcceptedDisabilityType; + referral?: ReferralType; + patient: VeteranPatientType; + service: Array; + } + + export interface DVAServiceType extends ServiceType { + accountReferenceNumber?: string | null; + distanceKilometres?: number | null; + } + + export interface DVAClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface DVAPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface DVAProcessingReportResponseType { + claimAssessment?: DVAClaimAssessmentType; + status: string; + } + + export interface DVAClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface DVAMedicalEventAssessmentType { + patient?: VeteranMembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface VeteranMembershipStatusType { + currentMembership?: VeteranMembershipResponseType; + currentMember?: IdentityType; + status?: StatusType; + processDate?: Date | null; + } + + export interface DVAServiceAssessmentType { + id?: string | null; + accountReferenceNumber?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + gstInd?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface VeteranMembershipResponseType extends VeteranMembershipType { + entitlementCode?: string | null; + } + + export interface EnterpriseConcessionVerificationRequestType { + timeout?: number | null; + concessionVerificationRequest: Array; + } + + export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { + id: string; + } + + export interface ConcessionVerificationRequestType { + patient: MedicarePatientType; + dateOfService?: Date | null; + } + + export interface EnterpriseConcessionVerificationResponseType { + status: string; + concessionVerificationResponse?: Array; + } + + export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { + id: string; + } + + export interface ConcessionVerificationResponseType { + medicareStatus: MembershipStatusType; + concessionStatus: ConcessionStatusType; + } + + export interface ConcessionStatusType { + status?: StatusType; + processDate?: Date | null; + } + + export interface EnterprisePatientVerificationRequestType { + timeout?: number | null; + patientVerificationRequest: Array; + } + + export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { + id: string; + } + + export interface PatientVerificationRequestType { + patient: FundPatientType; + provider?: ProviderType; + dateOfService?: Date | null; + typeCode: string; + } + + export interface FundPatientType extends PatientType { + alsoKnownAs?: IdentityType; + medicare?: MembershipType; + healthFund?: FundMembershipType; + } + + export interface FundMembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + organisation?: string | null; + } + + export interface EnterprisePatientVerificationResponseType { + status: string; + patientVerificationResponse?: Array; + } + + export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { + id: string; + } + + export interface PatientVerificationResponseType { + medicareStatus?: MembershipStatusType; + healthFundStatus?: FundMembershipStatusType; + } + + export interface FundMembershipStatusType { + status?: StatusType; + currentMembership?: FundMembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface EnterpriseVeteranVerificationRequestType { + timeout?: number | null; + veteranVerificationRequest: Array; + } + + export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { + id: string; + } + + export interface VeteranVerificationRequestType { + patient: VeteranPatientType; + } + + export interface EnterpriseVeteranVerificationResponseType { + status: string; + veteranVerificationResponse?: Array; + } + + export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { + id?: string | null; + } + + export interface VeteranVerificationResponseType { + veteranStatus?: VeteranMembershipStatusType; + } + + export interface PatientClaimInteractiveRequestType { + patientClaimInteractive: PatientClaimInteractiveType; + } + + export interface PatientClaimInteractiveType { + patient: MedicarePatientType; + referral?: ReferralType; + claimant: ClaimantType; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + referralOverrideCode?: string | null; + accountPaidInd: string; + accountReferenceId?: string | null; + submissionAuthorityInd: string; + authorisationDate: Date; + } + + export interface PCIMedicalEventType { + service: Array; + id: string; + medicalEventDate: Date; + medicalEventTime?: string | null; + } + + export interface PCIServiceType extends ServiceType { + patientContribAmount?: string | null; + facilityId?: string | null; + hospitalInd?: string | null; + } + + export interface ClaimantType extends MedicarePatientType { + eftDetails?: BankAccountType; + residentialAddress?: AddressType; + contactDetails?: ContactType; + } + + export interface ContactType { + emailAddress?: string | null; + name?: string | null; + phoneNumber?: string | null; + } + + export interface PatientClaimInteractiveResponseType { + claimAssessment: PCIAssessmentType; + status: string; + } + + export interface PCIAssessmentType { + claimant?: CurrentMembershipType; + patient?: CurrentMembershipType; + medicalEvent?: Array; + error?: StatusType; + claimId: string; + } + + export interface CurrentMembershipType { + currentMembership: MembershipType; + } + + export interface PCIMedicalEventResponseType { + service?: Array; + eventDate?: Date | null; + id?: string | null; + } + + export interface RetrieveReportRequestType { + transactionId: Array; + } + + export interface RetrieveReportResponseType { + content?: Array; + } + + export interface ContentType { + transactionId?: string | null; + status?: string | null; + } + + export interface EnterpriseConcessionVerificationReportContentType extends ContentType { + report?: EnterpriseConcessionVerificationResponseType; + } + + export interface EnterprisePatientVerificationReportContentType extends ContentType { + report?: EnterprisePatientVerificationResponseType; + } + + export interface EnterpriseVeteranVerificationReportContentType extends ContentType { + report?: EnterpriseVeteranVerificationResponseType; + } + + export interface SameDayDeleteRequestType { + sameDayDelete: SameDayDeleteType; + } + + export interface SameDayDeleteType { + patient: MedicarePatientType; + reasonCode: string; + } + + export interface SameDayDeleteResponseType { + status: string; + } + + export interface StatusReportRequestType { + transactionId?: Array; + associateName?: string | null; + fromDateTime?: Date | null; + toDateTime?: Date | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + status?: string | null; + } + + export interface StatusReportResponseType { + transactionStatus?: Array; + status: string; + } + + export interface TransactionStatusType { + associateName?: string | null; + lodgementDateTime?: Date | null; + processStatus?: string | null; + reference?: string | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + transactionId?: string | null; + } + + export class McpClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This is the request + * Post mcp/bulkbillpaymentreport/v1 + * @return {BBSPaymentReportResponseType} successful operation + */ + McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/bulkbillpaymentreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillprocessingreport/v1 + * @return {BBSProcessingReportResponseType} successful operation + */ + McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/bulkbillprocessingreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/general/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return fetch(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/pathology/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return fetch(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/specialist/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Promise { + return fetch(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/allied/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/communitynursing/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/dental/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/optical/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/psych/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/speechpathology/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/general/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaclaim/general/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/pathology/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaclaim/pathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaclaim/specialist/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaclaim/specialist/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvapaymentreport/v1 + * @return {DVAPaymentReportResponseType} successful operation + */ + McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvapaymentreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/dvaprocessingreport/v1 + * @return {DVAProcessingReportResponseType} successful operation + */ + McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/dvaprocessingreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/v1 + * @return {EnterpriseConcessionVerificationResponseType} successful operation + */ + McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Promise { + return fetch(this.baseUri + 'mcp/enterpriseconcessionverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/v1 + * @return {EnterprisePatientVerificationResponseType} successful operation + */ + McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Promise { + return fetch(this.baseUri + 'mcp/enterprisepatientverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/v1 + * @return {EnterpriseVeteranVerificationResponseType} successful operation + */ + McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Promise { + return fetch(this.baseUri + 'mcp/enterpriseveteranverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/general/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return fetch(this.baseUri + 'mcp/patientclaiminteractive/general/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/pathology/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return fetch(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/specialist/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Promise { + return fetch(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Promise { + return fetch(this.baseUri + 'mcp/patientverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/hf/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Promise { + return fetch(this.baseUri + 'mcp/patientverification/hf/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/patientverification/medicare/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Promise { + return fetch(this.baseUri + 'mcp/patientverification/medicare/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/samedaydelete/v1 + * @return {SameDayDeleteResponseType} successful operation + */ + McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Promise { + return fetch(this.baseUri + 'mcp/samedaydelete/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/statusreport/v1 + * @return {StatusReportResponseType} successful operation + */ + McpStatusReport1Eigw(requestBody: StatusReportRequestType): Promise { + return fetch(this.baseUri + 'mcp/statusreport/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This is the request + * Post mcp/veteranverification/v1 + * @return {VeteranVerificationResponseType} successful operation + */ + McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Promise { + return fetch(this.baseUri + 'mcp/veteranverification/v1', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/redocOpenApi200501.txt b/Tests/SwagTsTests/FetchResults/redocOpenApi200501.ts similarity index 96% rename from Tests/SwagTsTests/FetchResults/redocOpenApi200501.txt rename to Tests/SwagTsTests/FetchResults/redocOpenApi200501.ts index 4b7dbfd7..879f9580 100644 --- a/Tests/SwagTsTests/FetchResults/redocOpenApi200501.txt +++ b/Tests/SwagTsTests/FetchResults/redocOpenApi200501.ts @@ -1,420 +1,420 @@ -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1.0 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1.0 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @return {void} - */ - AddPet(): Promise { - return fetch(this.baseUri + 'pet', { method: 'post' }); - } - - /** - * Update an existing pet - * Put pet - * @return {void} - */ - UpdatePet(): Promise { - return fetch(this.baseUri + 'pet', { method: 'put' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Promise { - return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Promise> { - return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Promise> { - return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class StoreClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Promise<{[id: string]: number }> { - return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Promise { - return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1.0 Maximum: 5.0 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1.0 - * @return {void} - */ - DeleteOrder(orderId: string): Promise { - return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); - } - - /** - * Subscribe to the Store events - * Add subscription for a store events - * Post store/subscribe - * @return {void} - */ - Subscribe(requestBody: SubscribePostBody): Promise { - return fetch(this.baseUri + 'store/subscribe', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class UserClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Promise { - return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Promise { - return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @return {void} - */ - CreateUsersWithArrayInput(): Promise { - return fetch(this.baseUri + 'user/createWithArray', { method: 'post' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @return {void} - */ - CreateUsersWithListInput(): Promise { - return fetch(this.baseUri + 'user/createWithList', { method: 'post' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Promise { - return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Promise { - return fetch(this.baseUri + 'user/logout', { method: 'get' }); - } - } - - export interface SubscribePostBody { - - /** - * This URL will be called by the server when the desired event will occur - * Required - */ - callbackUrl: string; - - /** - * Event name for the subscription - * Required - */ - eventName: SubscribePostBodyEventName; - } - - export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } - -} - +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1.0 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1.0 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @return {void} + */ + AddPet(): Promise { + return fetch(this.baseUri + 'pet', { method: 'post' }); + } + + /** + * Update an existing pet + * Put pet + * @return {void} + */ + UpdatePet(): Promise { + return fetch(this.baseUri + 'pet', { method: 'put' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Promise { + return fetch(this.baseUri + 'pet/' + petId, { method: 'delete' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Promise> { + return fetch(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Promise> { + return fetch(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class StoreClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Promise<{[id: string]: number }> { + return fetch(this.baseUri + 'store/inventory', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Promise { + return fetch(this.baseUri + 'store/order', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1.0 Maximum: 5.0 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + orderId, { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1.0 + * @return {void} + */ + DeleteOrder(orderId: string): Promise { + return fetch(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { method: 'delete' }); + } + + /** + * Subscribe to the Store events + * Add subscription for a store events + * Post store/subscribe + * @return {void} + */ + Subscribe(requestBody: SubscribePostBody): Promise { + return fetch(this.baseUri + 'store/subscribe', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class UserClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Promise { + return fetch(this.baseUri + 'user', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Promise { + return fetch(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { method: 'delete' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @return {void} + */ + CreateUsersWithArrayInput(): Promise { + return fetch(this.baseUri + 'user/createWithArray', { method: 'post' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @return {void} + */ + CreateUsersWithListInput(): Promise { + return fetch(this.baseUri + 'user/createWithList', { method: 'post' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Promise { + return fetch(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { method: 'get' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Promise { + return fetch(this.baseUri + 'user/logout', { method: 'get' }); + } + } + + export interface SubscribePostBody { + + /** + * This URL will be called by the server when the desired event will occur + * Required + */ + callbackUrl: string; + + /** + * Event name for the subscription + * Required + */ + eventName: SubscribePostBodyEventName; + } + + export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_account.txt b/Tests/SwagTsTests/FetchResults/sell_account.ts similarity index 99% rename from Tests/SwagTsTests/FetchResults/sell_account.txt rename to Tests/SwagTsTests/FetchResults/sell_account.ts index a99bc553..66aa6eb2 100644 --- a/Tests/SwagTsTests/FetchResults/sell_account.txt +++ b/Tests/SwagTsTests/FetchResults/sell_account.ts @@ -1,1152 +1,1152 @@ -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ - export interface CategoryType { - - /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ - default?: boolean | null; - - /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ - name?: string | null; - } - - - /** A container that describes the details of a deposit. Used only with motor listings. */ - export interface Deposit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - dueIn?: TimeDuration; - - /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ - paymentMethods?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ - export interface PaymentMethod { - - /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ - brands?: Array; - - /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ - paymentMethodType?: string | null; - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - recipientAccountReference?: RecipientAccountReference; - } - - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - export interface RecipientAccountReference { - - /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ - referenceId?: string | null; - - /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ - referenceType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface FulfillmentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ - export interface ShippingOption { - - /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ - costType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - insuranceFee?: Amount; - - /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ - insuranceOffered?: boolean | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ - optionType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - packageHandlingCost?: Amount; - - /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ - rateTableId?: string | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ - shippingServices?: Array; - } - - - /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ - export interface ShippingService { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalShippingCost?: Amount; - - /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForPickup?: boolean | null; - - /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForShipping?: boolean | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - cashOnDeliveryFee?: Amount; - - /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ - freeShipping?: boolean | null; - - /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ - shippingCarrierCode?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - shippingCost?: Amount; - - /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ - shippingServiceCode?: string | null; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** - * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - sortOrder?: number | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - surcharge?: Amount; - } - - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - export interface RegionSet { - - /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ - regionExcluded?: Array; - - /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ - regionIncluded?: Array; - } - - - /** This type defines information for a region. */ - export interface Region { - - /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ - regionName?: string | null; - - /** Reserved for future use. For implementation help, refer to eBay API documentation */ - regionType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface FulfillmentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** The response payload for requests that return a list of fulfillment policies. */ - export interface FulfillmentPolicyResponse { - - /** A list of the seller's fulfillment policies. */ - fulfillmentPolicies?: Array; - - /** Returns a URL link to the result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - export interface InternationalReturnOverrideType { - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ - returnsAccepted?: boolean | null; - - /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface PaymentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - } - - - /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface PaymentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - } - - - /** The response payload for payment policy requests. */ - export interface PaymentPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** A list of the seller's payment policies. */ - paymentPolicies?: Array; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object containing the sellers status with regards to the specified payment program. */ - export interface PaymentsProgramResponse { - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ - paymentsProgramType?: string | null; - - /** For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ - wasPreviouslyOptedIn?: boolean | null; - } - - - /** A seller program in to which a seller can opt-in. */ - export interface Program { - - /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ - programType?: string | null; - } - - - /** A list of the supported seller programs. */ - export interface Programs { - - /** A list of seller programs. */ - programs?: Array; - } - - - /** A complex type that contains information pertaining to a shipping rate table. */ - export interface RateTable { - - /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ - locality?: string | null; - - /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ - name?: string | null; - - /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ - rateTableId?: string | null; - } - - - /** The response container for with information on a seller's shipping rate tables. */ - export interface RateTableResponse { - - /** A list of elements that provide information on the seller-defined shipping rate tables. */ - rateTables?: Array; - } - - - /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface ReturnPolicy { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface ReturnPolicyRequest { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** The response payload for return policy requests. */ - export interface ReturnPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** A list of the seller's return policies. */ - returnPolicies?: Array; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ - export interface SalesTax { - - /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ - salesTaxJurisdictionId?: string | null; - - /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A container that describes the how the sales tax rate is calculated. */ - export interface SalesTaxBase { - - /** The sales tax rate, as a percentage of the sale. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A list of sales tax tables. */ - export interface SalesTaxes { - - /** A list of sales tax tables that have been set up by a seller. */ - salesTaxes?: Array; - } - - - /** Defines the selling limit applied to an eBay seller's account. */ - export interface SellingLimit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** - * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A merchant's selling limit, and the status of their account registration. */ - export interface SellingPrivileges { - - /** If set to true, the seller's registration is completed. */ - sellerRegistrationCompleted?: boolean | null; - - /** Defines the selling limit applied to an eBay seller's account. */ - sellingLimit?: SellingLimit; - } - - - /** Complex type that that gets populated with a response containing a fulfillment policy. */ - export interface SetFulfillmentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** Complex type that that gets populated with a response containing a payment policy. */ - export interface SetPaymentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** Complex type that that gets populated with a response containing a return policy. */ - export interface SetReturnPolicyResponse { - - /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ - restockingFeePercentage?: string | null; - - /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ - returnInstructions?: string | null; - - /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - export class Fulfillment_policyClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {FulfillmentPolicyResponse} Success - */ - GetFulfillmentPolicies(marketplace_id: string): Promise { - return fetch(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post fulfillment_policy/ - * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. - * @return {void} - */ - CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Promise { - return fetch(this.baseUri + 'fulfillment_policy/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. - * Get fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicy(fulfillmentPolicyId: string): Promise { - return fetch(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. - * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request - * @return {SetFulfillmentPolicyResponse} OK - */ - UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Promise { - return fetch(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. - * Delete fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. - * @return {void} - */ - DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Promise { - return fetch(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { method: 'delete' }); - } - - /** - * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicyByName(marketplace_id: string, name: string): Promise { - return fetch(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Payment_policyClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {PaymentPolicyResponse} Success - */ - GetPaymentPolicies(marketplace_id: string): Promise { - return fetch(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post payment_policy/ - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {void} - */ - CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Promise { - return fetch(this.baseUri + 'payment_policy/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. - * Get payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicy(payment_policy_id: string): Promise { - return fetch(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {SetPaymentPolicyResponse} OK - */ - UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Promise { - return fetch(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. - * Delete payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. - * @return {void} - */ - DeletePaymentPolicy(payment_policy_id: string): Promise { - return fetch(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { method: 'delete' }); - } - - /** - * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicyByName(marketplace_id: string, name: string): Promise { - return fetch(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Payments_programClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. - * Get payments_program/{marketplace_id}/{payments_program_type} - * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. - * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. - * @return {PaymentsProgramResponse} Success - */ - GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Promise { - return fetch(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class PrivilegeClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). - * Get privilege/ - * @return {SellingPrivileges} Success - */ - GetPrivileges(): Promise { - return fetch(this.baseUri + 'privilege/', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class ProgramClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method gets a list of the seller programs that the seller has opted-in to. - * Get program/get_opted_in_programs - * @return {Programs} Success - */ - GetOptedInPrograms(): Promise { - return fetch(this.baseUri + 'program/get_opted_in_programs', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. - * Post program/opt_in - * @param {Program} requestBody Program being opted-in to. - * @return {string} Success - */ - OptInToProgram(requestBody: Program): Promise { - return fetch(this.baseUri + 'program/opt_in', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. - * Post program/opt_out - * @param {Program} requestBody Program being opted-out of. - * @return {string} Success - */ - OptOutOfProgram(requestBody: Program): Promise { - return fetch(this.baseUri + 'program/opt_out', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - } - - export class Rate_tableClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. - * Get rate_table/ - * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {RateTableResponse} Success - */ - GetRateTables(country_code: string | null | undefined): Promise { - return fetch(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Return_policyClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/ - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(marketplace_id: string): Promise { - return fetch(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post return_policy/ - * @param {ReturnPolicyRequest} requestBody Return policy request - * @return {void} - */ - CreateReturnPolicy(requestBody: ReturnPolicyRequest): Promise { - return fetch(this.baseUri + 'return_policy/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. - * Get return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicy(return_policy_id: string): Promise { - return fetch(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. - * @param {ReturnPolicyRequest} requestBody Container for a return policy request. - * @return {SetReturnPolicyResponse} OK - */ - UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Promise { - return fetch(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. - * Delete return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. - * @return {void} - */ - DeleteReturnPolicy(return_policy_id: string): Promise { - return fetch(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { method: 'delete' }); - } - - /** - * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicyByName(marketplace_id: string, name: string): Promise { - return fetch(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Sales_taxClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. - * Get sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. - * @return {SalesTax} Success - */ - GetSalesTax(countryCode: string, jurisdictionId: string): Promise { - return fetch(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. - * Put sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. - * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. - * @return {void} - */ - CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Promise { - return fetch(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. - * Delete sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. - * @return {void} - */ - DeleteSalesTax(countryCode: string, jurisdictionId: string): Promise { - return fetch(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { method: 'delete' }); - } - - /** - * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. - * Get sales_tax/ - * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {SalesTaxes} Success - */ - GetSalesTaxes(country_code: string): Promise { - return fetch(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ + export interface CategoryType { + + /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ + default?: boolean | null; + + /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ + name?: string | null; + } + + + /** A container that describes the details of a deposit. Used only with motor listings. */ + export interface Deposit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + dueIn?: TimeDuration; + + /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ + paymentMethods?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ + export interface PaymentMethod { + + /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ + brands?: Array; + + /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ + paymentMethodType?: string | null; + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + recipientAccountReference?: RecipientAccountReference; + } + + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + export interface RecipientAccountReference { + + /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ + referenceId?: string | null; + + /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ + referenceType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface FulfillmentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ + export interface ShippingOption { + + /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ + costType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + insuranceFee?: Amount; + + /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ + insuranceOffered?: boolean | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ + optionType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + packageHandlingCost?: Amount; + + /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ + rateTableId?: string | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ + shippingServices?: Array; + } + + + /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ + export interface ShippingService { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalShippingCost?: Amount; + + /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForPickup?: boolean | null; + + /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForShipping?: boolean | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + cashOnDeliveryFee?: Amount; + + /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ + freeShipping?: boolean | null; + + /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ + shippingCarrierCode?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + shippingCost?: Amount; + + /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ + shippingServiceCode?: string | null; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** + * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + sortOrder?: number | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + surcharge?: Amount; + } + + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + export interface RegionSet { + + /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ + regionExcluded?: Array; + + /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ + regionIncluded?: Array; + } + + + /** This type defines information for a region. */ + export interface Region { + + /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ + regionName?: string | null; + + /** Reserved for future use. For implementation help, refer to eBay API documentation */ + regionType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface FulfillmentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** The response payload for requests that return a list of fulfillment policies. */ + export interface FulfillmentPolicyResponse { + + /** A list of the seller's fulfillment policies. */ + fulfillmentPolicies?: Array; + + /** Returns a URL link to the result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + export interface InternationalReturnOverrideType { + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ + returnsAccepted?: boolean | null; + + /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface PaymentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + } + + + /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface PaymentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + } + + + /** The response payload for payment policy requests. */ + export interface PaymentPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** A list of the seller's payment policies. */ + paymentPolicies?: Array; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object containing the sellers status with regards to the specified payment program. */ + export interface PaymentsProgramResponse { + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ + paymentsProgramType?: string | null; + + /** For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ + wasPreviouslyOptedIn?: boolean | null; + } + + + /** A seller program in to which a seller can opt-in. */ + export interface Program { + + /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ + programType?: string | null; + } + + + /** A list of the supported seller programs. */ + export interface Programs { + + /** A list of seller programs. */ + programs?: Array; + } + + + /** A complex type that contains information pertaining to a shipping rate table. */ + export interface RateTable { + + /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ + locality?: string | null; + + /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ + name?: string | null; + + /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ + rateTableId?: string | null; + } + + + /** The response container for with information on a seller's shipping rate tables. */ + export interface RateTableResponse { + + /** A list of elements that provide information on the seller-defined shipping rate tables. */ + rateTables?: Array; + } + + + /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface ReturnPolicy { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface ReturnPolicyRequest { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** The response payload for return policy requests. */ + export interface ReturnPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** A list of the seller's return policies. */ + returnPolicies?: Array; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ + export interface SalesTax { + + /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ + salesTaxJurisdictionId?: string | null; + + /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A container that describes the how the sales tax rate is calculated. */ + export interface SalesTaxBase { + + /** The sales tax rate, as a percentage of the sale. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A list of sales tax tables. */ + export interface SalesTaxes { + + /** A list of sales tax tables that have been set up by a seller. */ + salesTaxes?: Array; + } + + + /** Defines the selling limit applied to an eBay seller's account. */ + export interface SellingLimit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** + * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A merchant's selling limit, and the status of their account registration. */ + export interface SellingPrivileges { + + /** If set to true, the seller's registration is completed. */ + sellerRegistrationCompleted?: boolean | null; + + /** Defines the selling limit applied to an eBay seller's account. */ + sellingLimit?: SellingLimit; + } + + + /** Complex type that that gets populated with a response containing a fulfillment policy. */ + export interface SetFulfillmentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** Complex type that that gets populated with a response containing a payment policy. */ + export interface SetPaymentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** Complex type that that gets populated with a response containing a return policy. */ + export interface SetReturnPolicyResponse { + + /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ + restockingFeePercentage?: string | null; + + /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ + returnInstructions?: string | null; + + /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + export class Fulfillment_policyClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {FulfillmentPolicyResponse} Success + */ + GetFulfillmentPolicies(marketplace_id: string): Promise { + return fetch(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post fulfillment_policy/ + * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. + * @return {void} + */ + CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Promise { + return fetch(this.baseUri + 'fulfillment_policy/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. + * Get fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicy(fulfillmentPolicyId: string): Promise { + return fetch(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. + * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request + * @return {SetFulfillmentPolicyResponse} OK + */ + UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Promise { + return fetch(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. + * Delete fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. + * @return {void} + */ + DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Promise { + return fetch(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { method: 'delete' }); + } + + /** + * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicyByName(marketplace_id: string, name: string): Promise { + return fetch(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Payment_policyClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {PaymentPolicyResponse} Success + */ + GetPaymentPolicies(marketplace_id: string): Promise { + return fetch(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post payment_policy/ + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {void} + */ + CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Promise { + return fetch(this.baseUri + 'payment_policy/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. + * Get payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicy(payment_policy_id: string): Promise { + return fetch(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {SetPaymentPolicyResponse} OK + */ + UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Promise { + return fetch(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. + * Delete payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. + * @return {void} + */ + DeletePaymentPolicy(payment_policy_id: string): Promise { + return fetch(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { method: 'delete' }); + } + + /** + * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicyByName(marketplace_id: string, name: string): Promise { + return fetch(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Payments_programClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. + * Get payments_program/{marketplace_id}/{payments_program_type} + * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. + * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. + * @return {PaymentsProgramResponse} Success + */ + GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Promise { + return fetch(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class PrivilegeClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). + * Get privilege/ + * @return {SellingPrivileges} Success + */ + GetPrivileges(): Promise { + return fetch(this.baseUri + 'privilege/', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class ProgramClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method gets a list of the seller programs that the seller has opted-in to. + * Get program/get_opted_in_programs + * @return {Programs} Success + */ + GetOptedInPrograms(): Promise { + return fetch(this.baseUri + 'program/get_opted_in_programs', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. + * Post program/opt_in + * @param {Program} requestBody Program being opted-in to. + * @return {string} Success + */ + OptInToProgram(requestBody: Program): Promise { + return fetch(this.baseUri + 'program/opt_in', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. + * Post program/opt_out + * @param {Program} requestBody Program being opted-out of. + * @return {string} Success + */ + OptOutOfProgram(requestBody: Program): Promise { + return fetch(this.baseUri + 'program/opt_out', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + } + + export class Rate_tableClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. + * Get rate_table/ + * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {RateTableResponse} Success + */ + GetRateTables(country_code: string | null | undefined): Promise { + return fetch(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Return_policyClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/ + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(marketplace_id: string): Promise { + return fetch(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post return_policy/ + * @param {ReturnPolicyRequest} requestBody Return policy request + * @return {void} + */ + CreateReturnPolicy(requestBody: ReturnPolicyRequest): Promise { + return fetch(this.baseUri + 'return_policy/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. + * Get return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicy(return_policy_id: string): Promise { + return fetch(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. + * @param {ReturnPolicyRequest} requestBody Container for a return policy request. + * @return {SetReturnPolicyResponse} OK + */ + UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Promise { + return fetch(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. + * Delete return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. + * @return {void} + */ + DeleteReturnPolicy(return_policy_id: string): Promise { + return fetch(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { method: 'delete' }); + } + + /** + * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicyByName(marketplace_id: string, name: string): Promise { + return fetch(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Sales_taxClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. + * Get sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. + * @return {SalesTax} Success + */ + GetSalesTax(countryCode: string, jurisdictionId: string): Promise { + return fetch(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. + * Put sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. + * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. + * @return {void} + */ + CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Promise { + return fetch(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. + * Delete sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. + * @return {void} + */ + DeleteSalesTax(countryCode: string, jurisdictionId: string): Promise { + return fetch(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { method: 'delete' }); + } + + /** + * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. + * Get sales_tax/ + * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {SalesTaxes} Success + */ + GetSalesTaxes(country_code: string): Promise { + return fetch(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_analytics.txt b/Tests/SwagTsTests/FetchResults/sell_analytics.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/sell_analytics.txt rename to Tests/SwagTsTests/FetchResults/sell_analytics.ts index 12273a3f..5b9af91f 100644 --- a/Tests/SwagTsTests/FetchResults/sell_analytics.txt +++ b/Tests/SwagTsTests/FetchResults/sell_analytics.ts @@ -1,380 +1,380 @@ -export namespace MyNS { - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - export interface BenchmarkMetadata { - - /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ - average?: string | null; - } - - - /** A complex type that describes a program cycle. */ - export interface Cycle { - - /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ - cycleType?: string | null; - - /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - evaluationDate?: string | null; - - /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ - evaluationMonth?: string | null; - } - - - /** A complex type that defines a dimension key and metrics in a traffic report. */ - export interface Definition { - - /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The value the dimension or metric parameter as submitted in the request. */ - key?: string | null; - - /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ - localizedName?: string | null; - } - - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - export interface Dimension { - - /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ - dimensionKey?: string | null; - - /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ - name?: string | null; - - /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ - value?: string | null; - } - - - /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ - export interface DimensionMetric { - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - dimension?: Dimension; - - /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ - metrics?: Array; - } - - - /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ - export interface Metric { - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - benchmark?: MetricBenchmark; - - /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ - distributions?: Array; - - /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ - metricKey?: string | null; - - /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ - value?: string | null; - } - - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - export interface MetricBenchmark { - - /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ - adjustment?: string | null; - - /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ - basis?: string | null; - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - metadata?: BenchmarkMetadata; - - /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ - rating?: string | null; - } - - - /** This complex data type describes the metric distribution by basis. */ - export interface MetricDistribution { - - /** This field returns the basis, or the method, by which the metric rating is calculated. */ - basis?: string | null; - - /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ - data?: Array; - } - - - /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ - export interface Distribution { - - /** The name of a distribution in which the seller is active. */ - name?: string | null; - - /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ - value?: string | null; - } - - - /** Type that defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ - category?: string | null; - - /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error than given in the message error field. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** If present, indicates which subsystem in which the error occurred. */ - subdomain?: string | null; - } - - - /** A complex type that defines an error and error message. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - export interface EvaluationCycle { - - /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - endDate?: string | null; - - /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ - evaluationDate?: string | null; - - /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ - evaluationType?: string | null; - - /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - startDate?: string | null; - } - - - /** The response container for a list of seller profiles. */ - export interface FindSellerStandardsProfilesResponse { - - /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ - standardsProfiles?: Array; - } - - - /** A complex type that defines a seller profile. */ - export interface StandardsProfile { - - /** A complex type that describes a program cycle. */ - cycle?: Cycle; - - /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ - defaultProgram?: boolean | null; - - /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ - evaluationReason?: string | null; - - /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ - metrics?: Array; - - /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ - program?: string | null; - - /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ - standardsLevel?: string | null; - } - - - /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ - export interface GetCustomerServiceMetricResponse { - - /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ - dimensionMetrics?: Array; - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - evaluationCycle?: EvaluationCycle; - - /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - export interface Header { - - /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ - dimensionKeys?: Array; - - /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ - metrics?: Array; - } - - - /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ - export interface Metadata { - - /** Type that defines the metadata header fields. */ - metadataHeader?: MetadataHeader; - - /** A list of the individual report records. */ - metadataRecords?: Array; - } - - - /** Type that defines the metadata header fields. */ - export interface MetadataHeader { - - /** The key value used for the report. For example: "key": "LISTING_ID" */ - key?: string | null; - - /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ - metadataKeys?: Array; - } - - - /** A complex type that defines the data records returned in the report. */ - export interface MetadataRecord { - - /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ - metadataValues?: Array; - - /** A complex type that contains a value, plus the veracity of that value. */ - value?: Value; - } - - - /** A complex type that contains a value, plus the veracity of that value. */ - export interface Value { - - /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ - applicable?: boolean | null; - - /** The value of the report data. */ - value?: string | null; - } - - - /** Type that defines the fields of the individual record of the report. */ - export interface Record { - - /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ - dimensionValues?: Array; - - /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ - metricValues?: Array; - } - - - /** The complex type that defines that defines the report. */ - export interface Report { - - /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ - dimensionMetadata?: Array; - - /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - endDate?: string | null; - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - header?: Header; - - /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ - lastUpdatedDate?: string | null; - - /** A complex type containing the individual data records for the traffic report. */ - records?: Array; - - /** The start date of the date range used to calculate the report, in ISO 8601 format. */ - startDate?: string | null; - - /** An array of any process errors or warnings that were generated during the processing of the call processing. */ - warnings?: Array; - } - - export class Customer_service_metricClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. - * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} - * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED - * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html - * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. - * @return {GetCustomerServiceMetricResponse} Success - */ - GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Promise { - return fetch(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Seller_standards_profileClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. - * Get seller_standards_profile - * @return {FindSellerStandardsProfilesResponse} Success - */ - FindSellerStandardsProfiles(): Promise { - return fetch(this.baseUri + 'seller_standards_profile', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. - * Get seller_standards_profile/{program}/{cycle} - * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. - * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. - * @return {StandardsProfile} Success - */ - GetSellerStandardsProfile(cycle: string, program: string): Promise { - return fetch(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Traffic_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. - * Get traffic_report - * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. - * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html - * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count - * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html - * @return {Report} Success - */ - GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Promise { - return fetch(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + export interface BenchmarkMetadata { + + /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ + average?: string | null; + } + + + /** A complex type that describes a program cycle. */ + export interface Cycle { + + /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ + cycleType?: string | null; + + /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + evaluationDate?: string | null; + + /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ + evaluationMonth?: string | null; + } + + + /** A complex type that defines a dimension key and metrics in a traffic report. */ + export interface Definition { + + /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The value the dimension or metric parameter as submitted in the request. */ + key?: string | null; + + /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ + localizedName?: string | null; + } + + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + export interface Dimension { + + /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ + dimensionKey?: string | null; + + /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ + name?: string | null; + + /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ + value?: string | null; + } + + + /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ + export interface DimensionMetric { + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + dimension?: Dimension; + + /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ + metrics?: Array; + } + + + /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ + export interface Metric { + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + benchmark?: MetricBenchmark; + + /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ + distributions?: Array; + + /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ + metricKey?: string | null; + + /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ + value?: string | null; + } + + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + export interface MetricBenchmark { + + /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ + adjustment?: string | null; + + /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ + basis?: string | null; + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + metadata?: BenchmarkMetadata; + + /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ + rating?: string | null; + } + + + /** This complex data type describes the metric distribution by basis. */ + export interface MetricDistribution { + + /** This field returns the basis, or the method, by which the metric rating is calculated. */ + basis?: string | null; + + /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ + data?: Array; + } + + + /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ + export interface Distribution { + + /** The name of a distribution in which the seller is active. */ + name?: string | null; + + /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ + value?: string | null; + } + + + /** Type that defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ + category?: string | null; + + /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error than given in the message error field. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** If present, indicates which subsystem in which the error occurred. */ + subdomain?: string | null; + } + + + /** A complex type that defines an error and error message. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + export interface EvaluationCycle { + + /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + endDate?: string | null; + + /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ + evaluationDate?: string | null; + + /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ + evaluationType?: string | null; + + /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + startDate?: string | null; + } + + + /** The response container for a list of seller profiles. */ + export interface FindSellerStandardsProfilesResponse { + + /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ + standardsProfiles?: Array; + } + + + /** A complex type that defines a seller profile. */ + export interface StandardsProfile { + + /** A complex type that describes a program cycle. */ + cycle?: Cycle; + + /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ + defaultProgram?: boolean | null; + + /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ + evaluationReason?: string | null; + + /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ + metrics?: Array; + + /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ + program?: string | null; + + /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ + standardsLevel?: string | null; + } + + + /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ + export interface GetCustomerServiceMetricResponse { + + /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ + dimensionMetrics?: Array; + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + evaluationCycle?: EvaluationCycle; + + /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + export interface Header { + + /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ + dimensionKeys?: Array; + + /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ + metrics?: Array; + } + + + /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ + export interface Metadata { + + /** Type that defines the metadata header fields. */ + metadataHeader?: MetadataHeader; + + /** A list of the individual report records. */ + metadataRecords?: Array; + } + + + /** Type that defines the metadata header fields. */ + export interface MetadataHeader { + + /** The key value used for the report. For example: "key": "LISTING_ID" */ + key?: string | null; + + /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ + metadataKeys?: Array; + } + + + /** A complex type that defines the data records returned in the report. */ + export interface MetadataRecord { + + /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ + metadataValues?: Array; + + /** A complex type that contains a value, plus the veracity of that value. */ + value?: Value; + } + + + /** A complex type that contains a value, plus the veracity of that value. */ + export interface Value { + + /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ + applicable?: boolean | null; + + /** The value of the report data. */ + value?: string | null; + } + + + /** Type that defines the fields of the individual record of the report. */ + export interface Record { + + /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ + dimensionValues?: Array; + + /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ + metricValues?: Array; + } + + + /** The complex type that defines that defines the report. */ + export interface Report { + + /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ + dimensionMetadata?: Array; + + /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + endDate?: string | null; + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + header?: Header; + + /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ + lastUpdatedDate?: string | null; + + /** A complex type containing the individual data records for the traffic report. */ + records?: Array; + + /** The start date of the date range used to calculate the report, in ISO 8601 format. */ + startDate?: string | null; + + /** An array of any process errors or warnings that were generated during the processing of the call processing. */ + warnings?: Array; + } + + export class Customer_service_metricClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. + * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} + * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED + * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html + * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. + * @return {GetCustomerServiceMetricResponse} Success + */ + GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Promise { + return fetch(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Seller_standards_profileClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. + * Get seller_standards_profile + * @return {FindSellerStandardsProfilesResponse} Success + */ + FindSellerStandardsProfiles(): Promise { + return fetch(this.baseUri + 'seller_standards_profile', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. + * Get seller_standards_profile/{program}/{cycle} + * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. + * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. + * @return {StandardsProfile} Success + */ + GetSellerStandardsProfile(cycle: string, program: string): Promise { + return fetch(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Traffic_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. + * Get traffic_report + * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. + * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html + * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count + * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html + * @return {Report} Success + */ + GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Promise { + return fetch(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_compliance.txt b/Tests/SwagTsTests/FetchResults/sell_compliance.ts similarity index 99% rename from Tests/SwagTsTests/FetchResults/sell_compliance.txt rename to Tests/SwagTsTests/FetchResults/sell_compliance.ts index baab0a96..d3c76313 100644 --- a/Tests/SwagTsTests/FetchResults/sell_compliance.txt +++ b/Tests/SwagTsTests/FetchResults/sell_compliance.ts @@ -1,257 +1,257 @@ -export namespace MyNS { - - /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ - export interface AspectRecommendations { - - /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ - localizedAspectName?: string | null; - - /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ - suggestedValues?: Array; - } - - - /** This type is used by each listing violation that is returned under the violations container. */ - export interface ComplianceDetail { - - /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ - reasonCode?: string | null; - - /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ - message?: string | null; - - /** This type is used to identify the product variation that has the listing violation. */ - variation?: VariationDetails; - - /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ - violationData?: Array; - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - correctiveRecommendations?: CorrectiveRecommendations; - - /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ - complianceState?: string | null; - } - - - /** This type is used to identify the product variation that has the listing violation. */ - export interface VariationDetails { - - /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ - sku?: string | null; - - /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ - variationAspects?: Array; - } - - - /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ - export interface NameValueList { - - /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - name?: string | null; - - /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - value?: string | null; - } - - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - export interface CorrectiveRecommendations { - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - productRecommendation?: ProductRecommendation; - - /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ - aspectRecommendations?: Array; - } - - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - export interface ProductRecommendation { - - /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ - epid?: string | null; - } - - - /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ - export interface ComplianceSummary { - - /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ - violationSummaries?: Array; - } - - - /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ - export interface ComplianceSummaryInfo { - - /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - listingCount?: number | null; - } - - - /** This type is used by each listing violation that is returned under the listingViolations container. */ - export interface ComplianceViolation { - - /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ - listingId?: string | null; - - /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ - sku?: string | null; - - /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ - offerId?: string | null; - - /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ - violations?: Array; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is the base response type of the getListingViolations method. */ - export interface PagedComplianceViolationCollection { - - /** - * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI of the getListingViolations call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ - next?: string | null; - - /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ - prev?: string | null; - - /** - * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ - listingViolations?: Array; - } - - - /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ - export interface SuppressViolationRequest { - - /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ - listingId?: string | null; - } - - export class Listing_violation_summaryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * Get listing_violation_summary - * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * @return {void} Success - */ - GetListingViolationsSummary(compliance_type: string | null | undefined): Promise { - return fetch(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { method: 'get' }); - } - } - - export class Listing_violationClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. - * Get listing_violation - * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. - * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) - * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. - * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 - * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} - * @return {void} Success - */ - GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Promise { - return fetch(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }); - } - - /** - * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. - * Post suppress_listing_violation - * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. - * @return {void} - */ - SuppressViolation(requestBody: SuppressViolationRequest): Promise { - return fetch(this.baseUri + 'suppress_listing_violation', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - -} - +export namespace MyNS { + + /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ + export interface AspectRecommendations { + + /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ + localizedAspectName?: string | null; + + /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ + suggestedValues?: Array; + } + + + /** This type is used by each listing violation that is returned under the violations container. */ + export interface ComplianceDetail { + + /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ + reasonCode?: string | null; + + /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ + message?: string | null; + + /** This type is used to identify the product variation that has the listing violation. */ + variation?: VariationDetails; + + /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ + violationData?: Array; + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + correctiveRecommendations?: CorrectiveRecommendations; + + /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ + complianceState?: string | null; + } + + + /** This type is used to identify the product variation that has the listing violation. */ + export interface VariationDetails { + + /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ + sku?: string | null; + + /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ + variationAspects?: Array; + } + + + /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ + export interface NameValueList { + + /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + name?: string | null; + + /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + value?: string | null; + } + + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + export interface CorrectiveRecommendations { + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + productRecommendation?: ProductRecommendation; + + /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ + aspectRecommendations?: Array; + } + + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + export interface ProductRecommendation { + + /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ + epid?: string | null; + } + + + /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ + export interface ComplianceSummary { + + /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ + violationSummaries?: Array; + } + + + /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ + export interface ComplianceSummaryInfo { + + /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + listingCount?: number | null; + } + + + /** This type is used by each listing violation that is returned under the listingViolations container. */ + export interface ComplianceViolation { + + /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ + listingId?: string | null; + + /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ + sku?: string | null; + + /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ + offerId?: string | null; + + /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ + violations?: Array; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is the base response type of the getListingViolations method. */ + export interface PagedComplianceViolationCollection { + + /** + * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI of the getListingViolations call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ + next?: string | null; + + /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ + prev?: string | null; + + /** + * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ + listingViolations?: Array; + } + + + /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ + export interface SuppressViolationRequest { + + /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ + listingId?: string | null; + } + + export class Listing_violation_summaryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * Get listing_violation_summary + * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * @return {void} Success + */ + GetListingViolationsSummary(compliance_type: string | null | undefined): Promise { + return fetch(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { method: 'get' }); + } + } + + export class Listing_violationClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. + * Get listing_violation + * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. + * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) + * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. + * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 + * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} + * @return {void} Success + */ + GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Promise { + return fetch(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }); + } + + /** + * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. + * Post suppress_listing_violation + * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. + * @return {void} + */ + SuppressViolation(requestBody: SuppressViolationRequest): Promise { + return fetch(this.baseUri + 'suppress_listing_violation', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_finances.txt b/Tests/SwagTsTests/FetchResults/sell_finances.ts similarity index 99% rename from Tests/SwagTsTests/FetchResults/sell_finances.txt rename to Tests/SwagTsTests/FetchResults/sell_finances.ts index 92004220..40d6da79 100644 --- a/Tests/SwagTsTests/FetchResults/sell_finances.txt +++ b/Tests/SwagTsTests/FetchResults/sell_finances.ts @@ -1,399 +1,399 @@ -export namespace MyNS { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - export interface Amount { - - /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ - value?: string | null; - } - - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - export interface Buyer { - - /** The eBay user ID of the order's buyer. */ - username?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ - export interface Payout { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ - payoutDate?: string | null; - - /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ - payoutId?: string | null; - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - payoutInstrument?: PayoutInstrument; - - /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ - payoutStatus?: string | null; - - /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ - payoutStatusDescription?: string | null; - - /** - * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - export interface PayoutInstrument { - - /** This string value is the last four digits of the seller's account number. */ - accountLastFourDigits?: string | null; - - /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ - instrumentType?: string | null; - - /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ - nickname?: string | null; - } - - - /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ - export interface PayoutSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** - * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - payoutCount?: number | null; - - /** - * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ - export interface Payouts { - - /** The URI of the getPayouts call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ - payouts?: Array; - - /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ - export interface SellerFundsSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - availableFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - fundsOnHold?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - processingFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - totalFunds?: Amount; - } - - - /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ - export interface Transaction { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ - bookingEntry?: string | null; - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - buyer?: Buyer; - - /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ - orderId?: string | null; - - /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ - payoutId?: string | null; - - /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ - salesRecordReference?: string | null; - - /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ - transactionDate?: string | null; - - /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ - transactionId?: string | null; - - /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ - transactionMemo?: string | null; - - /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ - transactionStatus?: string | null; - - /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ - transactionType?: string | null; - } - - - /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ - export interface TransactionSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - creditAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ - creditBookingEntry?: string | null; - - /** - * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - creditCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - disputeAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ - disputeBookingEntry?: string | null; - - /** - * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - disputeCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - onHoldAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ - onHoldBookingEntry?: string | null; - - /** - * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - onHoldCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - refundAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ - refundBookingEntry?: string | null; - - /** - * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - refundCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - shippingLabelAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ - shippingLabelBookingEntry?: string | null; - - /** - * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - shippingLabelCount?: number | null; - } - - - /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ - export interface Transactions { - - /** The URI of the getTransactions method request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ - transactions?: Array; - } - - export class PayoutClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. - * Get payout/{payout_Id} - * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. - * @return {Payout} Success - */ - GetPayout(payout_Id: string): Promise { - return fetch(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. - * Get payout - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) - * @return {Payouts} Success - */ - GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return fetch(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. - * Get payout_summary - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {PayoutSummaryResponse} Success - */ - GetPayoutSummary(filter: string | null | undefined): Promise { - return fetch(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class TransactionClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. - * Get transaction - * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * @return {Transactions} Success - */ - GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return fetch(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). - * Get transaction_summary - * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {TransactionSummaryResponse} Success - */ - GetTransactionSummary(filter: string | null | undefined): Promise { - return fetch(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Seller_funds_summaryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. - * Get seller_funds_summary - * @return {SellerFundsSummaryResponse} Success - */ - GetSellerFundsSummary(): Promise { - return fetch(this.baseUri + 'seller_funds_summary', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + export interface Amount { + + /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ + value?: string | null; + } + + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + export interface Buyer { + + /** The eBay user ID of the order's buyer. */ + username?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ + export interface Payout { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ + payoutDate?: string | null; + + /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ + payoutId?: string | null; + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + payoutInstrument?: PayoutInstrument; + + /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ + payoutStatus?: string | null; + + /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ + payoutStatusDescription?: string | null; + + /** + * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + export interface PayoutInstrument { + + /** This string value is the last four digits of the seller's account number. */ + accountLastFourDigits?: string | null; + + /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ + instrumentType?: string | null; + + /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ + nickname?: string | null; + } + + + /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ + export interface PayoutSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** + * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + payoutCount?: number | null; + + /** + * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ + export interface Payouts { + + /** The URI of the getPayouts call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ + payouts?: Array; + + /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ + export interface SellerFundsSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + availableFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + fundsOnHold?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + processingFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + totalFunds?: Amount; + } + + + /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ + export interface Transaction { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ + bookingEntry?: string | null; + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + buyer?: Buyer; + + /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ + orderId?: string | null; + + /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ + payoutId?: string | null; + + /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ + salesRecordReference?: string | null; + + /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ + transactionDate?: string | null; + + /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ + transactionId?: string | null; + + /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ + transactionMemo?: string | null; + + /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ + transactionStatus?: string | null; + + /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ + transactionType?: string | null; + } + + + /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ + export interface TransactionSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + creditAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ + creditBookingEntry?: string | null; + + /** + * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + creditCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + disputeAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ + disputeBookingEntry?: string | null; + + /** + * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + disputeCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + onHoldAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ + onHoldBookingEntry?: string | null; + + /** + * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + onHoldCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + refundAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ + refundBookingEntry?: string | null; + + /** + * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + refundCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + shippingLabelAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ + shippingLabelBookingEntry?: string | null; + + /** + * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + shippingLabelCount?: number | null; + } + + + /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ + export interface Transactions { + + /** The URI of the getTransactions method request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ + transactions?: Array; + } + + export class PayoutClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. + * Get payout/{payout_Id} + * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. + * @return {Payout} Success + */ + GetPayout(payout_Id: string): Promise { + return fetch(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. + * Get payout + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) + * @return {Payouts} Success + */ + GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return fetch(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. + * Get payout_summary + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {PayoutSummaryResponse} Success + */ + GetPayoutSummary(filter: string | null | undefined): Promise { + return fetch(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class TransactionClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. + * Get transaction + * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * @return {Transactions} Success + */ + GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return fetch(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). + * Get transaction_summary + * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {TransactionSummaryResponse} Success + */ + GetTransactionSummary(filter: string | null | undefined): Promise { + return fetch(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Seller_funds_summaryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. + * Get seller_funds_summary + * @return {SellerFundsSummaryResponse} Success + */ + GetSellerFundsSummary(): Promise { + return fetch(this.baseUri + 'seller_funds_summary', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_inventory.txt b/Tests/SwagTsTests/FetchResults/sell_inventory.ts similarity index 99% rename from Tests/SwagTsTests/FetchResults/sell_inventory.txt rename to Tests/SwagTsTests/FetchResults/sell_inventory.ts index 7898b5f2..1a4fd21b 100644 --- a/Tests/SwagTsTests/FetchResults/sell_inventory.txt +++ b/Tests/SwagTsTests/FetchResults/sell_inventory.ts @@ -1,1846 +1,1846 @@ -export namespace MyNS { - - /** This type is used to define the physical address of an inventory location. */ - export interface Address { - - /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine1?: string | null; - - /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine2?: string | null; - - /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ - city?: string | null; - - /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ - country?: string | null; - - /** The county in which the address resides. This field is returned if defined for an inventory location. */ - county?: string | null; - - /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ - postalCode?: string | null; - - /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ - stateOrProvince?: string | null; - } - - - /** This type is used to express a dollar value and the applicable currency. */ - export interface Amount { - - /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ - currency?: string | null; - - /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ - value?: string | null; - } - - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - export interface Availability { - - /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - pickupAtLocationAvailability?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - } - - - /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ - export interface PickupAtLocationAvailability { - - /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ - availabilityType?: string | null; - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - fulfillmentTime?: TimeDuration; - - /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ - merchantLocationKey?: string | null; - - /** - * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - export interface TimeDuration { - - /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - export interface ShipToLocationAvailability { - - /** - * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ - export interface BaseResponse { - - /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ - warnings?: Array; - } - - - /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ - export interface Error { - - /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ - category?: string | null; - - /** The name of the domain in which the error or warning occurred. */ - domain?: string | null; - - /** - * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ - longMessage?: string | null; - - /** A description of the condition that caused the error or warning. */ - message?: string | null; - - /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ - outputRefIds?: Array; - - /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. */ - subdomain?: string | null; - } - - - /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ - export interface ErrorParameter { - - /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ - name?: string | null; - - /** This is the actual value that was passed in for the element specified in the name field. */ - value?: string | null; - } - - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - export interface BestOffer { - - /** This type is used to express a dollar value and the applicable currency. */ - autoAcceptPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - autoDeclinePrice?: Amount; - - /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ - bestOfferEnabled?: boolean | null; - } - - - /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ - export interface BulkEbayOfferDetailsWithKeys { - - /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ - requests?: Array; - } - - - /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ - export interface EbayOfferDetailsWithKeys { - - /** - * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - - /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ - donationPercentage?: string | null; - } - - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - export interface ListingPolicies { - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - bestOfferTerms?: BestOffer; - - /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - eBayPlusIfEligible?: boolean | null; - - /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - fulfillmentPolicyId?: string | null; - - /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - paymentPolicyId?: string | null; - - /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - returnPolicyId?: string | null; - - /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ - shippingCostOverrides?: Array; - } - - - /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ - export interface ShippingCostOverride { - - /** This type is used to express a dollar value and the applicable currency. */ - additionalShippingCost?: Amount; - - /** - * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - priority?: number | null; - - /** This type is used to express a dollar value and the applicable currency. */ - shippingCost?: Amount; - - /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ - shippingServiceType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - surcharge?: Amount; - } - - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - export interface PricingSummary { - - /** This type is used to express a dollar value and the applicable currency. */ - minimumAdvertisedPrice?: Amount; - - /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - originallySoldForRetailPriceOn?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - originalRetailPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - - /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - pricingVisibility?: string | null; - } - - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - export interface Tax { - - /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ - applyTax?: boolean | null; - - /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ - thirdPartyTaxCategory?: string | null; - - /** - * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. - * Type: double - */ - vatPercentage?: number | null; - } - - - /** This type is used by the base request of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItem { - - /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ - requests?: Array; - } - - - /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ - export interface GetInventoryItem { - - /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemResponse { - - /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ - export interface GetInventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ - errors?: Array; - - /** This type is used to provide details about each retrieved inventory item record. */ - inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ - warnings?: Array; - } - - - /** This type is used to provide details about each retrieved inventory item record. */ - export interface InventoryItemWithSkuLocaleGroupKeys { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface PackageWeightAndSize { - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - dimensions?: Dimension; - - /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ - packageType?: string | null; - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - weight?: Weight; - } - - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Dimension { - - /** - * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - height?: number | null; - - /** - * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - length?: number | null; - - /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - width?: number | null; - } - - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Weight { - - /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } - * Type: double - */ - value?: number | null; - } - - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - export interface Product { - - /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ - aspects?: Array; - - /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ - brand?: string | null; - - /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ - description?: string | null; - - /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ - ean?: Array; - - /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ - epid?: string | null; - - /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ - imageUrls?: Array; - - /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ - isbn?: Array; - - /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ - mpn?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ - title?: string | null; - - /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ - upc?: Array; - } - - - /** The base request of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItem { - - /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ - requests?: Array; - } - - - /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ - export interface InventoryItemWithSkuLocale { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemResponse { - - /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ - export interface InventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ - errors?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base container of the bulkMigrateListings request payload. */ - export interface BulkMigrateListing { - - /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ - requests?: Array; - } - - - /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ - export interface MigrateListing { - - /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ - listingId?: string | null; - } - - - /** This type is used by the response payload of the bulkMigrateListings call. */ - export interface BulkMigrateListingResponse { - - /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ - responses?: Array; - } - - - /** This type is used to display the results of each listing that the seller attempted to migrate. */ - export interface MigrateListingResponse { - - /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ - errors?: Array; - - /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ - inventoryItemGroupKey?: string | null; - - /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ - inventoryItems?: Array; - - /** The unique identifier of the eBay listing that the seller attempted to migrate. */ - listingId?: string | null; - - /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ - warnings?: Array; - } - - - /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ - export interface InventoryItemListing { - - /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ - offerId?: string | null; - - /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ - sku?: string | null; - } - - - /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ - export interface BulkOffer { - - /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ - requests?: Array; - } - - - /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ - export interface OfferKeyWithId { - - /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ - offerId?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOffer method. */ - export interface BulkOfferResponse { - - /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ - export interface OfferSkuResponse { - - /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ - errors?: Array; - - /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ - offerId?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ - sku?: string | null; - - /** - * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ - warnings?: Array; - } - - - /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - export interface BulkPriceQuantity { - - /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - requests?: Array; - } - - - /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ - export interface PriceQuantity { - - /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ - offers?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - - /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ - export interface OfferPriceQuantity { - - /** - * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ - offerId?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - } - - - /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - export interface BulkPriceQuantityResponse { - - /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - responses?: Array; - } - - - /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ - export interface PriceQuantityResponse { - - /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ - errors?: Array; - - /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ - offerId?: string | null; - - /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ - sku?: string | null; - - /** - * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base response of the bulkPublishOffer method. */ - export interface BulkPublishResponse { - - /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ - responses?: Array; - } - - - /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ - export interface OfferResponseWithListingId { - - /** This container will be returned if there were one or more errors associated with publishing the offer. */ - errors?: Array; - - /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ - listingId?: string | null; - - /** The unique identifier of the offer that the seller published (or attempted to publish). */ - offerId?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with publishing the offer. */ - warnings?: Array; - } - - - /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ - export interface Compatibility { - - /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ - compatibleProducts?: Array; - - /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ - sku?: string | null; - } - - - /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ - export interface CompatibleProduct { - - /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ - compatibilityProperties?: Array; - - /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ - notes?: string | null; - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - productFamilyProperties?: ProductFamilyProperties; - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - productIdentifier?: ProductIdentifier; - } - - - /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ - export interface NameValueList { - - /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ - name?: string | null; - - /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ - value?: string | null; - } - - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - export interface ProductFamilyProperties { - - /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ - engine?: string | null; - - /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ - make?: string | null; - - /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ - model?: string | null; - - /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ - trim?: string | null; - - /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ - year?: string | null; - } - - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - export interface ProductIdentifier { - - /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ - epid?: string | null; - - /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ - gtin?: string | null; - - /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ - ktype?: string | null; - } - - - /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ - export interface EbayOfferDetailsWithAll { - - /** - * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - listing?: ListingDetails; - - /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ - merchantLocationKey?: string | null; - - /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ - offerId?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ - sku?: string | null; - - /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - export interface ListingDetails { - - /** The unique identifier of the eBay listing that is associated with the published offer. */ - listingId?: string | null; - - /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ - listingStatus?: string | null; - - /** - * This integer value indicates the quantity of the product that has been sold for the published offer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - soldQuantity?: number | null; - } - - - /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ - export interface EbayOfferDetailsWithId { - - /** - * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ - export interface Fee { - - /** This type is used to express a dollar value and the applicable currency. */ - amount?: Amount; - - /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - feeType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - promotionalDiscount?: Amount; - } - - - /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ - export interface FeeSummary { - - /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - fees?: Array; - - /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response payload for the getListingFees call. */ - export interface FeesSummaryResponse { - - /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ - feeSummaries?: Array; - } - - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - export interface GeoCoordinates { - - /** - * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - longitude?: number | null; - } - - - /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ - export interface Interval { - - /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - close?: string | null; - - /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - open?: string | null; - } - - - /** This type is used to provide detailed information about an inventory item. */ - export interface InventoryItem { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - } - - - /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ - export interface InventoryItemGroup { - - /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ - aspects?: Array; - - /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ - description?: string | null; - - /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ - imageUrls?: Array; - - /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ - inventoryItemGroupKey?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ - title?: string | null; - - /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ - variantSKUs?: Array; - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - variesBy?: VariesBy; - } - - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - export interface VariesBy { - - /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ - aspectsImageVariesBy?: Array; - - /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ - specifications?: Array; - } - - - /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ - export interface Specification { - - /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ - name?: string | null; - - /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ - values?: Array; - } - - export interface InventoryItemWithSkuLocaleGroupid { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ - groupIds?: Array; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used by the base response payload of getInventoryItems call. */ - export interface InventoryItems { - - /** This is the URL to the current page of inventory items. */ - href?: string | null; - - /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ - inventoryItems?: Array; - - /** - * This integer value is the number of inventory items that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ - next?: string | null; - - /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ - prev?: string | null; - - /** - * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ - export interface InventoryLocation { - - /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ - locationInstructions?: string | null; - - /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ - locationWebUrl?: string | null; - - /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ - name?: string | null; - - /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ - operatingHours?: Array; - - /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ - phone?: string | null; - - /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ - specialHours?: Array; - } - - - /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ - export interface OperatingHours { - - /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ - dayOfWeekEnum?: string | null; - - /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ - intervals?: Array; - } - - - /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ - export interface SpecialHours { - - /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ - date?: string | null; - - /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ - intervals?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ - export interface InventoryLocationFull { - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - location?: LocationDetails; - - /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ - locationInstructions?: string | null; - - /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ - locationTypes?: Array; - - /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ - phone?: string | null; - - /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ - specialHours?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - export interface LocationDetails { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - } - - - /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ - export interface InventoryLocationResponse { - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - location?: Location; - - /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ - locationInstructions?: string | null; - - /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ - locationTypes?: Array; - - /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ - phone?: string | null; - - /** This container shows the special operating hours for a store location on a specific date or dates. */ - specialHours?: Array; - } - - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - export interface Location { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - - /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ - locationId?: string | null; - } - - - /** This type is used by the base response payload for the getInventoryLocations call. */ - export interface LocationResponse { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of one or more of the merchant's inventory locations. */ - locations?: Array; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the base request payload of the getListingFees call. */ - export interface OfferKeysWithId { - - /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ - offers?: Array; - } - - - /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ - export interface OfferResponse { - - /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ - offerId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ - export interface Offers { - - /** This is the URL to the current page of offers. */ - href?: string | null; - - /** - * This integer value is the number of offers that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ - next?: string | null; - - /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ - offers?: Array; - - /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ - prev?: string | null; - - /** - * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ - export interface PublishByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ - export interface PublishResponse { - - /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ - listingId?: string | null; - - /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ - warnings?: Array; - } - - - /** This type is used to show the version number and instance of the service or API. */ - export interface Version { - - /** This type is used to show the version number and instance of the service or API. */ - instance?: Version; - - /** The version number of the service or API. */ - version?: string | null; - } - - - /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ - export interface WithdrawByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** The base response of the withdrawOffer call. */ - export interface WithdrawResponse { - - /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ - listingId?: string | null; - - /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ - warnings?: Array; - } - - export class LocationClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 - * @return {InventoryLocationResponse} Success - */ - GetInventoryLocation(merchantLocationKey: string): Promise { - return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 - * @param {InventoryLocationFull} requestBody Inventory Location details - * @return {void} - */ - CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Promise { - return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. - * Delete location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 - * @return {void} - */ - DeleteInventoryLocation(merchantLocationKey: string): Promise { - return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { method: 'delete' }); - } - - /** - * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/disable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 - * @return {string} Success - */ - DisableInventoryLocation(merchantLocationKey: string): Promise { - return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', { method: 'post' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/enable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 - * @return {string} Success - */ - EnableInventoryLocation(merchantLocationKey: string): Promise { - return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', { method: 'post' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 - * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {LocationResponse} Success - */ - GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Promise { - return fetch(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey}/update_location_details - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 - * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). - * @return {void} - */ - UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Promise { - return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class Inventory_itemClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Get inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. - * @return {InventoryItemWithSkuLocaleGroupid} Success - */ - GetInventoryItem(sku: string): Promise { - return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. - * Put inventory_item/{sku} - * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. - * @param {InventoryItem} requestBody Details of the inventory item record. - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Promise { - return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Delete inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. - * @return {void} - */ - DeleteInventoryItem(sku: string): Promise { - return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { method: 'delete' }); - } - - /** - * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. - * Get inventory_item - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {InventoryItems} Success - */ - GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Promise { - return fetch(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Post bulk_update_price_quantity - * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace - * @return {BulkPriceQuantityResponse} Success - */ - BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Promise { - return fetch(this.baseUri + 'bulk_update_price_quantity', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. - * Post bulk_create_or_replace_inventory_item - * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkInventoryItemResponse} Success - */ - BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Promise { - return fetch(this.baseUri + 'bulk_create_or_replace_inventory_item', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Post bulk_get_inventory_item - * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkGetInventoryItemResponse} Success - */ - BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Promise { - return fetch(this.baseUri + 'bulk_get_inventory_item', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Product_compatibilityClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Get inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {Compatibility} Success - */ - GetProductCompatibility(sku: string): Promise { - return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @param {Compatibility} requestBody Details of the compatibility - * @return {BaseResponse} Success - */ - CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Promise { - return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Delete inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {void} - */ - DeleteProductCompatibility(sku: string): Promise { - return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { method: 'delete' }); - } - } - - export class OfferClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer - * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. - * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. - * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {Offers} Success - */ - GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { - return fetch(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. - * Post offer - * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {void} - */ - CreateOffer(requestBody: EbayOfferDetailsWithKeys): Promise { - return fetch(this.baseUri + 'offer', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is to be retrieved. - * @return {EbayOfferDetailsWithAll} Success - */ - GetOffer(offerId: string): Promise { - return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. - * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel - * @return {OfferResponse} Success - */ - UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Promise { - return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. - * Delete offer/{offerId} - * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. - * @return {void} - */ - DeleteOffer(offerId: string): Promise { - return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { method: 'delete' }); - } - - /** - * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post offer/{offerId}/publish/ - * @param {string} offerId The unique identifier of the offer that is to be published. - * @return {PublishResponse} Success - */ - PublishOffer(offerId: string): Promise { - return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', { method: 'post' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. - * Post offer/publish_by_inventory_item_group/ - * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. - * @return {PublishResponse} Success - */ - PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Promise { - return fetch(this.baseUri + 'offer/publish_by_inventory_item_group/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. - * Post offer/withdraw_by_inventory_item_group - * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. - * @return {void} - */ - WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Promise { - return fetch(this.baseUri + 'offer/withdraw_by_inventory_item_group', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. - * Post offer/get_listing_fees - * @param {OfferKeysWithId} requestBody List of offers that needs fee information - * @return {FeesSummaryResponse} Success - */ - GetListingFees(requestBody: OfferKeysWithId): Promise { - return fetch(this.baseUri + 'offer/get_listing_fees', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. - * Post bulk_create_offer - * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {BulkOfferResponse} Success - */ - BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Promise { - return fetch(this.baseUri + 'bulk_create_offer', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post bulk_publish_offer - * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. - * @return {BulkPublishResponse} Success - */ - BulkPublishOffer(requestBody: BulkOffer): Promise { - return fetch(this.baseUri + 'bulk_publish_offer', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. - * Post offer/{offerId}/withdraw - * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. - * @return {WithdrawResponse} Success - */ - WithdrawOffer(offerId: string): Promise { - return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', { method: 'post' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Inventory_item_groupClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. - * Get inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. - * @return {InventoryItemGroup} Success - */ - GetInventoryItemGroup(inventoryItemGroupKey: string): Promise { - return fetch(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. - * @param {InventoryItemGroup} requestBody Details of the inventory Item Group - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Promise { - return fetch(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call deletes the inventory item group for a given inventoryItemGroupKey value. - * Delete inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. - * @return {void} - */ - DeleteInventoryItemGroup(inventoryItemGroupKey: string): Promise { - return fetch(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { method: 'delete' }); - } - } - - export class ListingClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. - * Post bulk_migrate_listing - * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory - * @return {BulkMigrateListingResponse} Success - */ - BulkMigrateListing(requestBody: BulkMigrateListing): Promise { - return fetch(this.baseUri + 'bulk_migrate_listing', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** This type is used to define the physical address of an inventory location. */ + export interface Address { + + /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine1?: string | null; + + /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine2?: string | null; + + /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ + city?: string | null; + + /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ + country?: string | null; + + /** The county in which the address resides. This field is returned if defined for an inventory location. */ + county?: string | null; + + /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ + postalCode?: string | null; + + /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ + stateOrProvince?: string | null; + } + + + /** This type is used to express a dollar value and the applicable currency. */ + export interface Amount { + + /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ + currency?: string | null; + + /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ + value?: string | null; + } + + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + export interface Availability { + + /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + pickupAtLocationAvailability?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + } + + + /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ + export interface PickupAtLocationAvailability { + + /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ + availabilityType?: string | null; + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + fulfillmentTime?: TimeDuration; + + /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ + merchantLocationKey?: string | null; + + /** + * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + export interface TimeDuration { + + /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + export interface ShipToLocationAvailability { + + /** + * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ + export interface BaseResponse { + + /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ + warnings?: Array; + } + + + /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ + export interface Error { + + /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ + category?: string | null; + + /** The name of the domain in which the error or warning occurred. */ + domain?: string | null; + + /** + * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ + longMessage?: string | null; + + /** A description of the condition that caused the error or warning. */ + message?: string | null; + + /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ + outputRefIds?: Array; + + /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. */ + subdomain?: string | null; + } + + + /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ + export interface ErrorParameter { + + /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ + name?: string | null; + + /** This is the actual value that was passed in for the element specified in the name field. */ + value?: string | null; + } + + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + export interface BestOffer { + + /** This type is used to express a dollar value and the applicable currency. */ + autoAcceptPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + autoDeclinePrice?: Amount; + + /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ + bestOfferEnabled?: boolean | null; + } + + + /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ + export interface BulkEbayOfferDetailsWithKeys { + + /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ + requests?: Array; + } + + + /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ + export interface EbayOfferDetailsWithKeys { + + /** + * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + + /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ + donationPercentage?: string | null; + } + + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + export interface ListingPolicies { + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + bestOfferTerms?: BestOffer; + + /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + eBayPlusIfEligible?: boolean | null; + + /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + fulfillmentPolicyId?: string | null; + + /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + paymentPolicyId?: string | null; + + /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + returnPolicyId?: string | null; + + /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ + shippingCostOverrides?: Array; + } + + + /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ + export interface ShippingCostOverride { + + /** This type is used to express a dollar value and the applicable currency. */ + additionalShippingCost?: Amount; + + /** + * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + priority?: number | null; + + /** This type is used to express a dollar value and the applicable currency. */ + shippingCost?: Amount; + + /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ + shippingServiceType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + surcharge?: Amount; + } + + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + export interface PricingSummary { + + /** This type is used to express a dollar value and the applicable currency. */ + minimumAdvertisedPrice?: Amount; + + /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + originallySoldForRetailPriceOn?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + originalRetailPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + + /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + pricingVisibility?: string | null; + } + + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + export interface Tax { + + /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ + applyTax?: boolean | null; + + /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ + thirdPartyTaxCategory?: string | null; + + /** + * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. + * Type: double + */ + vatPercentage?: number | null; + } + + + /** This type is used by the base request of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItem { + + /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ + requests?: Array; + } + + + /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ + export interface GetInventoryItem { + + /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemResponse { + + /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ + export interface GetInventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ + errors?: Array; + + /** This type is used to provide details about each retrieved inventory item record. */ + inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ + warnings?: Array; + } + + + /** This type is used to provide details about each retrieved inventory item record. */ + export interface InventoryItemWithSkuLocaleGroupKeys { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface PackageWeightAndSize { + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + dimensions?: Dimension; + + /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ + packageType?: string | null; + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + weight?: Weight; + } + + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Dimension { + + /** + * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + height?: number | null; + + /** + * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + length?: number | null; + + /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + width?: number | null; + } + + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Weight { + + /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } + * Type: double + */ + value?: number | null; + } + + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + export interface Product { + + /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ + aspects?: Array; + + /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ + brand?: string | null; + + /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ + description?: string | null; + + /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ + ean?: Array; + + /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ + epid?: string | null; + + /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ + imageUrls?: Array; + + /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ + isbn?: Array; + + /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ + mpn?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ + title?: string | null; + + /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ + upc?: Array; + } + + + /** The base request of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItem { + + /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ + requests?: Array; + } + + + /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ + export interface InventoryItemWithSkuLocale { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemResponse { + + /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ + export interface InventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ + errors?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base container of the bulkMigrateListings request payload. */ + export interface BulkMigrateListing { + + /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ + requests?: Array; + } + + + /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ + export interface MigrateListing { + + /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ + listingId?: string | null; + } + + + /** This type is used by the response payload of the bulkMigrateListings call. */ + export interface BulkMigrateListingResponse { + + /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ + responses?: Array; + } + + + /** This type is used to display the results of each listing that the seller attempted to migrate. */ + export interface MigrateListingResponse { + + /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ + errors?: Array; + + /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ + inventoryItemGroupKey?: string | null; + + /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ + inventoryItems?: Array; + + /** The unique identifier of the eBay listing that the seller attempted to migrate. */ + listingId?: string | null; + + /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ + warnings?: Array; + } + + + /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ + export interface InventoryItemListing { + + /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ + offerId?: string | null; + + /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ + sku?: string | null; + } + + + /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ + export interface BulkOffer { + + /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ + requests?: Array; + } + + + /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ + export interface OfferKeyWithId { + + /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ + offerId?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOffer method. */ + export interface BulkOfferResponse { + + /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ + export interface OfferSkuResponse { + + /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ + errors?: Array; + + /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ + offerId?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ + sku?: string | null; + + /** + * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ + warnings?: Array; + } + + + /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + export interface BulkPriceQuantity { + + /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + requests?: Array; + } + + + /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ + export interface PriceQuantity { + + /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ + offers?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + + /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ + export interface OfferPriceQuantity { + + /** + * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ + offerId?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + } + + + /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + export interface BulkPriceQuantityResponse { + + /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + responses?: Array; + } + + + /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ + export interface PriceQuantityResponse { + + /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ + errors?: Array; + + /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ + offerId?: string | null; + + /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ + sku?: string | null; + + /** + * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base response of the bulkPublishOffer method. */ + export interface BulkPublishResponse { + + /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ + responses?: Array; + } + + + /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ + export interface OfferResponseWithListingId { + + /** This container will be returned if there were one or more errors associated with publishing the offer. */ + errors?: Array; + + /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ + listingId?: string | null; + + /** The unique identifier of the offer that the seller published (or attempted to publish). */ + offerId?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with publishing the offer. */ + warnings?: Array; + } + + + /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ + export interface Compatibility { + + /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ + compatibleProducts?: Array; + + /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ + sku?: string | null; + } + + + /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ + export interface CompatibleProduct { + + /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ + compatibilityProperties?: Array; + + /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ + notes?: string | null; + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + productFamilyProperties?: ProductFamilyProperties; + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + productIdentifier?: ProductIdentifier; + } + + + /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ + export interface NameValueList { + + /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ + name?: string | null; + + /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ + value?: string | null; + } + + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + export interface ProductFamilyProperties { + + /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ + engine?: string | null; + + /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ + make?: string | null; + + /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ + model?: string | null; + + /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ + trim?: string | null; + + /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ + year?: string | null; + } + + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + export interface ProductIdentifier { + + /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ + epid?: string | null; + + /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ + gtin?: string | null; + + /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ + ktype?: string | null; + } + + + /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ + export interface EbayOfferDetailsWithAll { + + /** + * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + listing?: ListingDetails; + + /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ + merchantLocationKey?: string | null; + + /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ + offerId?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ + sku?: string | null; + + /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + export interface ListingDetails { + + /** The unique identifier of the eBay listing that is associated with the published offer. */ + listingId?: string | null; + + /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ + listingStatus?: string | null; + + /** + * This integer value indicates the quantity of the product that has been sold for the published offer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + soldQuantity?: number | null; + } + + + /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ + export interface EbayOfferDetailsWithId { + + /** + * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ + export interface Fee { + + /** This type is used to express a dollar value and the applicable currency. */ + amount?: Amount; + + /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + feeType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + promotionalDiscount?: Amount; + } + + + /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ + export interface FeeSummary { + + /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + fees?: Array; + + /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response payload for the getListingFees call. */ + export interface FeesSummaryResponse { + + /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ + feeSummaries?: Array; + } + + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + export interface GeoCoordinates { + + /** + * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + longitude?: number | null; + } + + + /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ + export interface Interval { + + /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + close?: string | null; + + /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + open?: string | null; + } + + + /** This type is used to provide detailed information about an inventory item. */ + export interface InventoryItem { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + } + + + /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ + export interface InventoryItemGroup { + + /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ + aspects?: Array; + + /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ + description?: string | null; + + /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ + imageUrls?: Array; + + /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ + inventoryItemGroupKey?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ + title?: string | null; + + /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ + variantSKUs?: Array; + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + variesBy?: VariesBy; + } + + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + export interface VariesBy { + + /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ + aspectsImageVariesBy?: Array; + + /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ + specifications?: Array; + } + + + /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ + export interface Specification { + + /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ + name?: string | null; + + /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ + values?: Array; + } + + export interface InventoryItemWithSkuLocaleGroupid { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ + groupIds?: Array; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used by the base response payload of getInventoryItems call. */ + export interface InventoryItems { + + /** This is the URL to the current page of inventory items. */ + href?: string | null; + + /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ + inventoryItems?: Array; + + /** + * This integer value is the number of inventory items that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ + next?: string | null; + + /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ + prev?: string | null; + + /** + * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ + export interface InventoryLocation { + + /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ + locationInstructions?: string | null; + + /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ + locationWebUrl?: string | null; + + /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ + name?: string | null; + + /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ + operatingHours?: Array; + + /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ + phone?: string | null; + + /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ + specialHours?: Array; + } + + + /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ + export interface OperatingHours { + + /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ + dayOfWeekEnum?: string | null; + + /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ + intervals?: Array; + } + + + /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ + export interface SpecialHours { + + /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ + date?: string | null; + + /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ + intervals?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ + export interface InventoryLocationFull { + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + location?: LocationDetails; + + /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ + locationInstructions?: string | null; + + /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ + locationTypes?: Array; + + /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ + phone?: string | null; + + /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ + specialHours?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + export interface LocationDetails { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + } + + + /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ + export interface InventoryLocationResponse { + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + location?: Location; + + /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ + locationInstructions?: string | null; + + /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ + locationTypes?: Array; + + /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ + phone?: string | null; + + /** This container shows the special operating hours for a store location on a specific date or dates. */ + specialHours?: Array; + } + + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + export interface Location { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + + /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ + locationId?: string | null; + } + + + /** This type is used by the base response payload for the getInventoryLocations call. */ + export interface LocationResponse { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of one or more of the merchant's inventory locations. */ + locations?: Array; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the base request payload of the getListingFees call. */ + export interface OfferKeysWithId { + + /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ + offers?: Array; + } + + + /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ + export interface OfferResponse { + + /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ + offerId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ + export interface Offers { + + /** This is the URL to the current page of offers. */ + href?: string | null; + + /** + * This integer value is the number of offers that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ + next?: string | null; + + /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ + offers?: Array; + + /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ + prev?: string | null; + + /** + * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ + export interface PublishByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ + export interface PublishResponse { + + /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ + listingId?: string | null; + + /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ + warnings?: Array; + } + + + /** This type is used to show the version number and instance of the service or API. */ + export interface Version { + + /** This type is used to show the version number and instance of the service or API. */ + instance?: Version; + + /** The version number of the service or API. */ + version?: string | null; + } + + + /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ + export interface WithdrawByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** The base response of the withdrawOffer call. */ + export interface WithdrawResponse { + + /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ + listingId?: string | null; + + /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ + warnings?: Array; + } + + export class LocationClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 + * @return {InventoryLocationResponse} Success + */ + GetInventoryLocation(merchantLocationKey: string): Promise { + return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 + * @param {InventoryLocationFull} requestBody Inventory Location details + * @return {void} + */ + CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Promise { + return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. + * Delete location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 + * @return {void} + */ + DeleteInventoryLocation(merchantLocationKey: string): Promise { + return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { method: 'delete' }); + } + + /** + * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/disable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 + * @return {string} Success + */ + DisableInventoryLocation(merchantLocationKey: string): Promise { + return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', { method: 'post' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/enable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 + * @return {string} Success + */ + EnableInventoryLocation(merchantLocationKey: string): Promise { + return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', { method: 'post' }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 + * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {LocationResponse} Success + */ + GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Promise { + return fetch(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey}/update_location_details + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 + * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). + * @return {void} + */ + UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Promise { + return fetch(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class Inventory_itemClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Get inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. + * @return {InventoryItemWithSkuLocaleGroupid} Success + */ + GetInventoryItem(sku: string): Promise { + return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. + * Put inventory_item/{sku} + * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. + * @param {InventoryItem} requestBody Details of the inventory item record. + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Promise { + return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Delete inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. + * @return {void} + */ + DeleteInventoryItem(sku: string): Promise { + return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { method: 'delete' }); + } + + /** + * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. + * Get inventory_item + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {InventoryItems} Success + */ + GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Promise { + return fetch(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Post bulk_update_price_quantity + * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace + * @return {BulkPriceQuantityResponse} Success + */ + BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Promise { + return fetch(this.baseUri + 'bulk_update_price_quantity', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. + * Post bulk_create_or_replace_inventory_item + * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkInventoryItemResponse} Success + */ + BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Promise { + return fetch(this.baseUri + 'bulk_create_or_replace_inventory_item', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Post bulk_get_inventory_item + * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkGetInventoryItemResponse} Success + */ + BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Promise { + return fetch(this.baseUri + 'bulk_get_inventory_item', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Product_compatibilityClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Get inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {Compatibility} Success + */ + GetProductCompatibility(sku: string): Promise { + return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @param {Compatibility} requestBody Details of the compatibility + * @return {BaseResponse} Success + */ + CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Promise { + return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Delete inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {void} + */ + DeleteProductCompatibility(sku: string): Promise { + return fetch(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { method: 'delete' }); + } + } + + export class OfferClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer + * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. + * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. + * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {Offers} Success + */ + GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Promise { + return fetch(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. + * Post offer + * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {void} + */ + CreateOffer(requestBody: EbayOfferDetailsWithKeys): Promise { + return fetch(this.baseUri + 'offer', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is to be retrieved. + * @return {EbayOfferDetailsWithAll} Success + */ + GetOffer(offerId: string): Promise { + return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. + * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel + * @return {OfferResponse} Success + */ + UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Promise { + return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. + * Delete offer/{offerId} + * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. + * @return {void} + */ + DeleteOffer(offerId: string): Promise { + return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { method: 'delete' }); + } + + /** + * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post offer/{offerId}/publish/ + * @param {string} offerId The unique identifier of the offer that is to be published. + * @return {PublishResponse} Success + */ + PublishOffer(offerId: string): Promise { + return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', { method: 'post' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. + * Post offer/publish_by_inventory_item_group/ + * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. + * @return {PublishResponse} Success + */ + PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Promise { + return fetch(this.baseUri + 'offer/publish_by_inventory_item_group/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. + * Post offer/withdraw_by_inventory_item_group + * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. + * @return {void} + */ + WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Promise { + return fetch(this.baseUri + 'offer/withdraw_by_inventory_item_group', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. + * Post offer/get_listing_fees + * @param {OfferKeysWithId} requestBody List of offers that needs fee information + * @return {FeesSummaryResponse} Success + */ + GetListingFees(requestBody: OfferKeysWithId): Promise { + return fetch(this.baseUri + 'offer/get_listing_fees', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. + * Post bulk_create_offer + * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {BulkOfferResponse} Success + */ + BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Promise { + return fetch(this.baseUri + 'bulk_create_offer', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post bulk_publish_offer + * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. + * @return {BulkPublishResponse} Success + */ + BulkPublishOffer(requestBody: BulkOffer): Promise { + return fetch(this.baseUri + 'bulk_publish_offer', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. + * Post offer/{offerId}/withdraw + * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. + * @return {WithdrawResponse} Success + */ + WithdrawOffer(offerId: string): Promise { + return fetch(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', { method: 'post' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Inventory_item_groupClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. + * Get inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. + * @return {InventoryItemGroup} Success + */ + GetInventoryItemGroup(inventoryItemGroupKey: string): Promise { + return fetch(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. + * @param {InventoryItemGroup} requestBody Details of the inventory Item Group + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Promise { + return fetch(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call deletes the inventory item group for a given inventoryItemGroupKey value. + * Delete inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. + * @return {void} + */ + DeleteInventoryItemGroup(inventoryItemGroupKey: string): Promise { + return fetch(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { method: 'delete' }); + } + } + + export class ListingClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. + * Post bulk_migrate_listing + * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory + * @return {BulkMigrateListingResponse} Success + */ + BulkMigrateListing(requestBody: BulkMigrateListing): Promise { + return fetch(this.baseUri + 'bulk_migrate_listing', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_listing.txt b/Tests/SwagTsTests/FetchResults/sell_listing.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/sell_listing.txt rename to Tests/SwagTsTests/FetchResults/sell_listing.ts index 2d5020c1..f2bce62f 100644 --- a/Tests/SwagTsTests/FetchResults/sell_listing.txt +++ b/Tests/SwagTsTests/FetchResults/sell_listing.ts @@ -1,168 +1,168 @@ -export namespace MyNS { - - /** The type that defines the fields for the currency and a monetary amount. */ - export interface Amount { - - /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. */ - value?: string | null; - } - - - /** The type that defines the fields for the item aspects. */ - export interface Aspect { - - /** The name of an aspect, such and Brand. */ - name?: string | null; - - /** A list of potential values for this aspect. */ - values?: Array; - } - - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ - donationPercentage?: string | null; - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** The type that defines the fields for the listing details. */ - export interface ItemDraft { - - /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - categoryId?: string | null; - - /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The type that defines the fields for the price details for an item. */ - pricingSummary?: PricingSummary; - - /** The type that defines the fields for the aspects of a product. */ - product?: Product; - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - } - - - /** The type that defines the fields for the price details for an item. */ - export interface PricingSummary { - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionReservePrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionStartPrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - price?: Amount; - } - - - /** The type that defines the fields for the aspects of a product. */ - export interface Product { - - /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ - aspects?: Array; - - /** The name brand of the item, such as Nike, Apple, etc. */ - brand?: string | null; - - /** The description of the item that was created by the seller. This can be plain text or rich content. */ - description?: string | null; - - /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - epid?: string | null; - - /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ - imageUrls?: Array; - - /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ - title?: string | null; - } - - - /** The type that defines the field for the createItemDraft response. */ - export interface ItemDraftResponse { - - /** The eBay generated ID of the listing draft. */ - itemDraftId?: string | null; - - /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ - sellFlowNativeUri?: string | null; - - /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ - sellFlowUrl?: string | null; - } - - export class Item_draftClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. - * Post item_draft/ - * @return {void} - */ - CreateItemDraft(requestBody: ItemDraft): Promise { - return fetch(this.baseUri + 'item_draft/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - -} - +export namespace MyNS { + + /** The type that defines the fields for the currency and a monetary amount. */ + export interface Amount { + + /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. */ + value?: string | null; + } + + + /** The type that defines the fields for the item aspects. */ + export interface Aspect { + + /** The name of an aspect, such and Brand. */ + name?: string | null; + + /** A list of potential values for this aspect. */ + values?: Array; + } + + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ + donationPercentage?: string | null; + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** The type that defines the fields for the listing details. */ + export interface ItemDraft { + + /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + categoryId?: string | null; + + /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The type that defines the fields for the price details for an item. */ + pricingSummary?: PricingSummary; + + /** The type that defines the fields for the aspects of a product. */ + product?: Product; + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + } + + + /** The type that defines the fields for the price details for an item. */ + export interface PricingSummary { + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionReservePrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionStartPrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + price?: Amount; + } + + + /** The type that defines the fields for the aspects of a product. */ + export interface Product { + + /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ + aspects?: Array; + + /** The name brand of the item, such as Nike, Apple, etc. */ + brand?: string | null; + + /** The description of the item that was created by the seller. This can be plain text or rich content. */ + description?: string | null; + + /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + epid?: string | null; + + /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ + imageUrls?: Array; + + /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ + title?: string | null; + } + + + /** The type that defines the field for the createItemDraft response. */ + export interface ItemDraftResponse { + + /** The eBay generated ID of the listing draft. */ + itemDraftId?: string | null; + + /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ + sellFlowNativeUri?: string | null; + + /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ + sellFlowUrl?: string | null; + } + + export class Item_draftClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. + * Post item_draft/ + * @return {void} + */ + CreateItemDraft(requestBody: ItemDraft): Promise { + return fetch(this.baseUri + 'item_draft/', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_logistics.txt b/Tests/SwagTsTests/FetchResults/sell_logistics.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/sell_logistics.txt rename to Tests/SwagTsTests/FetchResults/sell_logistics.ts index 2a3ba3a4..af708d01 100644 --- a/Tests/SwagTsTests/FetchResults/sell_logistics.txt +++ b/Tests/SwagTsTests/FetchResults/sell_logistics.ts @@ -1,483 +1,483 @@ -export namespace MyNS { - - /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ - export interface AdditionalOption { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalCost?: Amount; - - /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ - optionType?: string | null; - } - - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains contact information for an individual buyer or seller. */ - export interface Contact { - - /** The company name with which the contact is associated. */ - companyName?: string | null; - - /** This complex type specifies the details of a geographical address. */ - contactAddress?: ContactAddress; - - /** The contact's full name. */ - fullName?: string | null; - - /** This complex type contains a string field representing a telephone number. */ - primaryPhone?: PhoneNumber; - } - - - /** This complex type specifies the details of a geographical address. */ - export interface ContactAddress { - - /** The first line of the street address. */ - addressLine1?: string | null; - - /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ - addressLine2?: string | null; - - /** The city in which the address is located. */ - city?: string | null; - - /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ - county?: string | null; - - /** The postal code of the address. */ - postalCode?: string | null; - - /** The state or province in which the address is located. States and provinces often contain multiple counties. */ - stateOrProvince?: string | null; - } - - - /** This complex type contains a string field representing a telephone number. */ - export interface PhoneNumber { - - /** A telephone number. */ - phoneNumber?: string | null; - } - - - /** This complex type contains the request payload for the createFromShippingQuote method. */ - export interface CreateShipmentFromQuoteRequest { - - /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ - additionalOptions?: Array; - - /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ - labelCustomMessage?: string | null; - - /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ - labelSize?: string | null; - - /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ - rateId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ - shippingQuoteId?: string | null; - } - - - /** This complex type defines the dimensions of a package to be shipped. */ - export interface Dimensions { - - /** The numeric value of the height of the package. */ - height?: string | null; - - /** The numeric value of the length of the package. */ - length?: string | null; - - /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the width of the package. */ - width?: string | null; - } - - - /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ - export interface Order { - - /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ - channel?: string | null; - - /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ - orderId?: string | null; - } - - - /** This complex type specifies the dimensions and weight of a package. */ - export interface PackageSpecification { - - /** This complex type defines the dimensions of a package to be shipped. */ - dimensions?: Dimensions; - - /** This complex type contains information about the weight of an object such as a shipping package. */ - weight?: Weight; - } - - - /** This complex type contains information about the weight of an object such as a shipping package. */ - export interface Weight { - - /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the weight of the package, as measured by the value of unit. */ - value?: string | null; - } - - - /** This complex type defines a time window for the pickup of a package. */ - export interface PickupSlot { - - /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ - pickupSlotEndTime?: string | null; - - /** Seller-defined name for the pickup slot. */ - pickupSlotId?: string | null; - - /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ - pickupSlotStartTime?: string | null; - - /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ - pickupSlotTimeZone?: string | null; - } - - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - export interface PurchasedRate { - - /** An list of additional, optional features that have been purchased for the shipment. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ - destinationTimeZone?: string | null; - - /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - maxEstimatedDeliveryDate?: string | null; - - /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ - pickupSlotId?: string | null; - - /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ - rateId?: string | null; - - /** The ID code for the carrier that was selected for the package shipment. */ - shippingCarrierCode?: string | null; - - /** The name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ - shippingQuoteId?: string | null; - - /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ - shippingServiceCode?: string | null; - - /** The name of the shipping service. */ - shippingServiceName?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - totalShippingCost?: Amount; - } - - - /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ - export interface Rate { - - /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ - destinationTimeZone?: string | null; - - /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ - maxEstimatedDeliveryDate?: string | null; - - /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** A list of available pickup slots for the package. */ - pickupSlots?: Array; - - /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The unique eBay-assigned ID for this shipping rate. */ - rateId?: string | null; - - /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ - rateRecommendation?: Array; - - /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ - shippingCarrierCode?: string | null; - - /** The common name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ - shippingServiceCode?: string | null; - - /** The common name of the shipping service. */ - shippingServiceName?: string | null; - } - - - /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ - export interface Shipment { - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - cancellation?: ShipmentCancellation; - - /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - creationDate?: string | null; - - /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ - labelCustomMessage?: string | null; - - /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ - labelDownloadUrl?: string | null; - - /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ - labelSize?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - rate?: PurchasedRate; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ - shipmentId?: string | null; - - /** A unique carrier-assigned ID string that can be used to track the shipment. */ - shipmentTrackingNumber?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - export interface ShipmentCancellation { - - /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ - cancellationRequestedDate?: string | null; - - /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ - cancellationStatus?: string | null; - } - - - /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ - export interface ShippingQuote { - - /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ - creationDate?: string | null; - - /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ - expirationDate?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ - rates?: Array; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ - shippingQuoteId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - - /** A list of any warnings triggered by the request. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning message. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ - export interface ShippingQuoteRequest { - - /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - export class ShipmentClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. - * Post shipment/create_from_shipping_quote - * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. - * @return {void} - */ - CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Promise { - return fetch(this.baseUri + 'shipment/create_from_shipping_quote', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. - * Get shipment/{shipmentId} - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - GetShipment(shipmentId: string): Promise { - return fetch(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. - * Get shipment/{shipmentId}/download_label_file - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {void} Success - */ - DownloadLabelFile(shipmentId: string): Promise { - return fetch(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { method: 'get' }); - } - - /** - * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. - * Post shipment/{shipmentId}/cancel - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - CancelShipment(shipmentId: string): Promise { - return fetch(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', { method: 'post' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Shipping_quoteClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. - * Post shipping_quote - * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. - * @return {void} - */ - CreateShippingQuote(requestBody: ShippingQuoteRequest): Promise { - return fetch(this.baseUri + 'shipping_quote', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. - * Get shipping_quote/{shippingQuoteId} - * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. - * @return {ShippingQuote} Success - */ - GetShippingQuote(shippingQuoteId: string): Promise { - return fetch(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ + export interface AdditionalOption { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalCost?: Amount; + + /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ + optionType?: string | null; + } + + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains contact information for an individual buyer or seller. */ + export interface Contact { + + /** The company name with which the contact is associated. */ + companyName?: string | null; + + /** This complex type specifies the details of a geographical address. */ + contactAddress?: ContactAddress; + + /** The contact's full name. */ + fullName?: string | null; + + /** This complex type contains a string field representing a telephone number. */ + primaryPhone?: PhoneNumber; + } + + + /** This complex type specifies the details of a geographical address. */ + export interface ContactAddress { + + /** The first line of the street address. */ + addressLine1?: string | null; + + /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ + addressLine2?: string | null; + + /** The city in which the address is located. */ + city?: string | null; + + /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ + county?: string | null; + + /** The postal code of the address. */ + postalCode?: string | null; + + /** The state or province in which the address is located. States and provinces often contain multiple counties. */ + stateOrProvince?: string | null; + } + + + /** This complex type contains a string field representing a telephone number. */ + export interface PhoneNumber { + + /** A telephone number. */ + phoneNumber?: string | null; + } + + + /** This complex type contains the request payload for the createFromShippingQuote method. */ + export interface CreateShipmentFromQuoteRequest { + + /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ + additionalOptions?: Array; + + /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ + labelCustomMessage?: string | null; + + /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ + labelSize?: string | null; + + /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ + rateId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ + shippingQuoteId?: string | null; + } + + + /** This complex type defines the dimensions of a package to be shipped. */ + export interface Dimensions { + + /** The numeric value of the height of the package. */ + height?: string | null; + + /** The numeric value of the length of the package. */ + length?: string | null; + + /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the width of the package. */ + width?: string | null; + } + + + /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ + export interface Order { + + /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ + channel?: string | null; + + /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ + orderId?: string | null; + } + + + /** This complex type specifies the dimensions and weight of a package. */ + export interface PackageSpecification { + + /** This complex type defines the dimensions of a package to be shipped. */ + dimensions?: Dimensions; + + /** This complex type contains information about the weight of an object such as a shipping package. */ + weight?: Weight; + } + + + /** This complex type contains information about the weight of an object such as a shipping package. */ + export interface Weight { + + /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the weight of the package, as measured by the value of unit. */ + value?: string | null; + } + + + /** This complex type defines a time window for the pickup of a package. */ + export interface PickupSlot { + + /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ + pickupSlotEndTime?: string | null; + + /** Seller-defined name for the pickup slot. */ + pickupSlotId?: string | null; + + /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ + pickupSlotStartTime?: string | null; + + /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ + pickupSlotTimeZone?: string | null; + } + + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + export interface PurchasedRate { + + /** An list of additional, optional features that have been purchased for the shipment. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ + destinationTimeZone?: string | null; + + /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + maxEstimatedDeliveryDate?: string | null; + + /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ + pickupSlotId?: string | null; + + /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ + rateId?: string | null; + + /** The ID code for the carrier that was selected for the package shipment. */ + shippingCarrierCode?: string | null; + + /** The name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ + shippingQuoteId?: string | null; + + /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ + shippingServiceCode?: string | null; + + /** The name of the shipping service. */ + shippingServiceName?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + totalShippingCost?: Amount; + } + + + /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ + export interface Rate { + + /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ + destinationTimeZone?: string | null; + + /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ + maxEstimatedDeliveryDate?: string | null; + + /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** A list of available pickup slots for the package. */ + pickupSlots?: Array; + + /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The unique eBay-assigned ID for this shipping rate. */ + rateId?: string | null; + + /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ + rateRecommendation?: Array; + + /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ + shippingCarrierCode?: string | null; + + /** The common name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ + shippingServiceCode?: string | null; + + /** The common name of the shipping service. */ + shippingServiceName?: string | null; + } + + + /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ + export interface Shipment { + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + cancellation?: ShipmentCancellation; + + /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + creationDate?: string | null; + + /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ + labelCustomMessage?: string | null; + + /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ + labelDownloadUrl?: string | null; + + /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ + labelSize?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + rate?: PurchasedRate; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ + shipmentId?: string | null; + + /** A unique carrier-assigned ID string that can be used to track the shipment. */ + shipmentTrackingNumber?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + export interface ShipmentCancellation { + + /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ + cancellationRequestedDate?: string | null; + + /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ + cancellationStatus?: string | null; + } + + + /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ + export interface ShippingQuote { + + /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ + creationDate?: string | null; + + /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ + expirationDate?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ + rates?: Array; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ + shippingQuoteId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + + /** A list of any warnings triggered by the request. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning message. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ + export interface ShippingQuoteRequest { + + /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + export class ShipmentClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. + * Post shipment/create_from_shipping_quote + * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. + * @return {void} + */ + CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Promise { + return fetch(this.baseUri + 'shipment/create_from_shipping_quote', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. + * Get shipment/{shipmentId} + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + GetShipment(shipmentId: string): Promise { + return fetch(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. + * Get shipment/{shipmentId}/download_label_file + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {void} Success + */ + DownloadLabelFile(shipmentId: string): Promise { + return fetch(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { method: 'get' }); + } + + /** + * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. + * Post shipment/{shipmentId}/cancel + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + CancelShipment(shipmentId: string): Promise { + return fetch(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', { method: 'post' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Shipping_quoteClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. + * Post shipping_quote + * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. + * @return {void} + */ + CreateShippingQuote(requestBody: ShippingQuoteRequest): Promise { + return fetch(this.baseUri + 'shipping_quote', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. + * Get shipping_quote/{shippingQuoteId} + * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. + * @return {ShippingQuote} Success + */ + GetShippingQuote(shippingQuoteId: string): Promise { + return fetch(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_marketing.txt b/Tests/SwagTsTests/FetchResults/sell_marketing.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/sell_marketing.txt rename to Tests/SwagTsTests/FetchResults/sell_marketing.ts index 248b6d79..40dea17c 100644 --- a/Tests/SwagTsTests/FetchResults/sell_marketing.txt +++ b/Tests/SwagTsTests/FetchResults/sell_marketing.ts @@ -1,1761 +1,1761 @@ -export namespace MyNS { - - /** This type defines the fields for an ad. */ - export interface Ad { - - /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ - adId?: string | null; - - /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type is a container for a list of ad IDs. */ - export interface AdIds { - - /** A list of ad ID's. */ - adIds?: Array; - } - - - /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface AdPagedCollection { - - /** A list of ads contained on this page from the paginated response. */ - ads?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for an ad ID and its associated URL. */ - export interface AdReference { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** The URI of an ad. You can use this URI to retrieve the ad. */ - href?: string | null; - } - - - /** This type is a container for a list of ad IDs and their associated URIs. */ - export interface AdReferences { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines the fields returned in an ad response. */ - export interface AdResponse { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** An array of errors associated with the request. */ - errors?: Array; - - /** The URI that points to the ad. */ - href?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields returned in an error condition. */ - export interface Error { - - /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** The name of the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ - longMessage?: string | null; - - /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ - message?: string | null; - - /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** A name/value pair that provides parameter details regarding a warning or error condition. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** The value that was set for the element specified in the name field. */ - value?: string | null; - } - - - /** This type defines the container for an array of ads. */ - export interface Ads { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - export interface Amount { - - /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ - value?: string | null; - } - - - /** This type defines the fields for any warning error messages. */ - export interface BaseResponse { - - /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ - warnings?: Array; - } - - - /** This type defines the fields for the create ads in bulk response. */ - export interface BulkAdResponse { - - /** A list of ads processed by the call. */ - responses?: Array; - } - - - /** This type defines the fields for the create ads in bulk by listing IDs. */ - export interface BulkCreateAdRequest { - - /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ - requests?: Array; - } - - - /** This type defines the fields for the create ad request. */ - export interface CreateAdRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ - export interface BulkCreateAdsByInventoryReferenceRequest { - - /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to create ads by inventory reference ID request. */ - export interface CreateAdsByInventoryReferenceRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ - export interface BulkCreateAdsByInventoryReferenceResponse { - - /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ - responses?: Array; - } - - - /** This type defines the fields returned when you create an ad by inventory reference ID. */ - export interface CreateAdsByInventoryReferenceResponse { - - /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ - ads?: Array; - - /** An array of errors or warnings associated with the create-ads request. */ - errors?: Array; - - /** The seller's inventory reference ID that's associated with the ad. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that the call uses to remove ads in bulk. */ - export interface BulkDeleteAdRequest { - - /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - requests?: Array; - } - - - /** This type defines the fields used in a delete-ad request. */ - export interface DeleteAdRequest { - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ - export interface BulkDeleteAdResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned in a delete-ad response. */ - export interface DeleteAdResponse { - - /** The ID of the ad that was deleted. */ - adId?: string | null; - - /** An array of the errors or warnings associated with the request. */ - errors?: Array; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ - export interface BulkDeleteAdsByInventoryReferenceRequest { - - /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ - export interface DeleteAdsByInventoryReferenceRequest { - - /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ - export interface BulkDeleteAdsByInventoryReferenceResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ - export interface DeleteAdsByInventoryReferenceResponse { - - /** The list of ad IDs that were removed from the campaign. */ - adIds?: Array; - - /** The container for the errors associated with the request. */ - errors?: Array; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that describe an ad campaign. */ - export interface Campaign { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ - campaignId?: string | null; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ - campaignStatus?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - export interface CampaignCriterion { - - /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ - criterionType?: string | null; - - /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ - selectionRules?: Array; - } - - - /** This type specifies the selection rules used to create a campaign. */ - export interface SelectionRule { - - /** A list of the brands of the items to be included in the campaign. */ - brands?: Array; - - /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ - categoryIds?: Array; - - /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ - categoryScope?: string | null; - - /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ - listingConditionIds?: Array; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - maxPrice?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minPrice?: Amount; - } - - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - export interface FundingStrategy { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ - fundingModel?: string | null; - } - - - /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface CampaignPagedCollection { - - /** A list of campaigns contained on this page from the paginated response. */ - campaigns?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type contains a list of campaigns. */ - export interface Campaigns { - - /** An array of campaigns and their details. */ - campaigns?: Array; - } - - - /** This type defines the fields needed for a clone-campaign request. */ - export interface CloneCampaignRequest { - - /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ - export interface CreateCampaignRequest { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ - export interface CreateReportTask { - - /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ - dimensions?: Array; - - /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ - inventoryReferences?: Array; - - /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ - listingIds?: Array; - - /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ - metricKeys?: Array; - - /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ - export interface Dimension { - - /** A list of annotations associated with the dimension of the report. */ - annotationKeys?: Array; - - /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ - dimensionKey?: string | null; - } - - - /** This type defines the fields contained in an inventory reference ID. */ - export interface InventoryReference { - - /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ - inventoryReferenceId?: string | null; - - /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ - export interface DimensionKeyAnnotation { - - /** An annotation key associated with the dimension. */ - annotationKey?: string | null; - - /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - } - - - /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ - export interface DimensionMetadata { - - /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the dimension used to create the report. */ - dimensionKey?: string | null; - - /** An list of annotation keys associated with the specified dimension of the report. */ - dimensionKeyAnnotations?: Array; - } - - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - export interface DiscountBenefit { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffItem?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffOrder?: Amount; - - /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ - percentageOffItem?: string | null; - - /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ - percentageOffOrder?: string | null; - } - - - /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ - export interface DiscountRule { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountSpecification?: DiscountSpecification; - - /** - * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - export interface DiscountSpecification { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - forEachAmount?: Amount; - - /** - * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - forEachQuantity?: number | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minAmount?: Amount; - - /** - * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - minQuantity?: number | null; - - /** - * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfDiscountedItems?: number | null; - } - - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - export interface InventoryCriterion { - - /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ - inventoryCriterionType?: string | null; - - /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ - inventoryItems?: Array; - - /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ - listingIds?: Array; - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - ruleCriteria?: RuleCriteria; - } - - - /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ - export interface InventoryItem { - - /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ - inventoryReferenceId?: string | null; - } - - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - export interface RuleCriteria { - - /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeInventoryItems?: Array; - - /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeListingIds?: Array; - - /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ - markupInventoryItems?: Array; - - /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ - markupListingIds?: Array; - - /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ - selectionRules?: Array; - } - - - /** This type defines the fields used to describe an item price markdown promotion. */ - export interface ItemPriceMarkdown { - - /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ - applyFreeShipping?: boolean | null; - - /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ - blockPriceIncreaseInItemRevision?: boolean | null; - - /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ - selectedInventoryDiscounts?: Array; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ - export interface SelectedInventoryDiscount { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ - discountId?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** - * For markdown promotions, this field is reserved for future use. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ - export interface ItemPromotion { - - /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This complex type defines the fields returned for a promotion. */ - export interface ItemPromotionResponse { - - /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the name and data type of a metric. */ - export interface MetricMetadata { - - /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the metric. */ - metricKey?: string | null; - } - - - /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ - export interface PromotionDetail { - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** The URI of the promotion details. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields in a promotion-level report. */ - export interface PromotionReportDetail { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemRevenue?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderRevenue?: Amount; - - /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ - averageOrderSize?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** - * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemsSoldQuantity?: number | null; - - /** - * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfOrdersSold?: number | null; - - /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ - percentageSalesLift?: string | null; - - /** The URI of the promotion report. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ - promotionReportId?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ - promotions?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsReportPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list of promotionReports contained in the paginated result set. */ - promotionReports?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields included in the report. */ - export interface ReportMetadata { - - /** A list containing the metadata for the dimension used in the report. */ - dimensionMetadata?: Array; - - /** - * The maximum number of dimensions that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfDimensionsToRequest?: number | null; - - /** - * The maximum number of metrics that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfMetricsToRequest?: number | null; - - /** A list containing the metadata for the metrics in the report. */ - metricMetadata?: Array; - - /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the metadata used by the all report types. */ - export interface ReportMetadatas { - - /** A list of the metadata for the associated report type. */ - reportMetadata?: Array; - } - - - /** This type defines the fields in a report task. */ - export interface ReportTask { - - /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** A list containing the dimension in the report. */ - dimensions?: Array; - - /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ - inventoryReferences?: Array; - - /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingIds?: Array; - - /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A list of metrics for the report task. */ - metricKeys?: Array; - - /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportExpirationDate?: string | null; - - /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The URL of the generated report, which can be used to download the report once it has been generated. */ - reportHref?: string | null; - - /** A unique eBay-assigned ID for the report. */ - reportId?: string | null; - - /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ - reportName?: string | null; - - /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCompletionDate?: string | null; - - /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCreationDate?: string | null; - - /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskExpectedCompletionDate?: string | null; - - /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ - reportTaskId?: string | null; - - /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ - reportTaskStatus?: string | null; - - /** A status message with additional information about the report task. */ - reportTaskStatusMessage?: string | null; - - /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface ReportTaskPagedCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** A list of report tasks contained on this page from the paginated response. */ - reportTasks?: Array; - } - - - /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ - export interface SummaryReportResponse { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** The date the report was generated. */ - lastUpdated?: string | null; - - /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ - percentageSalesLift?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type specifies the bid percentage for an ad campaign. */ - export interface UpdateBidPercentageRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - } - - - /** This type specifies the updated name, and start and end dates for an update-campaign request. */ - export interface UpdateCampaignIdentificationRequest { - - /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ - campaignName?: string | null; - - /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ - startDate?: string | null; - } - - export class AdClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @return {BulkAdResponse} Success - */ - BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. - * @return {BulkDeleteAdsByInventoryReferenceResponse} Success - */ - BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. - * @return {BulkDeleteAdResponse} Success - */ - BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. - * @return {BulkAdResponse} Success - */ - BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {AdPagedCollection} Success - */ - GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. - * @return {void} - */ - CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. - * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. - * @return {void} - */ - CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. - * Get ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Ad} Success - */ - GetAd(ad_id: string, campaign_id: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. - * Delete ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteAd(ad_id: string, campaign_id: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { method: 'delete' }); - } - - /** - * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. - * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. - * @return {AdIds} Success - */ - DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. - * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. - * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. - * @return {Ads} Success - */ - GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. - * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid - * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. - * @return {void} - */ - UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class CampaignClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). - * Post ad_campaign/{campaign_id}/clone - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. - * @return {void} - */ - CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign - * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name - * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status - * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. - * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. - * @return {CampaignPagedCollection} Success - */ - GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Promise { - return fetch(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. - * Post ad_campaign - * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. - * @return {void} - */ - CreateCampaign(requestBody: CreateCampaignRequest): Promise { - return fetch(this.baseUri + 'ad_campaign', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Campaign} Success - */ - GetCampaign(campaign_id: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Delete ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteCampaign(campaign_id: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { method: 'delete' }); - } - - /** - * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/end - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - EndCampaign(campaign_id: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', { method: 'post' }); - } - - /** - * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/find_campaign_by_ad_reference - * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} listing_id Identifier of the eBay listing associated with the ad. - * @return {Campaigns} Success - */ - FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Promise { - return fetch(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/get_campaign_by_name - * @param {string} campaign_name Name of the campaign. - * @return {Campaign} Success - */ - GetCampaignByName(campaign_name: string): Promise { - return fetch(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/pause - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - PauseCampaign(campaign_id: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', { method: 'post' }); - } - - /** - * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/resume - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - ResumeCampaign(campaign_id: string): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', { method: 'post' }); - } - - /** - * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. - * Post ad_campaign/{campaign_id}/update_campaign_identification - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. - * @return {void} - */ - UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Promise { - return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - - export class Ad_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. - * Get ad_report/{report_id} - * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. - * @return {void} Success - */ - GetReport(report_id: string): Promise { - return fetch(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { method: 'get' }); - } - } - - export class Ad_report_metadataClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. - * Get ad_report_metadata - * @return {ReportMetadatas} Success - */ - GetReportMetadata(): Promise { - return fetch(this.baseUri + 'ad_report_metadata', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. - * Get ad_report_metadata/{report_type} - * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT - * @return {ReportMetadata} Success - */ - GetReportMetadataForReportType(report_type: string): Promise { - return fetch(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Ad_report_taskClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. - * Get ad_report_task - * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 - * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED - * @return {ReportTaskPagedCollection} Success - */ - GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Promise { - return fetch(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. - * Post ad_report_task - * @param {CreateReportTask} requestBody The container for the fields that define the report task. - * @return {void} - */ - CreateReportTask(requestBody: CreateReportTask): Promise { - return fetch(this.baseUri + 'ad_report_task', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Get ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {ReportTask} Success - */ - GetReportTask(report_task_id: string): Promise { - return fetch(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Delete ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {void} - */ - DeleteReportTask(report_task_id: string): Promise { - return fetch(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { method: 'delete' }); - } - } - - export class Item_price_markdownClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. - * Post item_price_markdown - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {void} - */ - CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Promise { - return fetch(this.baseUri + 'item_price_markdown', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPriceMarkdown} Success - */ - GetItemPriceMarkdownPromotion(promotion_id: string): Promise { - return fetch(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. - * Put item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {string} Success - */ - UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Promise { - return fetch(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); - } - - /** - * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. - * Delete item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPriceMarkdownPromotion(promotion_id: string): Promise { - return fetch(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'delete' }); - } - } - - export class Item_promotionClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. - * Post item_promotion - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {void} - */ - CreateItemPromotion(requestBody: ItemPromotion): Promise { - return fetch(this.baseUri + 'item_promotion', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - - /** - * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPromotionResponse} Success - */ - GetItemPromotion(promotion_id: string): Promise { - return fetch(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. - * Put item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {BaseResponse} Success - */ - UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Promise { - return fetch(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. - * Delete item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPromotion(promotion_id: string): Promise { - return fetch(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'delete' }); - } - } - - export class PromotionClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 - * Get promotion/{promotion_id}/get_listing_set - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {string} q Reserved for future use. - * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html - * @return {void} - */ - GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Promise { - return fetch(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { method: 'get' }); - } - - /** - * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 - * Get promotion - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 - * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @return {PromotionsPagedCollection} Success - */ - GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Promise { - return fetch(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). - * Post promotion/{promotion_id}/pause - * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - PausePromotion(promotion_id: string): Promise { - return fetch(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', { method: 'post' }); - } - - /** - * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. - * Post promotion/{promotion_id}/resume - * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - ResumePromotion(promotion_id: string): Promise { - return fetch(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', { method: 'post' }); - } - } - - export class Promotion_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. - * Get promotion_report - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 - * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @return {PromotionsReportPagedCollection} Success - */ - GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Promise { - return fetch(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class Promotion_summary_reportClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. - * Get promotion_summary_report - * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @return {SummaryReportResponse} Success - */ - GetPromotionSummaryReport(marketplace_id: string): Promise { - return fetch(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** This type defines the fields for an ad. */ + export interface Ad { + + /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ + adId?: string | null; + + /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type is a container for a list of ad IDs. */ + export interface AdIds { + + /** A list of ad ID's. */ + adIds?: Array; + } + + + /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface AdPagedCollection { + + /** A list of ads contained on this page from the paginated response. */ + ads?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for an ad ID and its associated URL. */ + export interface AdReference { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** The URI of an ad. You can use this URI to retrieve the ad. */ + href?: string | null; + } + + + /** This type is a container for a list of ad IDs and their associated URIs. */ + export interface AdReferences { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines the fields returned in an ad response. */ + export interface AdResponse { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** An array of errors associated with the request. */ + errors?: Array; + + /** The URI that points to the ad. */ + href?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields returned in an error condition. */ + export interface Error { + + /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** The name of the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ + longMessage?: string | null; + + /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ + message?: string | null; + + /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** A name/value pair that provides parameter details regarding a warning or error condition. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** The value that was set for the element specified in the name field. */ + value?: string | null; + } + + + /** This type defines the container for an array of ads. */ + export interface Ads { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + export interface Amount { + + /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ + value?: string | null; + } + + + /** This type defines the fields for any warning error messages. */ + export interface BaseResponse { + + /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ + warnings?: Array; + } + + + /** This type defines the fields for the create ads in bulk response. */ + export interface BulkAdResponse { + + /** A list of ads processed by the call. */ + responses?: Array; + } + + + /** This type defines the fields for the create ads in bulk by listing IDs. */ + export interface BulkCreateAdRequest { + + /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ + requests?: Array; + } + + + /** This type defines the fields for the create ad request. */ + export interface CreateAdRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ + export interface BulkCreateAdsByInventoryReferenceRequest { + + /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to create ads by inventory reference ID request. */ + export interface CreateAdsByInventoryReferenceRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ + export interface BulkCreateAdsByInventoryReferenceResponse { + + /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ + responses?: Array; + } + + + /** This type defines the fields returned when you create an ad by inventory reference ID. */ + export interface CreateAdsByInventoryReferenceResponse { + + /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ + ads?: Array; + + /** An array of errors or warnings associated with the create-ads request. */ + errors?: Array; + + /** The seller's inventory reference ID that's associated with the ad. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that the call uses to remove ads in bulk. */ + export interface BulkDeleteAdRequest { + + /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + requests?: Array; + } + + + /** This type defines the fields used in a delete-ad request. */ + export interface DeleteAdRequest { + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ + export interface BulkDeleteAdResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned in a delete-ad response. */ + export interface DeleteAdResponse { + + /** The ID of the ad that was deleted. */ + adId?: string | null; + + /** An array of the errors or warnings associated with the request. */ + errors?: Array; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ + export interface BulkDeleteAdsByInventoryReferenceRequest { + + /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ + export interface DeleteAdsByInventoryReferenceRequest { + + /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ + export interface BulkDeleteAdsByInventoryReferenceResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ + export interface DeleteAdsByInventoryReferenceResponse { + + /** The list of ad IDs that were removed from the campaign. */ + adIds?: Array; + + /** The container for the errors associated with the request. */ + errors?: Array; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that describe an ad campaign. */ + export interface Campaign { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ + campaignId?: string | null; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ + campaignStatus?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + export interface CampaignCriterion { + + /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ + criterionType?: string | null; + + /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ + selectionRules?: Array; + } + + + /** This type specifies the selection rules used to create a campaign. */ + export interface SelectionRule { + + /** A list of the brands of the items to be included in the campaign. */ + brands?: Array; + + /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ + categoryIds?: Array; + + /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ + categoryScope?: string | null; + + /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ + listingConditionIds?: Array; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + maxPrice?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minPrice?: Amount; + } + + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + export interface FundingStrategy { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ + fundingModel?: string | null; + } + + + /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface CampaignPagedCollection { + + /** A list of campaigns contained on this page from the paginated response. */ + campaigns?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type contains a list of campaigns. */ + export interface Campaigns { + + /** An array of campaigns and their details. */ + campaigns?: Array; + } + + + /** This type defines the fields needed for a clone-campaign request. */ + export interface CloneCampaignRequest { + + /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ + export interface CreateCampaignRequest { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ + export interface CreateReportTask { + + /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ + dimensions?: Array; + + /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ + inventoryReferences?: Array; + + /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ + listingIds?: Array; + + /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ + metricKeys?: Array; + + /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ + export interface Dimension { + + /** A list of annotations associated with the dimension of the report. */ + annotationKeys?: Array; + + /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ + dimensionKey?: string | null; + } + + + /** This type defines the fields contained in an inventory reference ID. */ + export interface InventoryReference { + + /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ + inventoryReferenceId?: string | null; + + /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ + export interface DimensionKeyAnnotation { + + /** An annotation key associated with the dimension. */ + annotationKey?: string | null; + + /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + } + + + /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ + export interface DimensionMetadata { + + /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the dimension used to create the report. */ + dimensionKey?: string | null; + + /** An list of annotation keys associated with the specified dimension of the report. */ + dimensionKeyAnnotations?: Array; + } + + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + export interface DiscountBenefit { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffItem?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffOrder?: Amount; + + /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ + percentageOffItem?: string | null; + + /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ + percentageOffOrder?: string | null; + } + + + /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ + export interface DiscountRule { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountSpecification?: DiscountSpecification; + + /** + * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + export interface DiscountSpecification { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + forEachAmount?: Amount; + + /** + * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + forEachQuantity?: number | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minAmount?: Amount; + + /** + * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + minQuantity?: number | null; + + /** + * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfDiscountedItems?: number | null; + } + + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + export interface InventoryCriterion { + + /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ + inventoryCriterionType?: string | null; + + /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ + inventoryItems?: Array; + + /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ + listingIds?: Array; + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + ruleCriteria?: RuleCriteria; + } + + + /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ + export interface InventoryItem { + + /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ + inventoryReferenceId?: string | null; + } + + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + export interface RuleCriteria { + + /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeInventoryItems?: Array; + + /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeListingIds?: Array; + + /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ + markupInventoryItems?: Array; + + /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ + markupListingIds?: Array; + + /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ + selectionRules?: Array; + } + + + /** This type defines the fields used to describe an item price markdown promotion. */ + export interface ItemPriceMarkdown { + + /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ + applyFreeShipping?: boolean | null; + + /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ + blockPriceIncreaseInItemRevision?: boolean | null; + + /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ + selectedInventoryDiscounts?: Array; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ + export interface SelectedInventoryDiscount { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ + discountId?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** + * For markdown promotions, this field is reserved for future use. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ + export interface ItemPromotion { + + /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This complex type defines the fields returned for a promotion. */ + export interface ItemPromotionResponse { + + /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the name and data type of a metric. */ + export interface MetricMetadata { + + /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the metric. */ + metricKey?: string | null; + } + + + /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ + export interface PromotionDetail { + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** The URI of the promotion details. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields in a promotion-level report. */ + export interface PromotionReportDetail { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemRevenue?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderRevenue?: Amount; + + /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ + averageOrderSize?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** + * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemsSoldQuantity?: number | null; + + /** + * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfOrdersSold?: number | null; + + /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ + percentageSalesLift?: string | null; + + /** The URI of the promotion report. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ + promotionReportId?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ + promotions?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsReportPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list of promotionReports contained in the paginated result set. */ + promotionReports?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields included in the report. */ + export interface ReportMetadata { + + /** A list containing the metadata for the dimension used in the report. */ + dimensionMetadata?: Array; + + /** + * The maximum number of dimensions that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfDimensionsToRequest?: number | null; + + /** + * The maximum number of metrics that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfMetricsToRequest?: number | null; + + /** A list containing the metadata for the metrics in the report. */ + metricMetadata?: Array; + + /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the metadata used by the all report types. */ + export interface ReportMetadatas { + + /** A list of the metadata for the associated report type. */ + reportMetadata?: Array; + } + + + /** This type defines the fields in a report task. */ + export interface ReportTask { + + /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** A list containing the dimension in the report. */ + dimensions?: Array; + + /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ + inventoryReferences?: Array; + + /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingIds?: Array; + + /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A list of metrics for the report task. */ + metricKeys?: Array; + + /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportExpirationDate?: string | null; + + /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The URL of the generated report, which can be used to download the report once it has been generated. */ + reportHref?: string | null; + + /** A unique eBay-assigned ID for the report. */ + reportId?: string | null; + + /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ + reportName?: string | null; + + /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCompletionDate?: string | null; + + /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCreationDate?: string | null; + + /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskExpectedCompletionDate?: string | null; + + /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ + reportTaskId?: string | null; + + /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ + reportTaskStatus?: string | null; + + /** A status message with additional information about the report task. */ + reportTaskStatusMessage?: string | null; + + /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface ReportTaskPagedCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** A list of report tasks contained on this page from the paginated response. */ + reportTasks?: Array; + } + + + /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ + export interface SummaryReportResponse { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** The date the report was generated. */ + lastUpdated?: string | null; + + /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ + percentageSalesLift?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type specifies the bid percentage for an ad campaign. */ + export interface UpdateBidPercentageRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + } + + + /** This type specifies the updated name, and start and end dates for an update-campaign request. */ + export interface UpdateCampaignIdentificationRequest { + + /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ + campaignName?: string | null; + + /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ + startDate?: string | null; + } + + export class AdClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @return {BulkAdResponse} Success + */ + BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. + * @return {BulkDeleteAdsByInventoryReferenceResponse} Success + */ + BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. + * @return {BulkDeleteAdResponse} Success + */ + BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. + * @return {BulkAdResponse} Success + */ + BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {AdPagedCollection} Success + */ + GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. + * @return {void} + */ + CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. + * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. + * @return {void} + */ + CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. + * Get ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Ad} Success + */ + GetAd(ad_id: string, campaign_id: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. + * Delete ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteAd(ad_id: string, campaign_id: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { method: 'delete' }); + } + + /** + * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. + * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. + * @return {AdIds} Success + */ + DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. + * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. + * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. + * @return {Ads} Success + */ + GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. + * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid + * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. + * @return {void} + */ + UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class CampaignClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). + * Post ad_campaign/{campaign_id}/clone + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. + * @return {void} + */ + CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign + * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name + * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status + * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. + * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. + * @return {CampaignPagedCollection} Success + */ + GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Promise { + return fetch(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. + * Post ad_campaign + * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. + * @return {void} + */ + CreateCampaign(requestBody: CreateCampaignRequest): Promise { + return fetch(this.baseUri + 'ad_campaign', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Campaign} Success + */ + GetCampaign(campaign_id: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Delete ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteCampaign(campaign_id: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { method: 'delete' }); + } + + /** + * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/end + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + EndCampaign(campaign_id: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', { method: 'post' }); + } + + /** + * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/find_campaign_by_ad_reference + * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} listing_id Identifier of the eBay listing associated with the ad. + * @return {Campaigns} Success + */ + FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Promise { + return fetch(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/get_campaign_by_name + * @param {string} campaign_name Name of the campaign. + * @return {Campaign} Success + */ + GetCampaignByName(campaign_name: string): Promise { + return fetch(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/pause + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + PauseCampaign(campaign_id: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', { method: 'post' }); + } + + /** + * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/resume + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + ResumeCampaign(campaign_id: string): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', { method: 'post' }); + } + + /** + * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. + * Post ad_campaign/{campaign_id}/update_campaign_identification + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. + * @return {void} + */ + UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Promise { + return fetch(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + + export class Ad_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. + * Get ad_report/{report_id} + * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. + * @return {void} Success + */ + GetReport(report_id: string): Promise { + return fetch(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { method: 'get' }); + } + } + + export class Ad_report_metadataClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. + * Get ad_report_metadata + * @return {ReportMetadatas} Success + */ + GetReportMetadata(): Promise { + return fetch(this.baseUri + 'ad_report_metadata', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. + * Get ad_report_metadata/{report_type} + * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT + * @return {ReportMetadata} Success + */ + GetReportMetadataForReportType(report_type: string): Promise { + return fetch(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Ad_report_taskClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. + * Get ad_report_task + * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 + * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED + * @return {ReportTaskPagedCollection} Success + */ + GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Promise { + return fetch(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. + * Post ad_report_task + * @param {CreateReportTask} requestBody The container for the fields that define the report task. + * @return {void} + */ + CreateReportTask(requestBody: CreateReportTask): Promise { + return fetch(this.baseUri + 'ad_report_task', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Get ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {ReportTask} Success + */ + GetReportTask(report_task_id: string): Promise { + return fetch(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Delete ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {void} + */ + DeleteReportTask(report_task_id: string): Promise { + return fetch(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { method: 'delete' }); + } + } + + export class Item_price_markdownClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. + * Post item_price_markdown + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {void} + */ + CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Promise { + return fetch(this.baseUri + 'item_price_markdown', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPriceMarkdown} Success + */ + GetItemPriceMarkdownPromotion(promotion_id: string): Promise { + return fetch(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. + * Put item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {string} Success + */ + UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Promise { + return fetch(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=204) return d.status == 204 ? null : d.text(); throw d;}); + } + + /** + * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. + * Delete item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPriceMarkdownPromotion(promotion_id: string): Promise { + return fetch(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'delete' }); + } + } + + export class Item_promotionClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. + * Post item_promotion + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {void} + */ + CreateItemPromotion(requestBody: ItemPromotion): Promise { + return fetch(this.baseUri + 'item_promotion', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + + /** + * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPromotionResponse} Success + */ + GetItemPromotion(promotion_id: string): Promise { + return fetch(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. + * Put item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {BaseResponse} Success + */ + UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Promise { + return fetch(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'put', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. + * Delete item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPromotion(promotion_id: string): Promise { + return fetch(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { method: 'delete' }); + } + } + + export class PromotionClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 + * Get promotion/{promotion_id}/get_listing_set + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {string} q Reserved for future use. + * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html + * @return {void} + */ + GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Promise { + return fetch(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { method: 'get' }); + } + + /** + * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 + * Get promotion + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 + * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @return {PromotionsPagedCollection} Success + */ + GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Promise { + return fetch(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). + * Post promotion/{promotion_id}/pause + * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + PausePromotion(promotion_id: string): Promise { + return fetch(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', { method: 'post' }); + } + + /** + * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. + * Post promotion/{promotion_id}/resume + * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + ResumePromotion(promotion_id: string): Promise { + return fetch(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', { method: 'post' }); + } + } + + export class Promotion_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. + * Get promotion_report + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 + * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @return {PromotionsReportPagedCollection} Success + */ + GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Promise { + return fetch(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class Promotion_summary_reportClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. + * Get promotion_summary_report + * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @return {SummaryReportResponse} Success + */ + GetPromotionSummaryReport(marketplace_id: string): Promise { + return fetch(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_metadata.txt b/Tests/SwagTsTests/FetchResults/sell_metadata.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/sell_metadata.txt rename to Tests/SwagTsTests/FetchResults/sell_metadata.ts index ebd8b6fc..d6de11eb 100644 --- a/Tests/SwagTsTests/FetchResults/sell_metadata.txt +++ b/Tests/SwagTsTests/FetchResults/sell_metadata.ts @@ -1,362 +1,362 @@ -export namespace MyNS { - - /** A unique ID for a sales tax jurisdiction. */ - export interface SalesTaxJurisdiction { - - /** The unique ID for a sales tax jurisdiction. */ - salesTaxJurisdictionId?: string | null; - } - - - /** This complex type contains a list of sales tax jurisdictions. */ - export interface SalesTaxJurisdictions { - - /** A list of sales tax jurisdictions. */ - salesTaxJurisdictions?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An amount of time, as measured by the time-measurement units specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for a error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - export interface AutomotivePartsCompatibilityPolicy { - - /** The category ID to which the automotive-parts-compatibility policies apply. */ - categoryId?: string | null; - - /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ - compatibilityBasedOn?: string | null; - - /** Indicates the compatibility classification of the part based on high-level vehicle types. */ - compatibleVehicleTypes?: Array; - - /** - * Specifies the maximum number of compatible vehicle-applications allowed per item. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfCompatibleVehicles?: number | null; - } - - export interface AutomotivePartsCompatibilityPolicyResponse { - - /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ - automotivePartsCompatibilityPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - export interface Exclusion { - - /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ - brands?: Array; - } - - export interface ItemCondition { - - /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ - conditionDescription?: string | null; - - /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ - conditionId?: string | null; - } - - export interface ItemConditionPolicy { - - /** The category ID to which the item-condition policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ - itemConditionRequired?: boolean | null; - - /** The item-condition values allowed in the category. */ - itemConditions?: Array; - } - - export interface ItemConditionPolicyResponse { - - /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ - itemConditionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ListingStructurePolicy { - - /** The category ID to which the listing-structure policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ - variationsSupported?: boolean | null; - } - - export interface ListingStructurePolicyResponse { - - /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ - listingStructurePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface NegotiatedPricePolicy { - - /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ - bestOfferAutoAcceptEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ - bestOfferAutoDeclineEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ - bestOfferCounterEnabled?: boolean | null; - - /** The category ID to which the negotiated-price policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - } - - export interface NegotiatedPricePolicyResponse { - - /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ - negotiatedPricePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ - export interface ProductAdoptionPolicy { - - /** The category ID to which the listing policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - exclusion?: Exclusion; - - /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ - productRequired?: boolean | null; - } - - - /** This is the response object returned by a call to getProductAdoptionPolicies. */ - export interface ProductAdoptionPolicyResponse { - - /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ - productAdoptionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ReturnPolicy { - - /** The category ID to which the return policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - domestic?: ReturnPolicyDetails; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - international?: ReturnPolicyDetails; - - /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ - required?: boolean | null; - } - - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - export interface ReturnPolicyDetails { - - /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ - policyDescriptionEnabled?: boolean | null; - - /** A list of refund methods allowed for the associated category. */ - refundMethods?: Array; - - /** A list of return methods allowed for the associated category. */ - returnMethods?: Array; - - /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ - returnPeriods?: Array; - - /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ - returnsAcceptanceEnabled?: boolean | null; - - /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ - returnShippingCostPayers?: Array; - } - - export interface ReturnPolicyResponse { - - /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ - returnPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export class CountryClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. - * Get country/{countryCode}/sales_tax_jurisdiction - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. - * @return {SalesTaxJurisdictions} Success - */ - GetSalesTaxJurisdictions(countryCode: string): Promise { - return fetch(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - - export class MarketplaceClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT - * @return {AutomotivePartsCompatibilityPolicyResponse} Success - */ - GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_item_condition_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ItemConditionPolicyResponse} Success - */ - GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_listing_structure_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ListingStructurePolicyResponse} Success - */ - GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_negotiated_price_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {NegotiatedPricePolicyResponse} Success - */ - GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_product_adoption_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ProductAdoptionPolicyResponse} Success - */ - GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_return_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Promise { - return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** A unique ID for a sales tax jurisdiction. */ + export interface SalesTaxJurisdiction { + + /** The unique ID for a sales tax jurisdiction. */ + salesTaxJurisdictionId?: string | null; + } + + + /** This complex type contains a list of sales tax jurisdictions. */ + export interface SalesTaxJurisdictions { + + /** A list of sales tax jurisdictions. */ + salesTaxJurisdictions?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An amount of time, as measured by the time-measurement units specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for a error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + export interface AutomotivePartsCompatibilityPolicy { + + /** The category ID to which the automotive-parts-compatibility policies apply. */ + categoryId?: string | null; + + /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ + compatibilityBasedOn?: string | null; + + /** Indicates the compatibility classification of the part based on high-level vehicle types. */ + compatibleVehicleTypes?: Array; + + /** + * Specifies the maximum number of compatible vehicle-applications allowed per item. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfCompatibleVehicles?: number | null; + } + + export interface AutomotivePartsCompatibilityPolicyResponse { + + /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ + automotivePartsCompatibilityPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + export interface Exclusion { + + /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ + brands?: Array; + } + + export interface ItemCondition { + + /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ + conditionDescription?: string | null; + + /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ + conditionId?: string | null; + } + + export interface ItemConditionPolicy { + + /** The category ID to which the item-condition policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ + itemConditionRequired?: boolean | null; + + /** The item-condition values allowed in the category. */ + itemConditions?: Array; + } + + export interface ItemConditionPolicyResponse { + + /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ + itemConditionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ListingStructurePolicy { + + /** The category ID to which the listing-structure policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ + variationsSupported?: boolean | null; + } + + export interface ListingStructurePolicyResponse { + + /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ + listingStructurePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface NegotiatedPricePolicy { + + /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ + bestOfferAutoAcceptEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ + bestOfferAutoDeclineEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ + bestOfferCounterEnabled?: boolean | null; + + /** The category ID to which the negotiated-price policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + } + + export interface NegotiatedPricePolicyResponse { + + /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ + negotiatedPricePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ + export interface ProductAdoptionPolicy { + + /** The category ID to which the listing policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + exclusion?: Exclusion; + + /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ + productRequired?: boolean | null; + } + + + /** This is the response object returned by a call to getProductAdoptionPolicies. */ + export interface ProductAdoptionPolicyResponse { + + /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ + productAdoptionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ReturnPolicy { + + /** The category ID to which the return policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + domestic?: ReturnPolicyDetails; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + international?: ReturnPolicyDetails; + + /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ + required?: boolean | null; + } + + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + export interface ReturnPolicyDetails { + + /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ + policyDescriptionEnabled?: boolean | null; + + /** A list of refund methods allowed for the associated category. */ + refundMethods?: Array; + + /** A list of return methods allowed for the associated category. */ + returnMethods?: Array; + + /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ + returnPeriods?: Array; + + /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ + returnsAcceptanceEnabled?: boolean | null; + + /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ + returnShippingCostPayers?: Array; + } + + export interface ReturnPolicyResponse { + + /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ + returnPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export class CountryClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. + * Get country/{countryCode}/sales_tax_jurisdiction + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. + * @return {SalesTaxJurisdictions} Success + */ + GetSalesTaxJurisdictions(countryCode: string): Promise { + return fetch(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + + export class MarketplaceClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT + * @return {AutomotivePartsCompatibilityPolicyResponse} Success + */ + GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_item_condition_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ItemConditionPolicyResponse} Success + */ + GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_listing_structure_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ListingStructurePolicyResponse} Success + */ + GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_negotiated_price_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {NegotiatedPricePolicyResponse} Success + */ + GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_product_adoption_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ProductAdoptionPolicyResponse} Success + */ + GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_return_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Promise { + return fetch(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_negotiation.txt b/Tests/SwagTsTests/FetchResults/sell_negotiation.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/sell_negotiation.txt rename to Tests/SwagTsTests/FetchResults/sell_negotiation.ts index e31ca75d..49dfcecd 100644 --- a/Tests/SwagTsTests/FetchResults/sell_negotiation.txt +++ b/Tests/SwagTsTests/FetchResults/sell_negotiation.ts @@ -1,235 +1,235 @@ -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ - export interface CreateOffersRequest { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ - allowCounterOffer?: boolean | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ - offeredItems?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A complex type that defines the offer being made to an "interested" buyer. */ - export interface OfferedItem { - - /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ - discountPercentage?: string | null; - - /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ - listingId?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - price?: Amount; - - /** - * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ - export interface EligibleItem { - - /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ - listingId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** A complex type that defines an offer that a seller makes to eligible buyers. */ - export interface Offer { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ - allowCounterOffer?: boolean | null; - - /** This complex type identifies an eBay user. */ - buyer?: User; - - /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - creationDate?: string | null; - - /** The eBay UserName of the user (seller) who initiated the offer. */ - initiatedBy?: string | null; - - /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ - lastModifiedDate?: string | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ - offeredItems?: Array; - - /** A unique eBay-assigned identifier for the offer. */ - offerId?: string | null; - - /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ - offerStatus?: string | null; - - /** The type of offer being made. For implementation help, refer to eBay API documentation */ - offerType?: string | null; - - /** A unique, eBay-assigned ID for the revision of the offer. */ - revision?: string | null; - } - - - /** This complex type identifies an eBay user. */ - export interface User { - - /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ - maskedUsername?: string | null; - } - - - /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ - export interface PagedEligibleItemCollection { - - /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ - eligibleItems?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object returned from a SendOfferToInterestedBuyers request. */ - export interface SendOfferToInterestedBuyersCollectionResponse { - - /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ - offers?: Array; - } - - export class OfferClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Get find_eligible_items - * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 - * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {PagedEligibleItemCollection} Success - */ - FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Promise { - return fetch(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - - /** - * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Post send_offer_to_interested_buyers - * @param {CreateOffersRequest} requestBody Send offer to eligible items request. - * @return {SendOfferToInterestedBuyersCollectionResponse} Success - */ - SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Promise { - return fetch(this.baseUri + 'send_offer_to_interested_buyers', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); - } - } - -} - +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ + export interface CreateOffersRequest { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ + allowCounterOffer?: boolean | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ + offeredItems?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A complex type that defines the offer being made to an "interested" buyer. */ + export interface OfferedItem { + + /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ + discountPercentage?: string | null; + + /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ + listingId?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + price?: Amount; + + /** + * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ + export interface EligibleItem { + + /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ + listingId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** A complex type that defines an offer that a seller makes to eligible buyers. */ + export interface Offer { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ + allowCounterOffer?: boolean | null; + + /** This complex type identifies an eBay user. */ + buyer?: User; + + /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + creationDate?: string | null; + + /** The eBay UserName of the user (seller) who initiated the offer. */ + initiatedBy?: string | null; + + /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ + lastModifiedDate?: string | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ + offeredItems?: Array; + + /** A unique eBay-assigned identifier for the offer. */ + offerId?: string | null; + + /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ + offerStatus?: string | null; + + /** The type of offer being made. For implementation help, refer to eBay API documentation */ + offerType?: string | null; + + /** A unique, eBay-assigned ID for the revision of the offer. */ + revision?: string | null; + } + + + /** This complex type identifies an eBay user. */ + export interface User { + + /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ + maskedUsername?: string | null; + } + + + /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ + export interface PagedEligibleItemCollection { + + /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ + eligibleItems?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object returned from a SendOfferToInterestedBuyers request. */ + export interface SendOfferToInterestedBuyersCollectionResponse { + + /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ + offers?: Array; + } + + export class OfferClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Get find_eligible_items + * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 + * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {PagedEligibleItemCollection} Success + */ + FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Promise { + return fetch(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'get' }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + + /** + * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Post send_offer_to_interested_buyers + * @param {CreateOffersRequest} requestBody Send offer to eligible items request. + * @return {SendOfferToInterestedBuyersCollectionResponse} Success + */ + SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Promise { + return fetch(this.baseUri + 'send_offer_to_interested_buyers', { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }).then(d => {if (d.status<=202) return d.json(); else if (d.status==204) return null; throw d;}); + } + } + +} + diff --git a/Tests/SwagTsTests/FetchResults/sell_recommendation.txt b/Tests/SwagTsTests/FetchResults/sell_recommendation.ts similarity index 98% rename from Tests/SwagTsTests/FetchResults/sell_recommendation.txt rename to Tests/SwagTsTests/FetchResults/sell_recommendation.ts index 5d9f0891..6728e580 100644 --- a/Tests/SwagTsTests/FetchResults/sell_recommendation.txt +++ b/Tests/SwagTsTests/FetchResults/sell_recommendation.ts @@ -1,159 +1,159 @@ -export namespace MyNS { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - export interface Ad { - - /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ - bidPercentages?: Array; - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - promoteWithAd?: PromoteWithAd; - } - - - /** A complex type that returns data related to Promoted Listings bid percentages. */ - export interface BidPercentages { - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - basis?: Basis; - - /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ - value?: string | null; - } - - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - export enum Basis { TRENDING = 0 } - - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ - export interface FindListingRecommendationRequest { - - /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ - listingIds?: Array; - } - - - /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ - export interface ListingRecommendation { - - /** An ID that identifies the active listing associated with the eBay recommendations. */ - listingId?: string | null; - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - marketing?: MarketingRecommendation; - } - - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - export interface MarketingRecommendation { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - ad?: Ad; - - /** A message that can conditionally accompany the listing information. */ - message?: string | null; - } - - - /** The high-level object used to return a set of Promoted Listings ad recommendations. */ - export interface PagedListingRecommendationCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ - listingRecommendations?: Array; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - export class Listing_recommendationClient { - constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { - } - - /** - * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. - * Post find - * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} - * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {void} Success - */ - FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Promise { - return fetch(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); - } - } - -} - +export namespace MyNS { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + export interface Ad { + + /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ + bidPercentages?: Array; + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + promoteWithAd?: PromoteWithAd; + } + + + /** A complex type that returns data related to Promoted Listings bid percentages. */ + export interface BidPercentages { + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + basis?: Basis; + + /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ + value?: string | null; + } + + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + export enum Basis { TRENDING = 0 } + + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ + export interface FindListingRecommendationRequest { + + /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ + listingIds?: Array; + } + + + /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ + export interface ListingRecommendation { + + /** An ID that identifies the active listing associated with the eBay recommendations. */ + listingId?: string | null; + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + marketing?: MarketingRecommendation; + } + + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + export interface MarketingRecommendation { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + ad?: Ad; + + /** A message that can conditionally accompany the listing information. */ + message?: string | null; + } + + + /** The high-level object used to return a set of Promoted Listings ad recommendations. */ + export interface PagedListingRecommendationCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ + listingRecommendations?: Array; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + export class Listing_recommendationClient { + constructor(private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/') { + } + + /** + * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. + * Post find + * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} + * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {void} Success + */ + FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Promise { + return fetch(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), { method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' }, body: JSON.stringify(requestBody) }); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/Pet.txt b/Tests/SwagTsTests/JqResults/Pet.ts similarity index 96% rename from Tests/SwagTsTests/JqResults/Pet.txt rename to Tests/SwagTsTests/JqResults/Pet.ts index ef075fed..41b1ef5b 100644 --- a/Tests/SwagTsTests/JqResults/Pet.txt +++ b/Tests/SwagTsTests/JqResults/Pet.ts @@ -1,398 +1,398 @@ -/// -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(callback: (data : void) => any, requestBody: Pet) { - this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(callback: (data : void) => any, requestBody: Pet) { - this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string, callback: (data : Pet) => any) { - this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); - } - } - - export class StoreClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(callback: (data : {[id: string]: number }) => any) { - this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(callback: (data : Order) => any, requestBody: Order) { - this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string, callback: (data : Order) => any) { - this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); - } - } - - export class UserClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(callback: (data : void) => any, requestBody: User) { - this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string, callback: (data : User) => any) { - this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, callback: (data : void) => any, requestBody: User) { - this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(callback: (data : void) => any, requestBody: Array) { - this.httpClient.post(this.baseUri + 'user/createWithArray', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(callback: (data : void) => any, requestBody: Array) { - this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string, callback: (data : string) => any) { - this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(callback: (data : void) => any, requestBody: Pet) { + this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(callback: (data : void) => any, requestBody: Pet) { + this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string, callback: (data : Pet) => any) { + this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); + } + } + + export class StoreClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(callback: (data : {[id: string]: number }) => any) { + this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(callback: (data : Order) => any, requestBody: Order) { + this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string, callback: (data : Order) => any) { + this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); + } + } + + export class UserClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(callback: (data : void) => any, requestBody: User) { + this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string, callback: (data : User) => any) { + this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, callback: (data : void) => any, requestBody: User) { + this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(callback: (data : void) => any, requestBody: Array) { + this.httpClient.post(this.baseUri + 'user/createWithArray', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(callback: (data : void) => any, requestBody: Array) { + this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string, callback: (data : string) => any) { + this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/PetDelete.txt b/Tests/SwagTsTests/JqResults/PetDelete.ts similarity index 97% rename from Tests/SwagTsTests/JqResults/PetDelete.txt rename to Tests/SwagTsTests/JqResults/PetDelete.ts index 857973d2..d9aa9db9 100644 --- a/Tests/SwagTsTests/JqResults/PetDelete.txt +++ b/Tests/SwagTsTests/JqResults/PetDelete.ts @@ -1,20 +1,20 @@ -/// -export namespace MyNS { - export class PetClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + export class PetClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/PetFindByStatus.txt b/Tests/SwagTsTests/JqResults/PetFindByStatus.ts similarity index 96% rename from Tests/SwagTsTests/JqResults/PetFindByStatus.txt rename to Tests/SwagTsTests/JqResults/PetFindByStatus.ts index 6b220a67..b8580754 100644 --- a/Tests/SwagTsTests/JqResults/PetFindByStatus.txt +++ b/Tests/SwagTsTests/JqResults/PetFindByStatus.ts @@ -1,122 +1,122 @@ -/// -export namespace MyNS { - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export class Misc { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus2 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus2(status: PetStatus, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus2?status=' + status, callback, this.error, this.statusCode); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus3 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus3(status: PetStatus, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus3?status=' + status, callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export class Misc { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus2 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus2(status: PetStatus, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus2?status=' + status, callback, this.error, this.statusCode); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus3 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus3(status: PetStatus, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus3?status=' + status, callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/PetGodClass.txt b/Tests/SwagTsTests/JqResults/PetGodClass.ts similarity index 96% rename from Tests/SwagTsTests/JqResults/PetGodClass.txt rename to Tests/SwagTsTests/JqResults/PetGodClass.ts index fdf06fbc..2d3ac7d5 100644 --- a/Tests/SwagTsTests/JqResults/PetGodClass.txt +++ b/Tests/SwagTsTests/JqResults/PetGodClass.ts @@ -1,335 +1,335 @@ -/// -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - export class Misc { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPost(callback: (data : void) => any, requestBody: Pet) { - this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPut(callback: (data : void) => any, requestBody: Pet) { - this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - Pet_petIdGet(petId: string, callback: (data : Pet) => any) { - this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - Pet_petIdDelete(petId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - PetFindByStatusGetByStatus(status: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - PetFindByTagsGetByTags(tags: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - StoreInventoryGet(callback: (data : {[id: string]: number }) => any) { - this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - StoreOrderPost(callback: (data : Order) => any, requestBody: Order) { - this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - StoreOrder_orderIdGet(orderId: string, callback: (data : Order) => any) { - this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - StoreOrder_orderIdDelete(orderId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - UserPost(callback: (data : void) => any, requestBody: User) { - this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - User_usernameGet(username: string, callback: (data : User) => any) { - this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - User_usernamePut(username: string, callback: (data : void) => any, requestBody: User) { - this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - User_usernameDelete(username: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithArrayPost(callback: (data : void) => any, requestBody: Array) { - this.httpClient.post(this.baseUri + 'user/createWithArray', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithListPost(callback: (data : void) => any, requestBody: Array) { - this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - UserLoginGetByUsernameAndPassword(username: string, password: string, callback: (data : string) => any) { - this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - UserLogoutGet(callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + export class Misc { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPost(callback: (data : void) => any, requestBody: Pet) { + this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPut(callback: (data : void) => any, requestBody: Pet) { + this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + Pet_petIdGet(petId: string, callback: (data : Pet) => any) { + this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + Pet_petIdDelete(petId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + PetFindByStatusGetByStatus(status: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + PetFindByTagsGetByTags(tags: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + StoreInventoryGet(callback: (data : {[id: string]: number }) => any) { + this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + StoreOrderPost(callback: (data : Order) => any, requestBody: Order) { + this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + StoreOrder_orderIdGet(orderId: string, callback: (data : Order) => any) { + this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + StoreOrder_orderIdDelete(orderId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + UserPost(callback: (data : void) => any, requestBody: User) { + this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + User_usernameGet(username: string, callback: (data : User) => any) { + this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + User_usernamePut(username: string, callback: (data : void) => any, requestBody: User) { + this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + User_usernameDelete(username: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithArrayPost(callback: (data : void) => any, requestBody: Array) { + this.httpClient.post(this.baseUri + 'user/createWithArray', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithListPost(callback: (data : void) => any, requestBody: Array) { + this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + UserLoginGetByUsernameAndPassword(username: string, password: string, callback: (data : string) => any) { + this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + UserLogoutGet(callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/PetPathAsContainer.txt b/Tests/SwagTsTests/JqResults/PetPathAsContainer.ts similarity index 97% rename from Tests/SwagTsTests/JqResults/PetPathAsContainer.txt rename to Tests/SwagTsTests/JqResults/PetPathAsContainer.ts index 5c118ceb..00dca537 100644 --- a/Tests/SwagTsTests/JqResults/PetPathAsContainer.txt +++ b/Tests/SwagTsTests/JqResults/PetPathAsContainer.ts @@ -1,400 +1,400 @@ -/// -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Post(callback: (data : void) => any, requestBody: Pet) { - this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Put(callback: (data : void) => any, requestBody: Pet) { - this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Pet_petIdClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - GetByPetId(petId: string, callback: (data : Pet) => any) { - this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - DeleteByPetId(petId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - } - - export class Pet_petIdUploadImageClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - } - - export class PetFindByStatusClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - GetByStatus(status: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); - } - } - - export class PetFindByTagsClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - GetByTags(tags: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); - } - } - - export class StoreInventoryClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - Get(callback: (data : {[id: string]: number }) => any) { - this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); - } - } - - export class StoreOrderClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - Post(callback: (data : Order) => any, requestBody: Order) { - this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class StoreOrder_orderIdClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - GetByOrderId(orderId: string, callback: (data : Order) => any) { - this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - DeleteByOrderId(orderId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); - } - } - - export class UserClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - Post(callback: (data : void) => any, requestBody: User) { - this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class User_usernameClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetByUsername(username: string, callback: (data : User) => any) { - this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - PutByUsername(username: string, callback: (data : void) => any, requestBody: User) { - this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteByUsername(username: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - } - - export class UserCreateWithArrayClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(callback: (data : void) => any, requestBody: Array) { - this.httpClient.post(this.baseUri + 'user/createWithArray', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class UserCreateWithListClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(callback: (data : void) => any, requestBody: Array) { - this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class UserLoginClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - GetByUsernameAndPassword(username: string, password: string, callback: (data : string) => any) { - this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); - } - } - - export class UserLogoutClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - Get(callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Post(callback: (data : void) => any, requestBody: Pet) { + this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Put(callback: (data : void) => any, requestBody: Pet) { + this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Pet_petIdClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + GetByPetId(petId: string, callback: (data : Pet) => any) { + this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + DeleteByPetId(petId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + } + + export class Pet_petIdUploadImageClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + } + + export class PetFindByStatusClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + GetByStatus(status: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); + } + } + + export class PetFindByTagsClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + GetByTags(tags: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); + } + } + + export class StoreInventoryClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + Get(callback: (data : {[id: string]: number }) => any) { + this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); + } + } + + export class StoreOrderClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + Post(callback: (data : Order) => any, requestBody: Order) { + this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class StoreOrder_orderIdClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + GetByOrderId(orderId: string, callback: (data : Order) => any) { + this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + DeleteByOrderId(orderId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); + } + } + + export class UserClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + Post(callback: (data : void) => any, requestBody: User) { + this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class User_usernameClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetByUsername(username: string, callback: (data : User) => any) { + this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + PutByUsername(username: string, callback: (data : void) => any, requestBody: User) { + this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteByUsername(username: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + } + + export class UserCreateWithArrayClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(callback: (data : void) => any, requestBody: Array) { + this.httpClient.post(this.baseUri + 'user/createWithArray', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class UserCreateWithListClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(callback: (data : void) => any, requestBody: Array) { + this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class UserLoginClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + GetByUsernameAndPassword(username: string, password: string, callback: (data : string) => any) { + this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); + } + } + + export class UserLogoutClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + Get(callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/PetStore.txt b/Tests/SwagTsTests/JqResults/PetStore.ts similarity index 97% rename from Tests/SwagTsTests/JqResults/PetStore.txt rename to Tests/SwagTsTests/JqResults/PetStore.ts index 0de6b8d7..3737a556 100644 --- a/Tests/SwagTsTests/JqResults/PetStore.txt +++ b/Tests/SwagTsTests/JqResults/PetStore.ts @@ -1,311 +1,311 @@ -/// -export namespace MyNS { - export interface Order { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity?: number | null; - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - complete?: boolean | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Customer { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - address?: Array
; - } - - export interface Address { - street?: string | null; - city?: string | null; - state?: string | null; - zip?: string | null; - } - - export interface Category { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - firstName?: string | null; - lastName?: string | null; - email?: string | null; - password?: string | null; - phone?: string | null; - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export interface Tag { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface Pet { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Required */ - name: string; - category?: Category; - - /** Required */ - photoUrls: Array; - tags?: Array; - - /** pet status in the store */ - status?: PetStatus | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - export class PetClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Update an existing pet - * Update an existing pet by Id - * Put pet - * @param {Pet} requestBody Update an existent pet in the store - * @return {Pet} Successful operation - */ - UpdatePet(callback: (data : Pet) => any, requestBody: Pet) { - this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Add a new pet to the store - * Add a new pet to the store - * Post pet - * @param {Pet} requestBody Create a new pet in the store - * @return {Pet} Successful operation - */ - AddPet(callback: (data : Pet) => any, requestBody: Pet) { - this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: PetStatus | null | undefined, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus?status=' + status, callback, this.error, this.statusCode); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array | null | undefined, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string, callback: (data : Pet) => any) { - this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Updates a pet in the store with form data - * Post pet/{petId} - * @param {string} petId ID of pet that needs to be updated - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @param {string} name Name of pet that needs to be updated - * @param {string} status Status of pet that needs to be updated - * @return {void} - */ - UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined, callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Deletes a pet - * delete a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - } - - export class StoreClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(callback: (data : {[id: string]: number }) => any) { - this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); - } - - /** - * Place an order for a pet - * Place a new order in the store - * Post store/order - * @return {Order} successful operation - */ - PlaceOrder(callback: (data : Order) => any, requestBody: Order) { - this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - * Get store/order/{orderId} - * @param {string} orderId ID of order that needs to be fetched - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Order} successful operation - */ - GetOrderById(orderId: string, callback: (data : Order) => any) { - this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeleteOrder(orderId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); - } - } - - export class UserClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(callback: (data : void) => any, requestBody: User) { - this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Creates list of users with given input array - * Creates list of users with given input array - * Post user/createWithList - * @return {User} Successful operation - */ - CreateUsersWithListInput(callback: (data : User) => any, requestBody: Array) { - this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string | null | undefined, password: string | null | undefined, callback: (data : string) => any) { - this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string, callback: (data : User) => any) { - this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Update user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Update an existent user in the store - * @return {void} - */ - UpdateUser(username: string, callback: (data : void) => any, requestBody: User) { - this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + export interface Order { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity?: number | null; + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + complete?: boolean | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Customer { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + address?: Array
; + } + + export interface Address { + street?: string | null; + city?: string | null; + state?: string | null; + zip?: string | null; + } + + export interface Category { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + firstName?: string | null; + lastName?: string | null; + email?: string | null; + password?: string | null; + phone?: string | null; + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export interface Tag { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface Pet { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Required */ + name: string; + category?: Category; + + /** Required */ + photoUrls: Array; + tags?: Array; + + /** pet status in the store */ + status?: PetStatus | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + export class PetClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Update an existing pet + * Update an existing pet by Id + * Put pet + * @param {Pet} requestBody Update an existent pet in the store + * @return {Pet} Successful operation + */ + UpdatePet(callback: (data : Pet) => any, requestBody: Pet) { + this.httpClient.put(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Add a new pet to the store + * Add a new pet to the store + * Post pet + * @param {Pet} requestBody Create a new pet in the store + * @return {Pet} Successful operation + */ + AddPet(callback: (data : Pet) => any, requestBody: Pet) { + this.httpClient.post(this.baseUri + 'pet', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: PetStatus | null | undefined, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus?status=' + status, callback, this.error, this.statusCode); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array | null | undefined, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string, callback: (data : Pet) => any) { + this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Updates a pet in the store with form data + * Post pet/{petId} + * @param {string} petId ID of pet that needs to be updated + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} name Name of pet that needs to be updated + * @param {string} status Status of pet that needs to be updated + * @return {void} + */ + UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined, callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Deletes a pet + * delete a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + } + + export class StoreClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(callback: (data : {[id: string]: number }) => any) { + this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); + } + + /** + * Place an order for a pet + * Place a new order in the store + * Post store/order + * @return {Order} successful operation + */ + PlaceOrder(callback: (data : Order) => any, requestBody: Order) { + this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + * Get store/order/{orderId} + * @param {string} orderId ID of order that needs to be fetched + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Order} successful operation + */ + GetOrderById(orderId: string, callback: (data : Order) => any) { + this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeleteOrder(orderId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); + } + } + + export class UserClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(callback: (data : void) => any, requestBody: User) { + this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Creates list of users with given input array + * Creates list of users with given input array + * Post user/createWithList + * @return {User} Successful operation + */ + CreateUsersWithListInput(callback: (data : User) => any, requestBody: Array) { + this.httpClient.post(this.baseUri + 'user/createWithList', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string | null | undefined, password: string | null | undefined, callback: (data : string) => any) { + this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string, callback: (data : User) => any) { + this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Update user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Update an existent user in the store + * @return {void} + */ + UpdateUser(username: string, callback: (data : void) => any, requestBody: User) { + this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/PetStoreExpanded.txt b/Tests/SwagTsTests/JqResults/PetStoreExpanded.ts similarity index 98% rename from Tests/SwagTsTests/JqResults/PetStoreExpanded.txt rename to Tests/SwagTsTests/JqResults/PetStoreExpanded.ts index 9b34f487..3b3d92df 100644 --- a/Tests/SwagTsTests/JqResults/PetStoreExpanded.txt +++ b/Tests/SwagTsTests/JqResults/PetStoreExpanded.ts @@ -1,66 +1,66 @@ -/// -export namespace MyNS { - export interface Pet extends NewPet { - id: string; - } - - export interface NewPet { - name: string; - tag?: string | null; - } - - export interface Error { - code: number; - message: string; - } - - export class Misc { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Returns all pets from the system that the user has access to - * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - * Get pets - * @param {Array} tags tags to filter by - * @param {number} limit maximum number of results to return - * @return {Array} pet response - */ - FindPets(tags: Array | null | undefined, limit: number | null | undefined, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, callback, this.error, this.statusCode); - } - - /** - * Creates a new pet in the store. Duplicates are allowed - * Post pets - * @param {NewPet} requestBody Pet to add to the store - * @return {Pet} pet response - */ - AddPet(callback: (data : Pet) => any, requestBody: NewPet) { - this.httpClient.post(this.baseUri + 'pets', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Returns a user based on a single ID, if the user does not have access to the pet - * Get pets/{id} - * @param {string} id ID of pet to fetch - * @return {Pet} pet response - */ - FindPetById(id: string, callback: (data : Pet) => any) { - this.httpClient.get(this.baseUri + 'pets/' + id, callback, this.error, this.statusCode); - } - - /** - * deletes a single pet based on the ID supplied - * Delete pets/{id} - * @param {string} id ID of pet to delete - * @return {void} - */ - DeletePet(id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'pets/' + id, callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + export interface Pet extends NewPet { + id: string; + } + + export interface NewPet { + name: string; + tag?: string | null; + } + + export interface Error { + code: number; + message: string; + } + + export class Misc { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Returns all pets from the system that the user has access to + * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. + * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. + * Get pets + * @param {Array} tags tags to filter by + * @param {number} limit maximum number of results to return + * @return {Array} pet response + */ + FindPets(tags: Array | null | undefined, limit: number | null | undefined, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, callback, this.error, this.statusCode); + } + + /** + * Creates a new pet in the store. Duplicates are allowed + * Post pets + * @param {NewPet} requestBody Pet to add to the store + * @return {Pet} pet response + */ + AddPet(callback: (data : Pet) => any, requestBody: NewPet) { + this.httpClient.post(this.baseUri + 'pets', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Returns a user based on a single ID, if the user does not have access to the pet + * Get pets/{id} + * @param {string} id ID of pet to fetch + * @return {Pet} pet response + */ + FindPetById(id: string, callback: (data : Pet) => any) { + this.httpClient.get(this.baseUri + 'pets/' + id, callback, this.error, this.statusCode); + } + + /** + * deletes a single pet based on the ID supplied + * Delete pets/{id} + * @param {string} id ID of pet to delete + * @return {void} + */ + DeletePet(id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'pets/' + id, callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/Uspto.txt b/Tests/SwagTsTests/JqResults/Uspto.ts similarity index 97% rename from Tests/SwagTsTests/JqResults/Uspto.txt rename to Tests/SwagTsTests/JqResults/Uspto.ts index 61d5c919..c64c7b3d 100644 --- a/Tests/SwagTsTests/JqResults/Uspto.txt +++ b/Tests/SwagTsTests/JqResults/Uspto.ts @@ -1,55 +1,55 @@ -/// -export namespace MyNS { - export interface DataSetList { - total?: number | null; - DataSetListApis?: Array; - } - - export interface DataSetListApis { - - /** To be used as a dataset parameter value */ - apiKey?: string | null; - - /** To be used as a version parameter value */ - apiVersionNumber?: string | null; - - /** The URL describing the dataset's fields */ - apiUrl?: string | null; - - /** A URL to the API console for each API */ - apiDocumentationUrl?: string | null; - } - - export class MetadataClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * List available data sets - * Get - * @return {DataSetList} Returns a list of data sets - */ - ListDataSets(callback: (data : DataSetList) => any) { - this.httpClient.get(this.baseUri + '', callback, this.error, this.statusCode); - } - - /** - * Provides the general information about the API and the list of fields that can be used to query the dataset. - * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. - * Get {dataset}/{version}/fields - * @param {string} dataset Name of the dataset. - * @param {string} version Version of the dataset. - * @return {string} The dataset API for the given version is found and it is accessible to consume. - */ - ListSearchableFields(dataset: string, version: string, callback: (data : string) => any) { - this.httpClient.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', callback, this.error, this.statusCode); - } - } - - export class SearchClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - } - -} - +/// +export namespace MyNS { + export interface DataSetList { + total?: number | null; + DataSetListApis?: Array; + } + + export interface DataSetListApis { + + /** To be used as a dataset parameter value */ + apiKey?: string | null; + + /** To be used as a version parameter value */ + apiVersionNumber?: string | null; + + /** The URL describing the dataset's fields */ + apiUrl?: string | null; + + /** A URL to the API console for each API */ + apiDocumentationUrl?: string | null; + } + + export class MetadataClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * List available data sets + * Get + * @return {DataSetList} Returns a list of data sets + */ + ListDataSets(callback: (data : DataSetList) => any) { + this.httpClient.get(this.baseUri + '', callback, this.error, this.statusCode); + } + + /** + * Provides the general information about the API and the list of fields that can be used to query the dataset. + * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. + * Get {dataset}/{version}/fields + * @param {string} dataset Name of the dataset. + * @param {string} version Version of the dataset. + * @return {string} The dataset API for the given version is found and it is accessible to consume. + */ + ListSearchableFields(dataset: string, version: string, callback: (data : string) => any) { + this.httpClient.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', callback, this.error, this.statusCode); + } + } + + export class SearchClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/ValuesPaths.txt b/Tests/SwagTsTests/JqResults/ValuesPaths.ts similarity index 97% rename from Tests/SwagTsTests/JqResults/ValuesPaths.txt rename to Tests/SwagTsTests/JqResults/ValuesPaths.ts index 9c936a61..7b4dcc6e 100644 --- a/Tests/SwagTsTests/JqResults/ValuesPaths.txt +++ b/Tests/SwagTsTests/JqResults/ValuesPaths.ts @@ -1,52 +1,52 @@ -/// -export namespace MyNS { - export class ValuesClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Get api/Values - * @return {Array} Success - */ - ValuesGet(callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'api/Values', callback, this.error, this.statusCode); - } - - /** - * Post api/Values - * @return {string} Success - */ - ValuesPost(callback: (data : string) => any, requestBody: string) { - this.httpClient.post(this.baseUri + 'api/Values', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Get api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {string} Success - */ - ValuesGetById(id: number, callback: (data : string) => any) { - this.httpClient.get(this.baseUri + 'api/Values/' + id, callback, this.error, this.statusCode); - } - - /** - * Put api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesPutById(id: number, callback: (data : void) => any, requestBody: string) { - this.httpClient.put(this.baseUri + 'api/Values/' + id, requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Delete api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesDeleteById(id: number, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'api/Values/' + id, callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + export class ValuesClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Get api/Values + * @return {Array} Success + */ + ValuesGet(callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'api/Values', callback, this.error, this.statusCode); + } + + /** + * Post api/Values + * @return {string} Success + */ + ValuesPost(callback: (data : string) => any, requestBody: string) { + this.httpClient.post(this.baseUri + 'api/Values', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Get api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {string} Success + */ + ValuesGetById(id: number, callback: (data : string) => any) { + this.httpClient.get(this.baseUri + 'api/Values/' + id, callback, this.error, this.statusCode); + } + + /** + * Put api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesPutById(id: number, callback: (data : void) => any, requestBody: string) { + this.httpClient.put(this.baseUri + 'api/Values/' + id, requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Delete api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesDeleteById(id: number, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'api/Values/' + id, callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/mcp.txt b/Tests/SwagTsTests/JqResults/mcp.ts similarity index 97% rename from Tests/SwagTsTests/JqResults/mcp.txt rename to Tests/SwagTsTests/JqResults/mcp.ts index f1886188..c7b495b2 100644 --- a/Tests/SwagTsTests/JqResults/mcp.txt +++ b/Tests/SwagTsTests/JqResults/mcp.ts @@ -1,886 +1,886 @@ -/// -export namespace MyNS { - export interface BBSReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface ProviderType { - providerNumber: string; - } - - export interface BBSPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface PaymentRunType { - payerName?: string | null; - runDate?: Date | null; - runNumber?: string | null; - } - - export interface PaymentType { - accountInfo: BankAccountType; - depositAmount?: string | null; - paymentReference?: string | null; - } - - export interface BankAccountType { - accountName?: string | null; - accountNumber?: string | null; - bsbCode?: string | null; - } - - export interface ClaimSummaryType { - accountReferenceId?: string | null; - benefit?: string | null; - chargeAmount?: string | null; - claimChannelCode?: string | null; - claimId?: string | null; - lodgementDate?: Date | null; - transactionId?: string | null; - } - - export interface ServiceMessagesType { - highestSeverity: ServiceMessagesTypeHighestSeverity; - serviceMessage: Array; - } - - export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } - - export interface ServiceMessageType { - code: string; - severity: ServiceMessagesTypeHighestSeverity; - reason: string; - } - - export interface BBSProcessingReportResponseType { - claimAssessment?: ClaimAssessmentType; - status: string; - } - - export interface ClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface MedicalEventResponseType { - patient?: MembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface MembershipStatusType { - status?: StatusType; - currentMembership?: MembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface StatusType { - code?: number | null; - text?: string | null; - } - - export interface MembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - } - - export interface IdentityType { - dateOfBirth?: Date | null; - familyName?: string | null; - givenName?: string | null; - secondInitial?: string | null; - sex?: string | null; - } - - export interface ServiceResponseType { - error?: StatusType; - id?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface BulkBillStoreForwardRequestType { - claim: BulkBillClaimStoreForwardClaimType; - } - - export interface BulkBillClaimStoreForwardClaimType { - facilityId?: string | null; - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface BBSMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - medicalEventDate: Date; - medicalEventTime?: string | null; - patient: MedicarePatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface MedicarePatientType { - identity: IdentityType; - medicare: MembershipType; - } - - export interface ReferralType { - issueDate: Date; - period?: string | null; - periodCode?: string | null; - provider: ProviderType; - typeCode: string; - } - - export interface ServiceType { - id: string; - accessionDateTime?: Date | null; - aftercareOverrideInd?: string | null; - chargeAmount?: string | null; - collectionDateTime?: Date | null; - duplicateServiceOverrideInd?: string | null; - fieldQuantity?: string | null; - itemNumber?: string | null; - lspNumber?: string | null; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - restrictiveOverrideCode?: string | null; - rule3ExemptInd?: string | null; - s4b3ExemptInd?: string | null; - scpId?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - } - - export interface BulkBillStoreForwardResponseType { - claimId: string; - status: string; - } - - export interface AlliedHealthClaimRequestType { - claim: VAAClaimType; - } - - export interface VAAClaimType { - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface VAAMedicalEventType { - id: string; - acceptedDisability?: AcceptedDisabilityType; - authorisationDate: Date; - breakInEpisodeEndDate?: Date | null; - breakInEpisodeOfCareNumber?: string | null; - breakInEpisodeStartDate?: Date | null; - numberOfCNCHours?: string | null; - numberOfCNCVisits?: string | null; - createDateTime: Date; - numberOfENHours?: string | null; - numberOfENVisits?: string | null; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - numberOfNSSHours?: string | null; - numberOfNSSVisits?: string | null; - patient: VeteranPatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - numberOfRNHours?: string | null; - numberOfRNVisits?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface AcceptedDisabilityType { - code: string; - ind: string; - } - - export interface VAAServiceType { - id: string; - accountReferenceNumber?: string | null; - admissionDate?: Date | null; - chargeAmount?: string | null; - dischargeDate?: Date | null; - distanceKilometres?: number | null; - duplicateServiceOverrideInd?: string | null; - itemNumber: string; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - numberOfTeeth?: string | null; - opticalScriptCode?: string | null; - restrictiveOverrideCode?: string | null; - secondDeviceInd?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - toothNumber?: string | null; - upperLowerJawCode?: string | null; - } - - export interface VeteranPatientType extends PatientType { - veteranMembership?: VeteranMembershipType; - } - - export interface VeteranMembershipType { - veteranNumber: string; - } - - export interface PatientType { - identity: IdentityType; - residentialAddress?: AddressType; - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postcode?: string | null; - } - - export interface AlliedHealthClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAClaimRequestType { - claim: DVAClaimType; - } - - export interface DVAClaimType { - hospitalInd?: string | null; - serviceTypeCode: string; - medicalEvent: Array; - serviceProvider: ProviderType; - payeeProvider?: ProviderType; - } - - export interface DVAMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - referralOverrideCode?: string | null; - submissionAuthorityInd: string; - treatmentLocationCode?: string | null; - acceptedDisability?: AcceptedDisabilityType; - referral?: ReferralType; - patient: VeteranPatientType; - service: Array; - } - - export interface DVAServiceType extends ServiceType { - accountReferenceNumber?: string | null; - distanceKilometres?: number | null; - } - - export interface DVAClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface DVAPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface DVAProcessingReportResponseType { - claimAssessment?: DVAClaimAssessmentType; - status: string; - } - - export interface DVAClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface DVAMedicalEventAssessmentType { - patient?: VeteranMembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface VeteranMembershipStatusType { - currentMembership?: VeteranMembershipResponseType; - currentMember?: IdentityType; - status?: StatusType; - processDate?: Date | null; - } - - export interface DVAServiceAssessmentType { - id?: string | null; - accountReferenceNumber?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - gstInd?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface VeteranMembershipResponseType extends VeteranMembershipType { - entitlementCode?: string | null; - } - - export interface EnterpriseConcessionVerificationRequestType { - timeout?: number | null; - concessionVerificationRequest: Array; - } - - export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { - id: string; - } - - export interface ConcessionVerificationRequestType { - patient: MedicarePatientType; - dateOfService?: Date | null; - } - - export interface EnterpriseConcessionVerificationResponseType { - status: string; - concessionVerificationResponse?: Array; - } - - export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { - id: string; - } - - export interface ConcessionVerificationResponseType { - medicareStatus: MembershipStatusType; - concessionStatus: ConcessionStatusType; - } - - export interface ConcessionStatusType { - status?: StatusType; - processDate?: Date | null; - } - - export interface EnterprisePatientVerificationRequestType { - timeout?: number | null; - patientVerificationRequest: Array; - } - - export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { - id: string; - } - - export interface PatientVerificationRequestType { - patient: FundPatientType; - provider?: ProviderType; - dateOfService?: Date | null; - typeCode: string; - } - - export interface FundPatientType extends PatientType { - alsoKnownAs?: IdentityType; - medicare?: MembershipType; - healthFund?: FundMembershipType; - } - - export interface FundMembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - organisation?: string | null; - } - - export interface EnterprisePatientVerificationResponseType { - status: string; - patientVerificationResponse?: Array; - } - - export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { - id: string; - } - - export interface PatientVerificationResponseType { - medicareStatus?: MembershipStatusType; - healthFundStatus?: FundMembershipStatusType; - } - - export interface FundMembershipStatusType { - status?: StatusType; - currentMembership?: FundMembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface EnterpriseVeteranVerificationRequestType { - timeout?: number | null; - veteranVerificationRequest: Array; - } - - export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { - id: string; - } - - export interface VeteranVerificationRequestType { - patient: VeteranPatientType; - } - - export interface EnterpriseVeteranVerificationResponseType { - status: string; - veteranVerificationResponse?: Array; - } - - export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { - id?: string | null; - } - - export interface VeteranVerificationResponseType { - veteranStatus?: VeteranMembershipStatusType; - } - - export interface PatientClaimInteractiveRequestType { - patientClaimInteractive: PatientClaimInteractiveType; - } - - export interface PatientClaimInteractiveType { - patient: MedicarePatientType; - referral?: ReferralType; - claimant: ClaimantType; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - referralOverrideCode?: string | null; - accountPaidInd: string; - accountReferenceId?: string | null; - submissionAuthorityInd: string; - authorisationDate: Date; - } - - export interface PCIMedicalEventType { - service: Array; - id: string; - medicalEventDate: Date; - medicalEventTime?: string | null; - } - - export interface PCIServiceType extends ServiceType { - patientContribAmount?: string | null; - facilityId?: string | null; - hospitalInd?: string | null; - } - - export interface ClaimantType extends MedicarePatientType { - eftDetails?: BankAccountType; - residentialAddress?: AddressType; - contactDetails?: ContactType; - } - - export interface ContactType { - emailAddress?: string | null; - name?: string | null; - phoneNumber?: string | null; - } - - export interface PatientClaimInteractiveResponseType { - claimAssessment: PCIAssessmentType; - status: string; - } - - export interface PCIAssessmentType { - claimant?: CurrentMembershipType; - patient?: CurrentMembershipType; - medicalEvent?: Array; - error?: StatusType; - claimId: string; - } - - export interface CurrentMembershipType { - currentMembership: MembershipType; - } - - export interface PCIMedicalEventResponseType { - service?: Array; - eventDate?: Date | null; - id?: string | null; - } - - export interface RetrieveReportRequestType { - transactionId: Array; - } - - export interface RetrieveReportResponseType { - content?: Array; - } - - export interface ContentType { - transactionId?: string | null; - status?: string | null; - } - - export interface EnterpriseConcessionVerificationReportContentType extends ContentType { - report?: EnterpriseConcessionVerificationResponseType; - } - - export interface EnterprisePatientVerificationReportContentType extends ContentType { - report?: EnterprisePatientVerificationResponseType; - } - - export interface EnterpriseVeteranVerificationReportContentType extends ContentType { - report?: EnterpriseVeteranVerificationResponseType; - } - - export interface SameDayDeleteRequestType { - sameDayDelete: SameDayDeleteType; - } - - export interface SameDayDeleteType { - patient: MedicarePatientType; - reasonCode: string; - } - - export interface SameDayDeleteResponseType { - status: string; - } - - export interface StatusReportRequestType { - transactionId?: Array; - associateName?: string | null; - fromDateTime?: Date | null; - toDateTime?: Date | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - status?: string | null; - } - - export interface StatusReportResponseType { - transactionStatus?: Array; - status: string; - } - - export interface TransactionStatusType { - associateName?: string | null; - lodgementDateTime?: Date | null; - processStatus?: string | null; - reference?: string | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - transactionId?: string | null; - } - - export class McpClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This is the request - * Post mcp/bulkbillpaymentreport/v1 - * @return {BBSPaymentReportResponseType} successful operation - */ - McpBulkBillPaymentReport1Eigw(callback: (data : BBSPaymentReportResponseType) => any, requestBody: BBSReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/bulkbillprocessingreport/v1 - * @return {BBSProcessingReportResponseType} successful operation - */ - McpBulkBillProcessingReport1Eigw(callback: (data : BBSProcessingReportResponseType) => any, requestBody: BBSReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/general/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardGeneral1Eigw(callback: (data : BulkBillStoreForwardResponseType) => any, requestBody: BulkBillStoreForwardRequestType) { - this.httpClient.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/pathology/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardPathology1Eigw(callback: (data : BulkBillStoreForwardResponseType) => any, requestBody: BulkBillStoreForwardRequestType) { - this.httpClient.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/specialist/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardSpecialist1Eigw(callback: (data : BulkBillStoreForwardResponseType) => any, requestBody: BulkBillStoreForwardRequestType) { - this.httpClient.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/allied/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthAllied1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/communitynursing/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthCommunityNursing1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/dental/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthDental1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/optical/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthOptical1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/psych/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthPsych1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/speechpathology/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthSpeechPathology1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaclaim/general/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimGeneral1Eigw(callback: (data : DVAClaimResponseType) => any, requestBody: DVAClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaclaim/general/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaclaim/pathology/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimPathology1Eigw(callback: (data : DVAClaimResponseType) => any, requestBody: DVAClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaclaim/specialist/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimSpecialist1Eigw(callback: (data : DVAClaimResponseType) => any, requestBody: DVAClaimRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvapaymentreport/v1 - * @return {DVAPaymentReportResponseType} successful operation - */ - McpDvaPaymentReport1Eigw(callback: (data : DVAPaymentReportResponseType) => any, requestBody: DVAReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvapaymentreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/dvaprocessingreport/v1 - * @return {DVAProcessingReportResponseType} successful operation - */ - McpDvaProcessingReport1Eigw(callback: (data : DVAProcessingReportResponseType) => any, requestBody: DVAReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/dvaprocessingreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/v1 - * @return {EnterpriseConcessionVerificationResponseType} successful operation - */ - McpEnterpriseConcessionVerification1Eigw(callback: (data : EnterpriseConcessionVerificationResponseType) => any, requestBody: EnterpriseConcessionVerificationRequestType) { - this.httpClient.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/v1 - * @return {EnterprisePatientVerificationResponseType} successful operation - */ - McpEnterprisePatientVerification1Eigw(callback: (data : EnterprisePatientVerificationResponseType) => any, requestBody: EnterprisePatientVerificationRequestType) { - this.httpClient.post(this.baseUri + 'mcp/enterprisepatientverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/v1 - * @return {EnterpriseVeteranVerificationResponseType} successful operation - */ - McpEnterpriseVeteranVerification1Eigw(callback: (data : EnterpriseVeteranVerificationResponseType) => any, requestBody: EnterpriseVeteranVerificationRequestType) { - this.httpClient.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/general/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveGeneral1Eigw(callback: (data : PatientClaimInteractiveResponseType) => any, requestBody: PatientClaimInteractiveRequestType) { - this.httpClient.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/pathology/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractivePathology1Eigw(callback: (data : PatientClaimInteractiveResponseType) => any, requestBody: PatientClaimInteractiveRequestType) { - this.httpClient.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/specialist/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveSpecialist1Eigw(callback: (data : PatientClaimInteractiveResponseType) => any, requestBody: PatientClaimInteractiveRequestType) { - this.httpClient.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/patientverification/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerification1Eigw(callback: (data : PatientVerificationResponseType) => any, requestBody: PatientVerificationRequestType) { - this.httpClient.post(this.baseUri + 'mcp/patientverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/patientverification/hf/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationHf1Eigw(callback: (data : PatientVerificationResponseType) => any, requestBody: PatientVerificationRequestType) { - this.httpClient.post(this.baseUri + 'mcp/patientverification/hf/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/patientverification/medicare/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationMedicare1Eigw(callback: (data : PatientVerificationResponseType) => any, requestBody: PatientVerificationRequestType) { - this.httpClient.post(this.baseUri + 'mcp/patientverification/medicare/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEcv1Eigw(callback: (data : RetrieveReportResponseType) => any, requestBody: RetrieveReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEpv1Eigw(callback: (data : RetrieveReportResponseType) => any, requestBody: RetrieveReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEvv1Eigw(callback: (data : RetrieveReportResponseType) => any, requestBody: RetrieveReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/samedaydelete/v1 - * @return {SameDayDeleteResponseType} successful operation - */ - McpSameDayDelete1Eigw(callback: (data : SameDayDeleteResponseType) => any, requestBody: SameDayDeleteRequestType) { - this.httpClient.post(this.baseUri + 'mcp/samedaydelete/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/statusreport/v1 - * @return {StatusReportResponseType} successful operation - */ - McpStatusReport1Eigw(callback: (data : StatusReportResponseType) => any, requestBody: StatusReportRequestType) { - this.httpClient.post(this.baseUri + 'mcp/statusreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This is the request - * Post mcp/veteranverification/v1 - * @return {VeteranVerificationResponseType} successful operation - */ - McpVeteranVerification1Eigw(callback: (data : VeteranVerificationResponseType) => any, requestBody: VeteranVerificationRequestType) { - this.httpClient.post(this.baseUri + 'mcp/veteranverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - -} - +/// +export namespace MyNS { + export interface BBSReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface ProviderType { + providerNumber: string; + } + + export interface BBSPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface PaymentRunType { + payerName?: string | null; + runDate?: Date | null; + runNumber?: string | null; + } + + export interface PaymentType { + accountInfo: BankAccountType; + depositAmount?: string | null; + paymentReference?: string | null; + } + + export interface BankAccountType { + accountName?: string | null; + accountNumber?: string | null; + bsbCode?: string | null; + } + + export interface ClaimSummaryType { + accountReferenceId?: string | null; + benefit?: string | null; + chargeAmount?: string | null; + claimChannelCode?: string | null; + claimId?: string | null; + lodgementDate?: Date | null; + transactionId?: string | null; + } + + export interface ServiceMessagesType { + highestSeverity: ServiceMessagesTypeHighestSeverity; + serviceMessage: Array; + } + + export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } + + export interface ServiceMessageType { + code: string; + severity: ServiceMessagesTypeHighestSeverity; + reason: string; + } + + export interface BBSProcessingReportResponseType { + claimAssessment?: ClaimAssessmentType; + status: string; + } + + export interface ClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface MedicalEventResponseType { + patient?: MembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface MembershipStatusType { + status?: StatusType; + currentMembership?: MembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface StatusType { + code?: number | null; + text?: string | null; + } + + export interface MembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + } + + export interface IdentityType { + dateOfBirth?: Date | null; + familyName?: string | null; + givenName?: string | null; + secondInitial?: string | null; + sex?: string | null; + } + + export interface ServiceResponseType { + error?: StatusType; + id?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface BulkBillStoreForwardRequestType { + claim: BulkBillClaimStoreForwardClaimType; + } + + export interface BulkBillClaimStoreForwardClaimType { + facilityId?: string | null; + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface BBSMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + medicalEventDate: Date; + medicalEventTime?: string | null; + patient: MedicarePatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface MedicarePatientType { + identity: IdentityType; + medicare: MembershipType; + } + + export interface ReferralType { + issueDate: Date; + period?: string | null; + periodCode?: string | null; + provider: ProviderType; + typeCode: string; + } + + export interface ServiceType { + id: string; + accessionDateTime?: Date | null; + aftercareOverrideInd?: string | null; + chargeAmount?: string | null; + collectionDateTime?: Date | null; + duplicateServiceOverrideInd?: string | null; + fieldQuantity?: string | null; + itemNumber?: string | null; + lspNumber?: string | null; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + restrictiveOverrideCode?: string | null; + rule3ExemptInd?: string | null; + s4b3ExemptInd?: string | null; + scpId?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + } + + export interface BulkBillStoreForwardResponseType { + claimId: string; + status: string; + } + + export interface AlliedHealthClaimRequestType { + claim: VAAClaimType; + } + + export interface VAAClaimType { + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface VAAMedicalEventType { + id: string; + acceptedDisability?: AcceptedDisabilityType; + authorisationDate: Date; + breakInEpisodeEndDate?: Date | null; + breakInEpisodeOfCareNumber?: string | null; + breakInEpisodeStartDate?: Date | null; + numberOfCNCHours?: string | null; + numberOfCNCVisits?: string | null; + createDateTime: Date; + numberOfENHours?: string | null; + numberOfENVisits?: string | null; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + numberOfNSSHours?: string | null; + numberOfNSSVisits?: string | null; + patient: VeteranPatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + numberOfRNHours?: string | null; + numberOfRNVisits?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface AcceptedDisabilityType { + code: string; + ind: string; + } + + export interface VAAServiceType { + id: string; + accountReferenceNumber?: string | null; + admissionDate?: Date | null; + chargeAmount?: string | null; + dischargeDate?: Date | null; + distanceKilometres?: number | null; + duplicateServiceOverrideInd?: string | null; + itemNumber: string; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + numberOfTeeth?: string | null; + opticalScriptCode?: string | null; + restrictiveOverrideCode?: string | null; + secondDeviceInd?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + toothNumber?: string | null; + upperLowerJawCode?: string | null; + } + + export interface VeteranPatientType extends PatientType { + veteranMembership?: VeteranMembershipType; + } + + export interface VeteranMembershipType { + veteranNumber: string; + } + + export interface PatientType { + identity: IdentityType; + residentialAddress?: AddressType; + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postcode?: string | null; + } + + export interface AlliedHealthClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAClaimRequestType { + claim: DVAClaimType; + } + + export interface DVAClaimType { + hospitalInd?: string | null; + serviceTypeCode: string; + medicalEvent: Array; + serviceProvider: ProviderType; + payeeProvider?: ProviderType; + } + + export interface DVAMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + referralOverrideCode?: string | null; + submissionAuthorityInd: string; + treatmentLocationCode?: string | null; + acceptedDisability?: AcceptedDisabilityType; + referral?: ReferralType; + patient: VeteranPatientType; + service: Array; + } + + export interface DVAServiceType extends ServiceType { + accountReferenceNumber?: string | null; + distanceKilometres?: number | null; + } + + export interface DVAClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface DVAPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface DVAProcessingReportResponseType { + claimAssessment?: DVAClaimAssessmentType; + status: string; + } + + export interface DVAClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface DVAMedicalEventAssessmentType { + patient?: VeteranMembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface VeteranMembershipStatusType { + currentMembership?: VeteranMembershipResponseType; + currentMember?: IdentityType; + status?: StatusType; + processDate?: Date | null; + } + + export interface DVAServiceAssessmentType { + id?: string | null; + accountReferenceNumber?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + gstInd?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface VeteranMembershipResponseType extends VeteranMembershipType { + entitlementCode?: string | null; + } + + export interface EnterpriseConcessionVerificationRequestType { + timeout?: number | null; + concessionVerificationRequest: Array; + } + + export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { + id: string; + } + + export interface ConcessionVerificationRequestType { + patient: MedicarePatientType; + dateOfService?: Date | null; + } + + export interface EnterpriseConcessionVerificationResponseType { + status: string; + concessionVerificationResponse?: Array; + } + + export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { + id: string; + } + + export interface ConcessionVerificationResponseType { + medicareStatus: MembershipStatusType; + concessionStatus: ConcessionStatusType; + } + + export interface ConcessionStatusType { + status?: StatusType; + processDate?: Date | null; + } + + export interface EnterprisePatientVerificationRequestType { + timeout?: number | null; + patientVerificationRequest: Array; + } + + export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { + id: string; + } + + export interface PatientVerificationRequestType { + patient: FundPatientType; + provider?: ProviderType; + dateOfService?: Date | null; + typeCode: string; + } + + export interface FundPatientType extends PatientType { + alsoKnownAs?: IdentityType; + medicare?: MembershipType; + healthFund?: FundMembershipType; + } + + export interface FundMembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + organisation?: string | null; + } + + export interface EnterprisePatientVerificationResponseType { + status: string; + patientVerificationResponse?: Array; + } + + export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { + id: string; + } + + export interface PatientVerificationResponseType { + medicareStatus?: MembershipStatusType; + healthFundStatus?: FundMembershipStatusType; + } + + export interface FundMembershipStatusType { + status?: StatusType; + currentMembership?: FundMembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface EnterpriseVeteranVerificationRequestType { + timeout?: number | null; + veteranVerificationRequest: Array; + } + + export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { + id: string; + } + + export interface VeteranVerificationRequestType { + patient: VeteranPatientType; + } + + export interface EnterpriseVeteranVerificationResponseType { + status: string; + veteranVerificationResponse?: Array; + } + + export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { + id?: string | null; + } + + export interface VeteranVerificationResponseType { + veteranStatus?: VeteranMembershipStatusType; + } + + export interface PatientClaimInteractiveRequestType { + patientClaimInteractive: PatientClaimInteractiveType; + } + + export interface PatientClaimInteractiveType { + patient: MedicarePatientType; + referral?: ReferralType; + claimant: ClaimantType; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + referralOverrideCode?: string | null; + accountPaidInd: string; + accountReferenceId?: string | null; + submissionAuthorityInd: string; + authorisationDate: Date; + } + + export interface PCIMedicalEventType { + service: Array; + id: string; + medicalEventDate: Date; + medicalEventTime?: string | null; + } + + export interface PCIServiceType extends ServiceType { + patientContribAmount?: string | null; + facilityId?: string | null; + hospitalInd?: string | null; + } + + export interface ClaimantType extends MedicarePatientType { + eftDetails?: BankAccountType; + residentialAddress?: AddressType; + contactDetails?: ContactType; + } + + export interface ContactType { + emailAddress?: string | null; + name?: string | null; + phoneNumber?: string | null; + } + + export interface PatientClaimInteractiveResponseType { + claimAssessment: PCIAssessmentType; + status: string; + } + + export interface PCIAssessmentType { + claimant?: CurrentMembershipType; + patient?: CurrentMembershipType; + medicalEvent?: Array; + error?: StatusType; + claimId: string; + } + + export interface CurrentMembershipType { + currentMembership: MembershipType; + } + + export interface PCIMedicalEventResponseType { + service?: Array; + eventDate?: Date | null; + id?: string | null; + } + + export interface RetrieveReportRequestType { + transactionId: Array; + } + + export interface RetrieveReportResponseType { + content?: Array; + } + + export interface ContentType { + transactionId?: string | null; + status?: string | null; + } + + export interface EnterpriseConcessionVerificationReportContentType extends ContentType { + report?: EnterpriseConcessionVerificationResponseType; + } + + export interface EnterprisePatientVerificationReportContentType extends ContentType { + report?: EnterprisePatientVerificationResponseType; + } + + export interface EnterpriseVeteranVerificationReportContentType extends ContentType { + report?: EnterpriseVeteranVerificationResponseType; + } + + export interface SameDayDeleteRequestType { + sameDayDelete: SameDayDeleteType; + } + + export interface SameDayDeleteType { + patient: MedicarePatientType; + reasonCode: string; + } + + export interface SameDayDeleteResponseType { + status: string; + } + + export interface StatusReportRequestType { + transactionId?: Array; + associateName?: string | null; + fromDateTime?: Date | null; + toDateTime?: Date | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + status?: string | null; + } + + export interface StatusReportResponseType { + transactionStatus?: Array; + status: string; + } + + export interface TransactionStatusType { + associateName?: string | null; + lodgementDateTime?: Date | null; + processStatus?: string | null; + reference?: string | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + transactionId?: string | null; + } + + export class McpClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This is the request + * Post mcp/bulkbillpaymentreport/v1 + * @return {BBSPaymentReportResponseType} successful operation + */ + McpBulkBillPaymentReport1Eigw(callback: (data : BBSPaymentReportResponseType) => any, requestBody: BBSReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/bulkbillprocessingreport/v1 + * @return {BBSProcessingReportResponseType} successful operation + */ + McpBulkBillProcessingReport1Eigw(callback: (data : BBSProcessingReportResponseType) => any, requestBody: BBSReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/general/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardGeneral1Eigw(callback: (data : BulkBillStoreForwardResponseType) => any, requestBody: BulkBillStoreForwardRequestType) { + this.httpClient.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/pathology/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardPathology1Eigw(callback: (data : BulkBillStoreForwardResponseType) => any, requestBody: BulkBillStoreForwardRequestType) { + this.httpClient.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/specialist/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardSpecialist1Eigw(callback: (data : BulkBillStoreForwardResponseType) => any, requestBody: BulkBillStoreForwardRequestType) { + this.httpClient.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/allied/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthAllied1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/communitynursing/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthCommunityNursing1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/dental/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthDental1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/optical/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthOptical1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/psych/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthPsych1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/speechpathology/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthSpeechPathology1Eigw(callback: (data : AlliedHealthClaimResponseType) => any, requestBody: AlliedHealthClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaclaim/general/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimGeneral1Eigw(callback: (data : DVAClaimResponseType) => any, requestBody: DVAClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaclaim/general/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaclaim/pathology/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimPathology1Eigw(callback: (data : DVAClaimResponseType) => any, requestBody: DVAClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaclaim/specialist/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimSpecialist1Eigw(callback: (data : DVAClaimResponseType) => any, requestBody: DVAClaimRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvapaymentreport/v1 + * @return {DVAPaymentReportResponseType} successful operation + */ + McpDvaPaymentReport1Eigw(callback: (data : DVAPaymentReportResponseType) => any, requestBody: DVAReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvapaymentreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/dvaprocessingreport/v1 + * @return {DVAProcessingReportResponseType} successful operation + */ + McpDvaProcessingReport1Eigw(callback: (data : DVAProcessingReportResponseType) => any, requestBody: DVAReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/dvaprocessingreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/v1 + * @return {EnterpriseConcessionVerificationResponseType} successful operation + */ + McpEnterpriseConcessionVerification1Eigw(callback: (data : EnterpriseConcessionVerificationResponseType) => any, requestBody: EnterpriseConcessionVerificationRequestType) { + this.httpClient.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/v1 + * @return {EnterprisePatientVerificationResponseType} successful operation + */ + McpEnterprisePatientVerification1Eigw(callback: (data : EnterprisePatientVerificationResponseType) => any, requestBody: EnterprisePatientVerificationRequestType) { + this.httpClient.post(this.baseUri + 'mcp/enterprisepatientverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/v1 + * @return {EnterpriseVeteranVerificationResponseType} successful operation + */ + McpEnterpriseVeteranVerification1Eigw(callback: (data : EnterpriseVeteranVerificationResponseType) => any, requestBody: EnterpriseVeteranVerificationRequestType) { + this.httpClient.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/general/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveGeneral1Eigw(callback: (data : PatientClaimInteractiveResponseType) => any, requestBody: PatientClaimInteractiveRequestType) { + this.httpClient.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/pathology/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractivePathology1Eigw(callback: (data : PatientClaimInteractiveResponseType) => any, requestBody: PatientClaimInteractiveRequestType) { + this.httpClient.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/specialist/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveSpecialist1Eigw(callback: (data : PatientClaimInteractiveResponseType) => any, requestBody: PatientClaimInteractiveRequestType) { + this.httpClient.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/patientverification/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerification1Eigw(callback: (data : PatientVerificationResponseType) => any, requestBody: PatientVerificationRequestType) { + this.httpClient.post(this.baseUri + 'mcp/patientverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/patientverification/hf/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationHf1Eigw(callback: (data : PatientVerificationResponseType) => any, requestBody: PatientVerificationRequestType) { + this.httpClient.post(this.baseUri + 'mcp/patientverification/hf/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/patientverification/medicare/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationMedicare1Eigw(callback: (data : PatientVerificationResponseType) => any, requestBody: PatientVerificationRequestType) { + this.httpClient.post(this.baseUri + 'mcp/patientverification/medicare/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEcv1Eigw(callback: (data : RetrieveReportResponseType) => any, requestBody: RetrieveReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEpv1Eigw(callback: (data : RetrieveReportResponseType) => any, requestBody: RetrieveReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEvv1Eigw(callback: (data : RetrieveReportResponseType) => any, requestBody: RetrieveReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/samedaydelete/v1 + * @return {SameDayDeleteResponseType} successful operation + */ + McpSameDayDelete1Eigw(callback: (data : SameDayDeleteResponseType) => any, requestBody: SameDayDeleteRequestType) { + this.httpClient.post(this.baseUri + 'mcp/samedaydelete/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/statusreport/v1 + * @return {StatusReportResponseType} successful operation + */ + McpStatusReport1Eigw(callback: (data : StatusReportResponseType) => any, requestBody: StatusReportRequestType) { + this.httpClient.post(this.baseUri + 'mcp/statusreport/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This is the request + * Post mcp/veteranverification/v1 + * @return {VeteranVerificationResponseType} successful operation + */ + McpVeteranVerification1Eigw(callback: (data : VeteranVerificationResponseType) => any, requestBody: VeteranVerificationRequestType) { + this.httpClient.post(this.baseUri + 'mcp/veteranverification/v1', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/redocOpenApi200501.txt b/Tests/SwagTsTests/JqResults/redocOpenApi200501.ts similarity index 96% rename from Tests/SwagTsTests/JqResults/redocOpenApi200501.txt rename to Tests/SwagTsTests/JqResults/redocOpenApi200501.ts index 43ad6bce..36366304 100644 --- a/Tests/SwagTsTests/JqResults/redocOpenApi200501.txt +++ b/Tests/SwagTsTests/JqResults/redocOpenApi200501.ts @@ -1,421 +1,421 @@ -/// -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1.0 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1.0 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export class PetClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @return {void} - */ - AddPet(callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'pet', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Update an existing pet - * Put pet - * @return {void} - */ - UpdatePet(callback: (data : void) => any) { - this.httpClient.put(this.baseUri + 'pet', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string, callback: (data : Pet) => any) { - this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array, callback: (data : Array) => any) { - this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); - } - } - - export class StoreClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(callback: (data : {[id: string]: number }) => any) { - this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(callback: (data : Order) => any, requestBody: Order) { - this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1.0 Maximum: 5.0 - * @return {Order} successful operation - */ - GetOrderById(orderId: string, callback: (data : Order) => any) { - this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1.0 - * @return {void} - */ - DeleteOrder(orderId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); - } - - /** - * Subscribe to the Store events - * Add subscription for a store events - * Post store/subscribe - * @return {void} - */ - Subscribe(callback: (data : void) => any, requestBody: SubscribePostBody) { - this.httpClient.post(this.baseUri + 'store/subscribe', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class UserClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(callback: (data : void) => any, requestBody: User) { - this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string, callback: (data : User) => any) { - this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, callback: (data : void) => any, requestBody: User) { - this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @return {void} - */ - CreateUsersWithArrayInput(callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'user/createWithArray', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @return {void} - */ - CreateUsersWithListInput(callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'user/createWithList', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string, callback: (data : string) => any) { - this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); - } - } - - export interface SubscribePostBody { - - /** - * This URL will be called by the server when the desired event will occur - * Required - */ - callbackUrl: string; - - /** - * Event name for the subscription - * Required - */ - eventName: SubscribePostBodyEventName; - } - - export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } - -} - +/// +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1.0 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1.0 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export class PetClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @return {void} + */ + AddPet(callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'pet', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Update an existing pet + * Put pet + * @return {void} + */ + UpdatePet(callback: (data : void) => any) { + this.httpClient.put(this.baseUri + 'pet', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string, callback: (data : Pet) => any) { + this.httpClient.get(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'pet/' + petId, callback, this.error, this.statusCode); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), callback, this.error, this.statusCode); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array, callback: (data : Array) => any) { + this.httpClient.get(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), callback, this.error, this.statusCode); + } + } + + export class StoreClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(callback: (data : {[id: string]: number }) => any) { + this.httpClient.get(this.baseUri + 'store/inventory', callback, this.error, this.statusCode); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(callback: (data : Order) => any, requestBody: Order) { + this.httpClient.post(this.baseUri + 'store/order', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1.0 Maximum: 5.0 + * @return {Order} successful operation + */ + GetOrderById(orderId: string, callback: (data : Order) => any) { + this.httpClient.get(this.baseUri + 'store/order/' + orderId, callback, this.error, this.statusCode); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1.0 + * @return {void} + */ + DeleteOrder(orderId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), callback, this.error, this.statusCode); + } + + /** + * Subscribe to the Store events + * Add subscription for a store events + * Post store/subscribe + * @return {void} + */ + Subscribe(callback: (data : void) => any, requestBody: SubscribePostBody) { + this.httpClient.post(this.baseUri + 'store/subscribe', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class UserClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(callback: (data : void) => any, requestBody: User) { + this.httpClient.post(this.baseUri + 'user', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string, callback: (data : User) => any) { + this.httpClient.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, callback: (data : void) => any, requestBody: User) { + this.httpClient.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), callback, this.error, this.statusCode); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @return {void} + */ + CreateUsersWithArrayInput(callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'user/createWithArray', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @return {void} + */ + CreateUsersWithListInput(callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'user/createWithList', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string, callback: (data : string) => any) { + this.httpClient.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), callback, this.error, this.statusCode); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'user/logout', callback, this.error, this.statusCode); + } + } + + export interface SubscribePostBody { + + /** + * This URL will be called by the server when the desired event will occur + * Required + */ + callbackUrl: string; + + /** + * Event name for the subscription + * Required + */ + eventName: SubscribePostBodyEventName; + } + + export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_account.txt b/Tests/SwagTsTests/JqResults/sell_account.ts similarity index 99% rename from Tests/SwagTsTests/JqResults/sell_account.txt rename to Tests/SwagTsTests/JqResults/sell_account.ts index 86a0db48..de26c349 100644 --- a/Tests/SwagTsTests/JqResults/sell_account.txt +++ b/Tests/SwagTsTests/JqResults/sell_account.ts @@ -1,1153 +1,1153 @@ -/// -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ - export interface CategoryType { - - /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ - default?: boolean | null; - - /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ - name?: string | null; - } - - - /** A container that describes the details of a deposit. Used only with motor listings. */ - export interface Deposit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - dueIn?: TimeDuration; - - /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ - paymentMethods?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ - export interface PaymentMethod { - - /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ - brands?: Array; - - /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ - paymentMethodType?: string | null; - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - recipientAccountReference?: RecipientAccountReference; - } - - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - export interface RecipientAccountReference { - - /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ - referenceId?: string | null; - - /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ - referenceType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface FulfillmentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ - export interface ShippingOption { - - /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ - costType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - insuranceFee?: Amount; - - /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ - insuranceOffered?: boolean | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ - optionType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - packageHandlingCost?: Amount; - - /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ - rateTableId?: string | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ - shippingServices?: Array; - } - - - /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ - export interface ShippingService { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalShippingCost?: Amount; - - /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForPickup?: boolean | null; - - /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForShipping?: boolean | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - cashOnDeliveryFee?: Amount; - - /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ - freeShipping?: boolean | null; - - /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ - shippingCarrierCode?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - shippingCost?: Amount; - - /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ - shippingServiceCode?: string | null; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** - * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - sortOrder?: number | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - surcharge?: Amount; - } - - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - export interface RegionSet { - - /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ - regionExcluded?: Array; - - /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ - regionIncluded?: Array; - } - - - /** This type defines information for a region. */ - export interface Region { - - /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ - regionName?: string | null; - - /** Reserved for future use. For implementation help, refer to eBay API documentation */ - regionType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface FulfillmentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** The response payload for requests that return a list of fulfillment policies. */ - export interface FulfillmentPolicyResponse { - - /** A list of the seller's fulfillment policies. */ - fulfillmentPolicies?: Array; - - /** Returns a URL link to the result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - export interface InternationalReturnOverrideType { - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ - returnsAccepted?: boolean | null; - - /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface PaymentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - } - - - /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface PaymentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - } - - - /** The response payload for payment policy requests. */ - export interface PaymentPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** A list of the seller's payment policies. */ - paymentPolicies?: Array; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object containing the sellers status with regards to the specified payment program. */ - export interface PaymentsProgramResponse { - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ - paymentsProgramType?: string | null; - - /** For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ - wasPreviouslyOptedIn?: boolean | null; - } - - - /** A seller program in to which a seller can opt-in. */ - export interface Program { - - /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ - programType?: string | null; - } - - - /** A list of the supported seller programs. */ - export interface Programs { - - /** A list of seller programs. */ - programs?: Array; - } - - - /** A complex type that contains information pertaining to a shipping rate table. */ - export interface RateTable { - - /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ - locality?: string | null; - - /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ - name?: string | null; - - /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ - rateTableId?: string | null; - } - - - /** The response container for with information on a seller's shipping rate tables. */ - export interface RateTableResponse { - - /** A list of elements that provide information on the seller-defined shipping rate tables. */ - rateTables?: Array; - } - - - /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface ReturnPolicy { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface ReturnPolicyRequest { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** The response payload for return policy requests. */ - export interface ReturnPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** A list of the seller's return policies. */ - returnPolicies?: Array; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ - export interface SalesTax { - - /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ - salesTaxJurisdictionId?: string | null; - - /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A container that describes the how the sales tax rate is calculated. */ - export interface SalesTaxBase { - - /** The sales tax rate, as a percentage of the sale. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A list of sales tax tables. */ - export interface SalesTaxes { - - /** A list of sales tax tables that have been set up by a seller. */ - salesTaxes?: Array; - } - - - /** Defines the selling limit applied to an eBay seller's account. */ - export interface SellingLimit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** - * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A merchant's selling limit, and the status of their account registration. */ - export interface SellingPrivileges { - - /** If set to true, the seller's registration is completed. */ - sellerRegistrationCompleted?: boolean | null; - - /** Defines the selling limit applied to an eBay seller's account. */ - sellingLimit?: SellingLimit; - } - - - /** Complex type that that gets populated with a response containing a fulfillment policy. */ - export interface SetFulfillmentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** Complex type that that gets populated with a response containing a payment policy. */ - export interface SetPaymentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** Complex type that that gets populated with a response containing a return policy. */ - export interface SetReturnPolicyResponse { - - /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ - restockingFeePercentage?: string | null; - - /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ - returnInstructions?: string | null; - - /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - export class Fulfillment_policyClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {FulfillmentPolicyResponse} Success - */ - GetFulfillmentPolicies(marketplace_id: string, callback: (data : FulfillmentPolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); - } - - /** - * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post fulfillment_policy/ - * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. - * @return {void} - */ - CreateFulfillmentPolicy(callback: (data : void) => any, requestBody: FulfillmentPolicyRequest) { - this.httpClient.post(this.baseUri + 'fulfillment_policy/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. - * Get fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicy(fulfillmentPolicyId: string, callback: (data : FulfillmentPolicy) => any) { - this.httpClient.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), callback, this.error, this.statusCode); - } - - /** - * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. - * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request - * @return {SetFulfillmentPolicyResponse} OK - */ - UpdateFulfillmentPolicy(fulfillmentPolicyId: string, callback: (data : SetFulfillmentPolicyResponse) => any, requestBody: FulfillmentPolicyRequest) { - this.httpClient.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. - * Delete fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. - * @return {void} - */ - DeleteFulfillmentPolicy(fulfillmentPolicyId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), callback, this.error, this.statusCode); - } - - /** - * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicyByName(marketplace_id: string, name: string, callback: (data : FulfillmentPolicy) => any) { - this.httpClient.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), callback, this.error, this.statusCode); - } - } - - export class Payment_policyClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {PaymentPolicyResponse} Success - */ - GetPaymentPolicies(marketplace_id: string, callback: (data : PaymentPolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); - } - - /** - * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post payment_policy/ - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {void} - */ - CreatePaymentPolicy(callback: (data : void) => any, requestBody: PaymentPolicyRequest) { - this.httpClient.post(this.baseUri + 'payment_policy/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. - * Get payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicy(payment_policy_id: string, callback: (data : PaymentPolicy) => any) { - this.httpClient.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), callback, this.error, this.statusCode); - } - - /** - * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {SetPaymentPolicyResponse} OK - */ - UpdatePaymentPolicy(payment_policy_id: string, callback: (data : SetPaymentPolicyResponse) => any, requestBody: PaymentPolicyRequest) { - this.httpClient.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. - * Delete payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. - * @return {void} - */ - DeletePaymentPolicy(payment_policy_id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), callback, this.error, this.statusCode); - } - - /** - * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicyByName(marketplace_id: string, name: string, callback: (data : PaymentPolicy) => any) { - this.httpClient.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), callback, this.error, this.statusCode); - } - } - - export class Payments_programClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. - * Get payments_program/{marketplace_id}/{payments_program_type} - * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. - * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. - * @return {PaymentsProgramResponse} Success - */ - GetPaymentsProgram(marketplace_id: string, payments_program_type: string, callback: (data : PaymentsProgramResponse) => any) { - this.httpClient.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), callback, this.error, this.statusCode); - } - } - - export class PrivilegeClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). - * Get privilege/ - * @return {SellingPrivileges} Success - */ - GetPrivileges(callback: (data : SellingPrivileges) => any) { - this.httpClient.get(this.baseUri + 'privilege/', callback, this.error, this.statusCode); - } - } - - export class ProgramClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method gets a list of the seller programs that the seller has opted-in to. - * Get program/get_opted_in_programs - * @return {Programs} Success - */ - GetOptedInPrograms(callback: (data : Programs) => any) { - this.httpClient.get(this.baseUri + 'program/get_opted_in_programs', callback, this.error, this.statusCode); - } - - /** - * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. - * Post program/opt_in - * @param {Program} requestBody Program being opted-in to. - * @return {string} Success - */ - OptInToProgram(callback: (data : string) => any, requestBody: Program) { - this.httpClient.post(this.baseUri + 'program/opt_in', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. - * Post program/opt_out - * @param {Program} requestBody Program being opted-out of. - * @return {string} Success - */ - OptOutOfProgram(callback: (data : string) => any, requestBody: Program) { - this.httpClient.post(this.baseUri + 'program/opt_out', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Rate_tableClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. - * Get rate_table/ - * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {RateTableResponse} Success - */ - GetRateTables(country_code: string | null | undefined, callback: (data : RateTableResponse) => any) { - this.httpClient.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), callback, this.error, this.statusCode); - } - } - - export class Return_policyClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/ - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(marketplace_id: string, callback: (data : ReturnPolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); - } - - /** - * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post return_policy/ - * @param {ReturnPolicyRequest} requestBody Return policy request - * @return {void} - */ - CreateReturnPolicy(callback: (data : void) => any, requestBody: ReturnPolicyRequest) { - this.httpClient.post(this.baseUri + 'return_policy/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. - * Get return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicy(return_policy_id: string, callback: (data : ReturnPolicy) => any) { - this.httpClient.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), callback, this.error, this.statusCode); - } - - /** - * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. - * @param {ReturnPolicyRequest} requestBody Container for a return policy request. - * @return {SetReturnPolicyResponse} OK - */ - UpdateReturnPolicy(return_policy_id: string, callback: (data : SetReturnPolicyResponse) => any, requestBody: ReturnPolicyRequest) { - this.httpClient.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. - * Delete return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. - * @return {void} - */ - DeleteReturnPolicy(return_policy_id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), callback, this.error, this.statusCode); - } - - /** - * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicyByName(marketplace_id: string, name: string, callback: (data : ReturnPolicy) => any) { - this.httpClient.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), callback, this.error, this.statusCode); - } - } - - export class Sales_taxClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. - * Get sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. - * @return {SalesTax} Success - */ - GetSalesTax(countryCode: string, jurisdictionId: string, callback: (data : SalesTax) => any) { - this.httpClient.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), callback, this.error, this.statusCode); - } - - /** - * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. - * Put sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. - * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. - * @return {void} - */ - CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, callback: (data : void) => any, requestBody: SalesTaxBase) { - this.httpClient.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. - * Delete sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. - * @return {void} - */ - DeleteSalesTax(countryCode: string, jurisdictionId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), callback, this.error, this.statusCode); - } - - /** - * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. - * Get sales_tax/ - * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {SalesTaxes} Success - */ - GetSalesTaxes(country_code: string, callback: (data : SalesTaxes) => any) { - this.httpClient.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ + export interface CategoryType { + + /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ + default?: boolean | null; + + /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ + name?: string | null; + } + + + /** A container that describes the details of a deposit. Used only with motor listings. */ + export interface Deposit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + dueIn?: TimeDuration; + + /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ + paymentMethods?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ + export interface PaymentMethod { + + /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ + brands?: Array; + + /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ + paymentMethodType?: string | null; + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + recipientAccountReference?: RecipientAccountReference; + } + + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + export interface RecipientAccountReference { + + /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ + referenceId?: string | null; + + /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ + referenceType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface FulfillmentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ + export interface ShippingOption { + + /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ + costType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + insuranceFee?: Amount; + + /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ + insuranceOffered?: boolean | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ + optionType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + packageHandlingCost?: Amount; + + /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ + rateTableId?: string | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ + shippingServices?: Array; + } + + + /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ + export interface ShippingService { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalShippingCost?: Amount; + + /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForPickup?: boolean | null; + + /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForShipping?: boolean | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + cashOnDeliveryFee?: Amount; + + /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ + freeShipping?: boolean | null; + + /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ + shippingCarrierCode?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + shippingCost?: Amount; + + /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ + shippingServiceCode?: string | null; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** + * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + sortOrder?: number | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + surcharge?: Amount; + } + + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + export interface RegionSet { + + /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ + regionExcluded?: Array; + + /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ + regionIncluded?: Array; + } + + + /** This type defines information for a region. */ + export interface Region { + + /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ + regionName?: string | null; + + /** Reserved for future use. For implementation help, refer to eBay API documentation */ + regionType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface FulfillmentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** The response payload for requests that return a list of fulfillment policies. */ + export interface FulfillmentPolicyResponse { + + /** A list of the seller's fulfillment policies. */ + fulfillmentPolicies?: Array; + + /** Returns a URL link to the result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + export interface InternationalReturnOverrideType { + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ + returnsAccepted?: boolean | null; + + /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface PaymentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + } + + + /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface PaymentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + } + + + /** The response payload for payment policy requests. */ + export interface PaymentPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** A list of the seller's payment policies. */ + paymentPolicies?: Array; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object containing the sellers status with regards to the specified payment program. */ + export interface PaymentsProgramResponse { + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ + paymentsProgramType?: string | null; + + /** For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ + wasPreviouslyOptedIn?: boolean | null; + } + + + /** A seller program in to which a seller can opt-in. */ + export interface Program { + + /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ + programType?: string | null; + } + + + /** A list of the supported seller programs. */ + export interface Programs { + + /** A list of seller programs. */ + programs?: Array; + } + + + /** A complex type that contains information pertaining to a shipping rate table. */ + export interface RateTable { + + /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ + locality?: string | null; + + /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ + name?: string | null; + + /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ + rateTableId?: string | null; + } + + + /** The response container for with information on a seller's shipping rate tables. */ + export interface RateTableResponse { + + /** A list of elements that provide information on the seller-defined shipping rate tables. */ + rateTables?: Array; + } + + + /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface ReturnPolicy { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface ReturnPolicyRequest { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** The response payload for return policy requests. */ + export interface ReturnPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** A list of the seller's return policies. */ + returnPolicies?: Array; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ + export interface SalesTax { + + /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ + salesTaxJurisdictionId?: string | null; + + /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A container that describes the how the sales tax rate is calculated. */ + export interface SalesTaxBase { + + /** The sales tax rate, as a percentage of the sale. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A list of sales tax tables. */ + export interface SalesTaxes { + + /** A list of sales tax tables that have been set up by a seller. */ + salesTaxes?: Array; + } + + + /** Defines the selling limit applied to an eBay seller's account. */ + export interface SellingLimit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** + * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A merchant's selling limit, and the status of their account registration. */ + export interface SellingPrivileges { + + /** If set to true, the seller's registration is completed. */ + sellerRegistrationCompleted?: boolean | null; + + /** Defines the selling limit applied to an eBay seller's account. */ + sellingLimit?: SellingLimit; + } + + + /** Complex type that that gets populated with a response containing a fulfillment policy. */ + export interface SetFulfillmentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** Complex type that that gets populated with a response containing a payment policy. */ + export interface SetPaymentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** Complex type that that gets populated with a response containing a return policy. */ + export interface SetReturnPolicyResponse { + + /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ + restockingFeePercentage?: string | null; + + /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ + returnInstructions?: string | null; + + /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + export class Fulfillment_policyClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {FulfillmentPolicyResponse} Success + */ + GetFulfillmentPolicies(marketplace_id: string, callback: (data : FulfillmentPolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); + } + + /** + * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post fulfillment_policy/ + * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. + * @return {void} + */ + CreateFulfillmentPolicy(callback: (data : void) => any, requestBody: FulfillmentPolicyRequest) { + this.httpClient.post(this.baseUri + 'fulfillment_policy/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. + * Get fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicy(fulfillmentPolicyId: string, callback: (data : FulfillmentPolicy) => any) { + this.httpClient.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), callback, this.error, this.statusCode); + } + + /** + * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. + * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request + * @return {SetFulfillmentPolicyResponse} OK + */ + UpdateFulfillmentPolicy(fulfillmentPolicyId: string, callback: (data : SetFulfillmentPolicyResponse) => any, requestBody: FulfillmentPolicyRequest) { + this.httpClient.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. + * Delete fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. + * @return {void} + */ + DeleteFulfillmentPolicy(fulfillmentPolicyId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), callback, this.error, this.statusCode); + } + + /** + * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicyByName(marketplace_id: string, name: string, callback: (data : FulfillmentPolicy) => any) { + this.httpClient.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), callback, this.error, this.statusCode); + } + } + + export class Payment_policyClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {PaymentPolicyResponse} Success + */ + GetPaymentPolicies(marketplace_id: string, callback: (data : PaymentPolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); + } + + /** + * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post payment_policy/ + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {void} + */ + CreatePaymentPolicy(callback: (data : void) => any, requestBody: PaymentPolicyRequest) { + this.httpClient.post(this.baseUri + 'payment_policy/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. + * Get payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicy(payment_policy_id: string, callback: (data : PaymentPolicy) => any) { + this.httpClient.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), callback, this.error, this.statusCode); + } + + /** + * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {SetPaymentPolicyResponse} OK + */ + UpdatePaymentPolicy(payment_policy_id: string, callback: (data : SetPaymentPolicyResponse) => any, requestBody: PaymentPolicyRequest) { + this.httpClient.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. + * Delete payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. + * @return {void} + */ + DeletePaymentPolicy(payment_policy_id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), callback, this.error, this.statusCode); + } + + /** + * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicyByName(marketplace_id: string, name: string, callback: (data : PaymentPolicy) => any) { + this.httpClient.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), callback, this.error, this.statusCode); + } + } + + export class Payments_programClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. + * Get payments_program/{marketplace_id}/{payments_program_type} + * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. + * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. + * @return {PaymentsProgramResponse} Success + */ + GetPaymentsProgram(marketplace_id: string, payments_program_type: string, callback: (data : PaymentsProgramResponse) => any) { + this.httpClient.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), callback, this.error, this.statusCode); + } + } + + export class PrivilegeClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). + * Get privilege/ + * @return {SellingPrivileges} Success + */ + GetPrivileges(callback: (data : SellingPrivileges) => any) { + this.httpClient.get(this.baseUri + 'privilege/', callback, this.error, this.statusCode); + } + } + + export class ProgramClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method gets a list of the seller programs that the seller has opted-in to. + * Get program/get_opted_in_programs + * @return {Programs} Success + */ + GetOptedInPrograms(callback: (data : Programs) => any) { + this.httpClient.get(this.baseUri + 'program/get_opted_in_programs', callback, this.error, this.statusCode); + } + + /** + * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. + * Post program/opt_in + * @param {Program} requestBody Program being opted-in to. + * @return {string} Success + */ + OptInToProgram(callback: (data : string) => any, requestBody: Program) { + this.httpClient.post(this.baseUri + 'program/opt_in', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. + * Post program/opt_out + * @param {Program} requestBody Program being opted-out of. + * @return {string} Success + */ + OptOutOfProgram(callback: (data : string) => any, requestBody: Program) { + this.httpClient.post(this.baseUri + 'program/opt_out', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Rate_tableClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. + * Get rate_table/ + * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {RateTableResponse} Success + */ + GetRateTables(country_code: string | null | undefined, callback: (data : RateTableResponse) => any) { + this.httpClient.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), callback, this.error, this.statusCode); + } + } + + export class Return_policyClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/ + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(marketplace_id: string, callback: (data : ReturnPolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); + } + + /** + * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post return_policy/ + * @param {ReturnPolicyRequest} requestBody Return policy request + * @return {void} + */ + CreateReturnPolicy(callback: (data : void) => any, requestBody: ReturnPolicyRequest) { + this.httpClient.post(this.baseUri + 'return_policy/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. + * Get return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicy(return_policy_id: string, callback: (data : ReturnPolicy) => any) { + this.httpClient.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), callback, this.error, this.statusCode); + } + + /** + * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. + * @param {ReturnPolicyRequest} requestBody Container for a return policy request. + * @return {SetReturnPolicyResponse} OK + */ + UpdateReturnPolicy(return_policy_id: string, callback: (data : SetReturnPolicyResponse) => any, requestBody: ReturnPolicyRequest) { + this.httpClient.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. + * Delete return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. + * @return {void} + */ + DeleteReturnPolicy(return_policy_id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), callback, this.error, this.statusCode); + } + + /** + * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicyByName(marketplace_id: string, name: string, callback: (data : ReturnPolicy) => any) { + this.httpClient.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), callback, this.error, this.statusCode); + } + } + + export class Sales_taxClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. + * Get sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. + * @return {SalesTax} Success + */ + GetSalesTax(countryCode: string, jurisdictionId: string, callback: (data : SalesTax) => any) { + this.httpClient.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), callback, this.error, this.statusCode); + } + + /** + * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. + * Put sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. + * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. + * @return {void} + */ + CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, callback: (data : void) => any, requestBody: SalesTaxBase) { + this.httpClient.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. + * Delete sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. + * @return {void} + */ + DeleteSalesTax(countryCode: string, jurisdictionId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), callback, this.error, this.statusCode); + } + + /** + * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. + * Get sales_tax/ + * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {SalesTaxes} Success + */ + GetSalesTaxes(country_code: string, callback: (data : SalesTaxes) => any) { + this.httpClient.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_analytics.txt b/Tests/SwagTsTests/JqResults/sell_analytics.ts similarity index 99% rename from Tests/SwagTsTests/JqResults/sell_analytics.txt rename to Tests/SwagTsTests/JqResults/sell_analytics.ts index 27839f25..1f5874cb 100644 --- a/Tests/SwagTsTests/JqResults/sell_analytics.txt +++ b/Tests/SwagTsTests/JqResults/sell_analytics.ts @@ -1,381 +1,381 @@ -/// -export namespace MyNS { - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - export interface BenchmarkMetadata { - - /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ - average?: string | null; - } - - - /** A complex type that describes a program cycle. */ - export interface Cycle { - - /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ - cycleType?: string | null; - - /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - evaluationDate?: string | null; - - /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ - evaluationMonth?: string | null; - } - - - /** A complex type that defines a dimension key and metrics in a traffic report. */ - export interface Definition { - - /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The value the dimension or metric parameter as submitted in the request. */ - key?: string | null; - - /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ - localizedName?: string | null; - } - - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - export interface Dimension { - - /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ - dimensionKey?: string | null; - - /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ - name?: string | null; - - /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ - value?: string | null; - } - - - /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ - export interface DimensionMetric { - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - dimension?: Dimension; - - /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ - metrics?: Array; - } - - - /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ - export interface Metric { - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - benchmark?: MetricBenchmark; - - /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ - distributions?: Array; - - /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ - metricKey?: string | null; - - /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ - value?: string | null; - } - - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - export interface MetricBenchmark { - - /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ - adjustment?: string | null; - - /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ - basis?: string | null; - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - metadata?: BenchmarkMetadata; - - /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ - rating?: string | null; - } - - - /** This complex data type describes the metric distribution by basis. */ - export interface MetricDistribution { - - /** This field returns the basis, or the method, by which the metric rating is calculated. */ - basis?: string | null; - - /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ - data?: Array; - } - - - /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ - export interface Distribution { - - /** The name of a distribution in which the seller is active. */ - name?: string | null; - - /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ - value?: string | null; - } - - - /** Type that defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ - category?: string | null; - - /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error than given in the message error field. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** If present, indicates which subsystem in which the error occurred. */ - subdomain?: string | null; - } - - - /** A complex type that defines an error and error message. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - export interface EvaluationCycle { - - /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - endDate?: string | null; - - /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ - evaluationDate?: string | null; - - /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ - evaluationType?: string | null; - - /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - startDate?: string | null; - } - - - /** The response container for a list of seller profiles. */ - export interface FindSellerStandardsProfilesResponse { - - /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ - standardsProfiles?: Array; - } - - - /** A complex type that defines a seller profile. */ - export interface StandardsProfile { - - /** A complex type that describes a program cycle. */ - cycle?: Cycle; - - /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ - defaultProgram?: boolean | null; - - /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ - evaluationReason?: string | null; - - /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ - metrics?: Array; - - /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ - program?: string | null; - - /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ - standardsLevel?: string | null; - } - - - /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ - export interface GetCustomerServiceMetricResponse { - - /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ - dimensionMetrics?: Array; - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - evaluationCycle?: EvaluationCycle; - - /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - export interface Header { - - /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ - dimensionKeys?: Array; - - /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ - metrics?: Array; - } - - - /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ - export interface Metadata { - - /** Type that defines the metadata header fields. */ - metadataHeader?: MetadataHeader; - - /** A list of the individual report records. */ - metadataRecords?: Array; - } - - - /** Type that defines the metadata header fields. */ - export interface MetadataHeader { - - /** The key value used for the report. For example: "key": "LISTING_ID" */ - key?: string | null; - - /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ - metadataKeys?: Array; - } - - - /** A complex type that defines the data records returned in the report. */ - export interface MetadataRecord { - - /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ - metadataValues?: Array; - - /** A complex type that contains a value, plus the veracity of that value. */ - value?: Value; - } - - - /** A complex type that contains a value, plus the veracity of that value. */ - export interface Value { - - /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ - applicable?: boolean | null; - - /** The value of the report data. */ - value?: string | null; - } - - - /** Type that defines the fields of the individual record of the report. */ - export interface Record { - - /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ - dimensionValues?: Array; - - /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ - metricValues?: Array; - } - - - /** The complex type that defines that defines the report. */ - export interface Report { - - /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ - dimensionMetadata?: Array; - - /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - endDate?: string | null; - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - header?: Header; - - /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ - lastUpdatedDate?: string | null; - - /** A complex type containing the individual data records for the traffic report. */ - records?: Array; - - /** The start date of the date range used to calculate the report, in ISO 8601 format. */ - startDate?: string | null; - - /** An array of any process errors or warnings that were generated during the processing of the call processing. */ - warnings?: Array; - } - - export class Customer_service_metricClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. - * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} - * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED - * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html - * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. - * @return {GetCustomerServiceMetricResponse} Success - */ - GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string, callback: (data : GetCustomerServiceMetricResponse) => any) { - this.httpClient.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), callback, this.error, this.statusCode); - } - } - - export class Seller_standards_profileClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. - * Get seller_standards_profile - * @return {FindSellerStandardsProfilesResponse} Success - */ - FindSellerStandardsProfiles(callback: (data : FindSellerStandardsProfilesResponse) => any) { - this.httpClient.get(this.baseUri + 'seller_standards_profile', callback, this.error, this.statusCode); - } - - /** - * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. - * Get seller_standards_profile/{program}/{cycle} - * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. - * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. - * @return {StandardsProfile} Success - */ - GetSellerStandardsProfile(cycle: string, program: string, callback: (data : StandardsProfile) => any) { - this.httpClient.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), callback, this.error, this.statusCode); - } - } - - export class Traffic_reportClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. - * Get traffic_report - * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. - * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html - * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count - * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html - * @return {Report} Success - */ - GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined, callback: (data : Report) => any) { - this.httpClient.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + export interface BenchmarkMetadata { + + /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ + average?: string | null; + } + + + /** A complex type that describes a program cycle. */ + export interface Cycle { + + /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ + cycleType?: string | null; + + /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + evaluationDate?: string | null; + + /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ + evaluationMonth?: string | null; + } + + + /** A complex type that defines a dimension key and metrics in a traffic report. */ + export interface Definition { + + /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The value the dimension or metric parameter as submitted in the request. */ + key?: string | null; + + /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ + localizedName?: string | null; + } + + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + export interface Dimension { + + /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ + dimensionKey?: string | null; + + /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ + name?: string | null; + + /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ + value?: string | null; + } + + + /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ + export interface DimensionMetric { + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + dimension?: Dimension; + + /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ + metrics?: Array; + } + + + /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ + export interface Metric { + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + benchmark?: MetricBenchmark; + + /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ + distributions?: Array; + + /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ + metricKey?: string | null; + + /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ + value?: string | null; + } + + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + export interface MetricBenchmark { + + /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ + adjustment?: string | null; + + /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ + basis?: string | null; + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + metadata?: BenchmarkMetadata; + + /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ + rating?: string | null; + } + + + /** This complex data type describes the metric distribution by basis. */ + export interface MetricDistribution { + + /** This field returns the basis, or the method, by which the metric rating is calculated. */ + basis?: string | null; + + /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ + data?: Array; + } + + + /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ + export interface Distribution { + + /** The name of a distribution in which the seller is active. */ + name?: string | null; + + /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ + value?: string | null; + } + + + /** Type that defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ + category?: string | null; + + /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error than given in the message error field. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** If present, indicates which subsystem in which the error occurred. */ + subdomain?: string | null; + } + + + /** A complex type that defines an error and error message. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + export interface EvaluationCycle { + + /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + endDate?: string | null; + + /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ + evaluationDate?: string | null; + + /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ + evaluationType?: string | null; + + /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + startDate?: string | null; + } + + + /** The response container for a list of seller profiles. */ + export interface FindSellerStandardsProfilesResponse { + + /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ + standardsProfiles?: Array; + } + + + /** A complex type that defines a seller profile. */ + export interface StandardsProfile { + + /** A complex type that describes a program cycle. */ + cycle?: Cycle; + + /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ + defaultProgram?: boolean | null; + + /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ + evaluationReason?: string | null; + + /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ + metrics?: Array; + + /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ + program?: string | null; + + /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ + standardsLevel?: string | null; + } + + + /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ + export interface GetCustomerServiceMetricResponse { + + /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ + dimensionMetrics?: Array; + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + evaluationCycle?: EvaluationCycle; + + /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + export interface Header { + + /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ + dimensionKeys?: Array; + + /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ + metrics?: Array; + } + + + /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ + export interface Metadata { + + /** Type that defines the metadata header fields. */ + metadataHeader?: MetadataHeader; + + /** A list of the individual report records. */ + metadataRecords?: Array; + } + + + /** Type that defines the metadata header fields. */ + export interface MetadataHeader { + + /** The key value used for the report. For example: "key": "LISTING_ID" */ + key?: string | null; + + /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ + metadataKeys?: Array; + } + + + /** A complex type that defines the data records returned in the report. */ + export interface MetadataRecord { + + /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ + metadataValues?: Array; + + /** A complex type that contains a value, plus the veracity of that value. */ + value?: Value; + } + + + /** A complex type that contains a value, plus the veracity of that value. */ + export interface Value { + + /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ + applicable?: boolean | null; + + /** The value of the report data. */ + value?: string | null; + } + + + /** Type that defines the fields of the individual record of the report. */ + export interface Record { + + /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ + dimensionValues?: Array; + + /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ + metricValues?: Array; + } + + + /** The complex type that defines that defines the report. */ + export interface Report { + + /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ + dimensionMetadata?: Array; + + /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + endDate?: string | null; + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + header?: Header; + + /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ + lastUpdatedDate?: string | null; + + /** A complex type containing the individual data records for the traffic report. */ + records?: Array; + + /** The start date of the date range used to calculate the report, in ISO 8601 format. */ + startDate?: string | null; + + /** An array of any process errors or warnings that were generated during the processing of the call processing. */ + warnings?: Array; + } + + export class Customer_service_metricClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. + * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} + * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED + * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html + * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. + * @return {GetCustomerServiceMetricResponse} Success + */ + GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string, callback: (data : GetCustomerServiceMetricResponse) => any) { + this.httpClient.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), callback, this.error, this.statusCode); + } + } + + export class Seller_standards_profileClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. + * Get seller_standards_profile + * @return {FindSellerStandardsProfilesResponse} Success + */ + FindSellerStandardsProfiles(callback: (data : FindSellerStandardsProfilesResponse) => any) { + this.httpClient.get(this.baseUri + 'seller_standards_profile', callback, this.error, this.statusCode); + } + + /** + * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. + * Get seller_standards_profile/{program}/{cycle} + * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. + * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. + * @return {StandardsProfile} Success + */ + GetSellerStandardsProfile(cycle: string, program: string, callback: (data : StandardsProfile) => any) { + this.httpClient.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), callback, this.error, this.statusCode); + } + } + + export class Traffic_reportClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. + * Get traffic_report + * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. + * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html + * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count + * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html + * @return {Report} Success + */ + GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined, callback: (data : Report) => any) { + this.httpClient.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_compliance.txt b/Tests/SwagTsTests/JqResults/sell_compliance.ts similarity index 99% rename from Tests/SwagTsTests/JqResults/sell_compliance.txt rename to Tests/SwagTsTests/JqResults/sell_compliance.ts index 79fbbda1..1a963971 100644 --- a/Tests/SwagTsTests/JqResults/sell_compliance.txt +++ b/Tests/SwagTsTests/JqResults/sell_compliance.ts @@ -1,258 +1,258 @@ -/// -export namespace MyNS { - - /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ - export interface AspectRecommendations { - - /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ - localizedAspectName?: string | null; - - /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ - suggestedValues?: Array; - } - - - /** This type is used by each listing violation that is returned under the violations container. */ - export interface ComplianceDetail { - - /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ - reasonCode?: string | null; - - /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ - message?: string | null; - - /** This type is used to identify the product variation that has the listing violation. */ - variation?: VariationDetails; - - /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ - violationData?: Array; - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - correctiveRecommendations?: CorrectiveRecommendations; - - /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ - complianceState?: string | null; - } - - - /** This type is used to identify the product variation that has the listing violation. */ - export interface VariationDetails { - - /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ - sku?: string | null; - - /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ - variationAspects?: Array; - } - - - /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ - export interface NameValueList { - - /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - name?: string | null; - - /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - value?: string | null; - } - - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - export interface CorrectiveRecommendations { - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - productRecommendation?: ProductRecommendation; - - /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ - aspectRecommendations?: Array; - } - - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - export interface ProductRecommendation { - - /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ - epid?: string | null; - } - - - /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ - export interface ComplianceSummary { - - /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ - violationSummaries?: Array; - } - - - /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ - export interface ComplianceSummaryInfo { - - /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - listingCount?: number | null; - } - - - /** This type is used by each listing violation that is returned under the listingViolations container. */ - export interface ComplianceViolation { - - /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ - listingId?: string | null; - - /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ - sku?: string | null; - - /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ - offerId?: string | null; - - /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ - violations?: Array; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is the base response type of the getListingViolations method. */ - export interface PagedComplianceViolationCollection { - - /** - * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI of the getListingViolations call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ - next?: string | null; - - /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ - prev?: string | null; - - /** - * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ - listingViolations?: Array; - } - - - /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ - export interface SuppressViolationRequest { - - /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ - listingId?: string | null; - } - - export class Listing_violation_summaryClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * Get listing_violation_summary - * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * @return {void} Success - */ - GetListingViolationsSummary(compliance_type: string | null | undefined, callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), callback, this.error, this.statusCode); - } - } - - export class Listing_violationClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. - * Get listing_violation - * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. - * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) - * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. - * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 - * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} - * @return {void} Success - */ - GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined, callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - - /** - * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. - * Post suppress_listing_violation - * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. - * @return {void} - */ - SuppressViolation(callback: (data : void) => any, requestBody: SuppressViolationRequest) { - this.httpClient.post(this.baseUri + 'suppress_listing_violation', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - -} - +/// +export namespace MyNS { + + /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ + export interface AspectRecommendations { + + /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ + localizedAspectName?: string | null; + + /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ + suggestedValues?: Array; + } + + + /** This type is used by each listing violation that is returned under the violations container. */ + export interface ComplianceDetail { + + /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ + reasonCode?: string | null; + + /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ + message?: string | null; + + /** This type is used to identify the product variation that has the listing violation. */ + variation?: VariationDetails; + + /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ + violationData?: Array; + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + correctiveRecommendations?: CorrectiveRecommendations; + + /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ + complianceState?: string | null; + } + + + /** This type is used to identify the product variation that has the listing violation. */ + export interface VariationDetails { + + /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ + sku?: string | null; + + /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ + variationAspects?: Array; + } + + + /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ + export interface NameValueList { + + /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + name?: string | null; + + /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + value?: string | null; + } + + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + export interface CorrectiveRecommendations { + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + productRecommendation?: ProductRecommendation; + + /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ + aspectRecommendations?: Array; + } + + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + export interface ProductRecommendation { + + /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ + epid?: string | null; + } + + + /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ + export interface ComplianceSummary { + + /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ + violationSummaries?: Array; + } + + + /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ + export interface ComplianceSummaryInfo { + + /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + listingCount?: number | null; + } + + + /** This type is used by each listing violation that is returned under the listingViolations container. */ + export interface ComplianceViolation { + + /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ + listingId?: string | null; + + /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ + sku?: string | null; + + /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ + offerId?: string | null; + + /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ + violations?: Array; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is the base response type of the getListingViolations method. */ + export interface PagedComplianceViolationCollection { + + /** + * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI of the getListingViolations call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ + next?: string | null; + + /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ + prev?: string | null; + + /** + * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ + listingViolations?: Array; + } + + + /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ + export interface SuppressViolationRequest { + + /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ + listingId?: string | null; + } + + export class Listing_violation_summaryClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * Get listing_violation_summary + * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * @return {void} Success + */ + GetListingViolationsSummary(compliance_type: string | null | undefined, callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), callback, this.error, this.statusCode); + } + } + + export class Listing_violationClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. + * Get listing_violation + * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. + * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) + * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. + * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 + * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} + * @return {void} Success + */ + GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined, callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + + /** + * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. + * Post suppress_listing_violation + * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. + * @return {void} + */ + SuppressViolation(callback: (data : void) => any, requestBody: SuppressViolationRequest) { + this.httpClient.post(this.baseUri + 'suppress_listing_violation', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_finances.txt b/Tests/SwagTsTests/JqResults/sell_finances.ts similarity index 99% rename from Tests/SwagTsTests/JqResults/sell_finances.txt rename to Tests/SwagTsTests/JqResults/sell_finances.ts index 5ad64637..15184f85 100644 --- a/Tests/SwagTsTests/JqResults/sell_finances.txt +++ b/Tests/SwagTsTests/JqResults/sell_finances.ts @@ -1,400 +1,400 @@ -/// -export namespace MyNS { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - export interface Amount { - - /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ - value?: string | null; - } - - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - export interface Buyer { - - /** The eBay user ID of the order's buyer. */ - username?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ - export interface Payout { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ - payoutDate?: string | null; - - /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ - payoutId?: string | null; - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - payoutInstrument?: PayoutInstrument; - - /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ - payoutStatus?: string | null; - - /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ - payoutStatusDescription?: string | null; - - /** - * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - export interface PayoutInstrument { - - /** This string value is the last four digits of the seller's account number. */ - accountLastFourDigits?: string | null; - - /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ - instrumentType?: string | null; - - /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ - nickname?: string | null; - } - - - /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ - export interface PayoutSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** - * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - payoutCount?: number | null; - - /** - * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ - export interface Payouts { - - /** The URI of the getPayouts call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ - payouts?: Array; - - /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ - export interface SellerFundsSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - availableFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - fundsOnHold?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - processingFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - totalFunds?: Amount; - } - - - /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ - export interface Transaction { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ - bookingEntry?: string | null; - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - buyer?: Buyer; - - /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ - orderId?: string | null; - - /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ - payoutId?: string | null; - - /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ - salesRecordReference?: string | null; - - /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ - transactionDate?: string | null; - - /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ - transactionId?: string | null; - - /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ - transactionMemo?: string | null; - - /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ - transactionStatus?: string | null; - - /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ - transactionType?: string | null; - } - - - /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ - export interface TransactionSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - creditAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ - creditBookingEntry?: string | null; - - /** - * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - creditCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - disputeAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ - disputeBookingEntry?: string | null; - - /** - * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - disputeCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - onHoldAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ - onHoldBookingEntry?: string | null; - - /** - * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - onHoldCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - refundAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ - refundBookingEntry?: string | null; - - /** - * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - refundCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - shippingLabelAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ - shippingLabelBookingEntry?: string | null; - - /** - * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - shippingLabelCount?: number | null; - } - - - /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ - export interface Transactions { - - /** The URI of the getTransactions method request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ - transactions?: Array; - } - - export class PayoutClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. - * Get payout/{payout_Id} - * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. - * @return {Payout} Success - */ - GetPayout(payout_Id: string, callback: (data : Payout) => any) { - this.httpClient.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), callback, this.error, this.statusCode); - } - - /** - * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. - * Get payout - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) - * @return {Payouts} Success - */ - GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : Payouts) => any) { - this.httpClient.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); - } - - /** - * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. - * Get payout_summary - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {PayoutSummaryResponse} Success - */ - GetPayoutSummary(filter: string | null | undefined, callback: (data : PayoutSummaryResponse) => any) { - this.httpClient.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - } - - export class TransactionClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. - * Get transaction - * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * @return {Transactions} Success - */ - GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : Transactions) => any) { - this.httpClient.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); - } - - /** - * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). - * Get transaction_summary - * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {TransactionSummaryResponse} Success - */ - GetTransactionSummary(filter: string | null | undefined, callback: (data : TransactionSummaryResponse) => any) { - this.httpClient.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - } - - export class Seller_funds_summaryClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. - * Get seller_funds_summary - * @return {SellerFundsSummaryResponse} Success - */ - GetSellerFundsSummary(callback: (data : SellerFundsSummaryResponse) => any) { - this.httpClient.get(this.baseUri + 'seller_funds_summary', callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + export interface Amount { + + /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ + value?: string | null; + } + + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + export interface Buyer { + + /** The eBay user ID of the order's buyer. */ + username?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ + export interface Payout { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ + payoutDate?: string | null; + + /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ + payoutId?: string | null; + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + payoutInstrument?: PayoutInstrument; + + /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ + payoutStatus?: string | null; + + /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ + payoutStatusDescription?: string | null; + + /** + * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + export interface PayoutInstrument { + + /** This string value is the last four digits of the seller's account number. */ + accountLastFourDigits?: string | null; + + /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ + instrumentType?: string | null; + + /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ + nickname?: string | null; + } + + + /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ + export interface PayoutSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** + * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + payoutCount?: number | null; + + /** + * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ + export interface Payouts { + + /** The URI of the getPayouts call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ + payouts?: Array; + + /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ + export interface SellerFundsSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + availableFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + fundsOnHold?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + processingFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + totalFunds?: Amount; + } + + + /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ + export interface Transaction { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ + bookingEntry?: string | null; + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + buyer?: Buyer; + + /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ + orderId?: string | null; + + /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ + payoutId?: string | null; + + /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ + salesRecordReference?: string | null; + + /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ + transactionDate?: string | null; + + /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ + transactionId?: string | null; + + /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ + transactionMemo?: string | null; + + /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ + transactionStatus?: string | null; + + /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ + transactionType?: string | null; + } + + + /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ + export interface TransactionSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + creditAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ + creditBookingEntry?: string | null; + + /** + * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + creditCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + disputeAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ + disputeBookingEntry?: string | null; + + /** + * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + disputeCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + onHoldAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ + onHoldBookingEntry?: string | null; + + /** + * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + onHoldCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + refundAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ + refundBookingEntry?: string | null; + + /** + * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + refundCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + shippingLabelAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ + shippingLabelBookingEntry?: string | null; + + /** + * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + shippingLabelCount?: number | null; + } + + + /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ + export interface Transactions { + + /** The URI of the getTransactions method request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ + transactions?: Array; + } + + export class PayoutClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. + * Get payout/{payout_Id} + * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. + * @return {Payout} Success + */ + GetPayout(payout_Id: string, callback: (data : Payout) => any) { + this.httpClient.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), callback, this.error, this.statusCode); + } + + /** + * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. + * Get payout + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) + * @return {Payouts} Success + */ + GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : Payouts) => any) { + this.httpClient.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); + } + + /** + * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. + * Get payout_summary + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {PayoutSummaryResponse} Success + */ + GetPayoutSummary(filter: string | null | undefined, callback: (data : PayoutSummaryResponse) => any) { + this.httpClient.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + } + + export class TransactionClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. + * Get transaction + * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * @return {Transactions} Success + */ + GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : Transactions) => any) { + this.httpClient.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); + } + + /** + * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). + * Get transaction_summary + * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {TransactionSummaryResponse} Success + */ + GetTransactionSummary(filter: string | null | undefined, callback: (data : TransactionSummaryResponse) => any) { + this.httpClient.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + } + + export class Seller_funds_summaryClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. + * Get seller_funds_summary + * @return {SellerFundsSummaryResponse} Success + */ + GetSellerFundsSummary(callback: (data : SellerFundsSummaryResponse) => any) { + this.httpClient.get(this.baseUri + 'seller_funds_summary', callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_inventory.txt b/Tests/SwagTsTests/JqResults/sell_inventory.ts similarity index 99% rename from Tests/SwagTsTests/JqResults/sell_inventory.txt rename to Tests/SwagTsTests/JqResults/sell_inventory.ts index 4ced059d..92c86d45 100644 --- a/Tests/SwagTsTests/JqResults/sell_inventory.txt +++ b/Tests/SwagTsTests/JqResults/sell_inventory.ts @@ -1,1847 +1,1847 @@ -/// -export namespace MyNS { - - /** This type is used to define the physical address of an inventory location. */ - export interface Address { - - /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine1?: string | null; - - /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine2?: string | null; - - /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ - city?: string | null; - - /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ - country?: string | null; - - /** The county in which the address resides. This field is returned if defined for an inventory location. */ - county?: string | null; - - /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ - postalCode?: string | null; - - /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ - stateOrProvince?: string | null; - } - - - /** This type is used to express a dollar value and the applicable currency. */ - export interface Amount { - - /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ - currency?: string | null; - - /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ - value?: string | null; - } - - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - export interface Availability { - - /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - pickupAtLocationAvailability?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - } - - - /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ - export interface PickupAtLocationAvailability { - - /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ - availabilityType?: string | null; - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - fulfillmentTime?: TimeDuration; - - /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ - merchantLocationKey?: string | null; - - /** - * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - export interface TimeDuration { - - /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - export interface ShipToLocationAvailability { - - /** - * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ - export interface BaseResponse { - - /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ - warnings?: Array; - } - - - /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ - export interface Error { - - /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ - category?: string | null; - - /** The name of the domain in which the error or warning occurred. */ - domain?: string | null; - - /** - * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ - longMessage?: string | null; - - /** A description of the condition that caused the error or warning. */ - message?: string | null; - - /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ - outputRefIds?: Array; - - /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. */ - subdomain?: string | null; - } - - - /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ - export interface ErrorParameter { - - /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ - name?: string | null; - - /** This is the actual value that was passed in for the element specified in the name field. */ - value?: string | null; - } - - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - export interface BestOffer { - - /** This type is used to express a dollar value and the applicable currency. */ - autoAcceptPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - autoDeclinePrice?: Amount; - - /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ - bestOfferEnabled?: boolean | null; - } - - - /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ - export interface BulkEbayOfferDetailsWithKeys { - - /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ - requests?: Array; - } - - - /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ - export interface EbayOfferDetailsWithKeys { - - /** - * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - - /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ - donationPercentage?: string | null; - } - - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - export interface ListingPolicies { - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - bestOfferTerms?: BestOffer; - - /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - eBayPlusIfEligible?: boolean | null; - - /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - fulfillmentPolicyId?: string | null; - - /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - paymentPolicyId?: string | null; - - /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - returnPolicyId?: string | null; - - /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ - shippingCostOverrides?: Array; - } - - - /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ - export interface ShippingCostOverride { - - /** This type is used to express a dollar value and the applicable currency. */ - additionalShippingCost?: Amount; - - /** - * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - priority?: number | null; - - /** This type is used to express a dollar value and the applicable currency. */ - shippingCost?: Amount; - - /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ - shippingServiceType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - surcharge?: Amount; - } - - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - export interface PricingSummary { - - /** This type is used to express a dollar value and the applicable currency. */ - minimumAdvertisedPrice?: Amount; - - /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - originallySoldForRetailPriceOn?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - originalRetailPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - - /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - pricingVisibility?: string | null; - } - - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - export interface Tax { - - /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ - applyTax?: boolean | null; - - /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ - thirdPartyTaxCategory?: string | null; - - /** - * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. - * Type: double - */ - vatPercentage?: number | null; - } - - - /** This type is used by the base request of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItem { - - /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ - requests?: Array; - } - - - /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ - export interface GetInventoryItem { - - /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemResponse { - - /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ - export interface GetInventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ - errors?: Array; - - /** This type is used to provide details about each retrieved inventory item record. */ - inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ - warnings?: Array; - } - - - /** This type is used to provide details about each retrieved inventory item record. */ - export interface InventoryItemWithSkuLocaleGroupKeys { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface PackageWeightAndSize { - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - dimensions?: Dimension; - - /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ - packageType?: string | null; - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - weight?: Weight; - } - - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Dimension { - - /** - * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - height?: number | null; - - /** - * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - length?: number | null; - - /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - width?: number | null; - } - - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Weight { - - /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } - * Type: double - */ - value?: number | null; - } - - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - export interface Product { - - /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ - aspects?: Array; - - /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ - brand?: string | null; - - /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ - description?: string | null; - - /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ - ean?: Array; - - /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ - epid?: string | null; - - /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ - imageUrls?: Array; - - /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ - isbn?: Array; - - /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ - mpn?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ - title?: string | null; - - /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ - upc?: Array; - } - - - /** The base request of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItem { - - /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ - requests?: Array; - } - - - /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ - export interface InventoryItemWithSkuLocale { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemResponse { - - /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ - export interface InventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ - errors?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base container of the bulkMigrateListings request payload. */ - export interface BulkMigrateListing { - - /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ - requests?: Array; - } - - - /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ - export interface MigrateListing { - - /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ - listingId?: string | null; - } - - - /** This type is used by the response payload of the bulkMigrateListings call. */ - export interface BulkMigrateListingResponse { - - /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ - responses?: Array; - } - - - /** This type is used to display the results of each listing that the seller attempted to migrate. */ - export interface MigrateListingResponse { - - /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ - errors?: Array; - - /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ - inventoryItemGroupKey?: string | null; - - /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ - inventoryItems?: Array; - - /** The unique identifier of the eBay listing that the seller attempted to migrate. */ - listingId?: string | null; - - /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ - warnings?: Array; - } - - - /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ - export interface InventoryItemListing { - - /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ - offerId?: string | null; - - /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ - sku?: string | null; - } - - - /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ - export interface BulkOffer { - - /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ - requests?: Array; - } - - - /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ - export interface OfferKeyWithId { - - /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ - offerId?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOffer method. */ - export interface BulkOfferResponse { - - /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ - export interface OfferSkuResponse { - - /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ - errors?: Array; - - /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ - offerId?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ - sku?: string | null; - - /** - * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ - warnings?: Array; - } - - - /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - export interface BulkPriceQuantity { - - /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - requests?: Array; - } - - - /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ - export interface PriceQuantity { - - /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ - offers?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - - /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ - export interface OfferPriceQuantity { - - /** - * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ - offerId?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - } - - - /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - export interface BulkPriceQuantityResponse { - - /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - responses?: Array; - } - - - /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ - export interface PriceQuantityResponse { - - /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ - errors?: Array; - - /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ - offerId?: string | null; - - /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ - sku?: string | null; - - /** - * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base response of the bulkPublishOffer method. */ - export interface BulkPublishResponse { - - /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ - responses?: Array; - } - - - /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ - export interface OfferResponseWithListingId { - - /** This container will be returned if there were one or more errors associated with publishing the offer. */ - errors?: Array; - - /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ - listingId?: string | null; - - /** The unique identifier of the offer that the seller published (or attempted to publish). */ - offerId?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with publishing the offer. */ - warnings?: Array; - } - - - /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ - export interface Compatibility { - - /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ - compatibleProducts?: Array; - - /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ - sku?: string | null; - } - - - /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ - export interface CompatibleProduct { - - /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ - compatibilityProperties?: Array; - - /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ - notes?: string | null; - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - productFamilyProperties?: ProductFamilyProperties; - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - productIdentifier?: ProductIdentifier; - } - - - /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ - export interface NameValueList { - - /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ - name?: string | null; - - /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ - value?: string | null; - } - - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - export interface ProductFamilyProperties { - - /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ - engine?: string | null; - - /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ - make?: string | null; - - /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ - model?: string | null; - - /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ - trim?: string | null; - - /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ - year?: string | null; - } - - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - export interface ProductIdentifier { - - /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ - epid?: string | null; - - /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ - gtin?: string | null; - - /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ - ktype?: string | null; - } - - - /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ - export interface EbayOfferDetailsWithAll { - - /** - * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - listing?: ListingDetails; - - /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ - merchantLocationKey?: string | null; - - /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ - offerId?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ - sku?: string | null; - - /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - export interface ListingDetails { - - /** The unique identifier of the eBay listing that is associated with the published offer. */ - listingId?: string | null; - - /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ - listingStatus?: string | null; - - /** - * This integer value indicates the quantity of the product that has been sold for the published offer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - soldQuantity?: number | null; - } - - - /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ - export interface EbayOfferDetailsWithId { - - /** - * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ - export interface Fee { - - /** This type is used to express a dollar value and the applicable currency. */ - amount?: Amount; - - /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - feeType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - promotionalDiscount?: Amount; - } - - - /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ - export interface FeeSummary { - - /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - fees?: Array; - - /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response payload for the getListingFees call. */ - export interface FeesSummaryResponse { - - /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ - feeSummaries?: Array; - } - - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - export interface GeoCoordinates { - - /** - * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - longitude?: number | null; - } - - - /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ - export interface Interval { - - /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - close?: string | null; - - /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - open?: string | null; - } - - - /** This type is used to provide detailed information about an inventory item. */ - export interface InventoryItem { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - } - - - /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ - export interface InventoryItemGroup { - - /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ - aspects?: Array; - - /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ - description?: string | null; - - /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ - imageUrls?: Array; - - /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ - inventoryItemGroupKey?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ - title?: string | null; - - /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ - variantSKUs?: Array; - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - variesBy?: VariesBy; - } - - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - export interface VariesBy { - - /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ - aspectsImageVariesBy?: Array; - - /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ - specifications?: Array; - } - - - /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ - export interface Specification { - - /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ - name?: string | null; - - /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ - values?: Array; - } - - export interface InventoryItemWithSkuLocaleGroupid { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ - groupIds?: Array; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used by the base response payload of getInventoryItems call. */ - export interface InventoryItems { - - /** This is the URL to the current page of inventory items. */ - href?: string | null; - - /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ - inventoryItems?: Array; - - /** - * This integer value is the number of inventory items that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ - next?: string | null; - - /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ - prev?: string | null; - - /** - * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ - export interface InventoryLocation { - - /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ - locationInstructions?: string | null; - - /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ - locationWebUrl?: string | null; - - /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ - name?: string | null; - - /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ - operatingHours?: Array; - - /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ - phone?: string | null; - - /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ - specialHours?: Array; - } - - - /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ - export interface OperatingHours { - - /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ - dayOfWeekEnum?: string | null; - - /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ - intervals?: Array; - } - - - /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ - export interface SpecialHours { - - /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ - date?: string | null; - - /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ - intervals?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ - export interface InventoryLocationFull { - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - location?: LocationDetails; - - /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ - locationInstructions?: string | null; - - /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ - locationTypes?: Array; - - /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ - phone?: string | null; - - /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ - specialHours?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - export interface LocationDetails { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - } - - - /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ - export interface InventoryLocationResponse { - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - location?: Location; - - /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ - locationInstructions?: string | null; - - /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ - locationTypes?: Array; - - /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ - phone?: string | null; - - /** This container shows the special operating hours for a store location on a specific date or dates. */ - specialHours?: Array; - } - - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - export interface Location { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - - /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ - locationId?: string | null; - } - - - /** This type is used by the base response payload for the getInventoryLocations call. */ - export interface LocationResponse { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of one or more of the merchant's inventory locations. */ - locations?: Array; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the base request payload of the getListingFees call. */ - export interface OfferKeysWithId { - - /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ - offers?: Array; - } - - - /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ - export interface OfferResponse { - - /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ - offerId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ - export interface Offers { - - /** This is the URL to the current page of offers. */ - href?: string | null; - - /** - * This integer value is the number of offers that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ - next?: string | null; - - /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ - offers?: Array; - - /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ - prev?: string | null; - - /** - * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ - export interface PublishByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ - export interface PublishResponse { - - /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ - listingId?: string | null; - - /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ - warnings?: Array; - } - - - /** This type is used to show the version number and instance of the service or API. */ - export interface Version { - - /** This type is used to show the version number and instance of the service or API. */ - instance?: Version; - - /** The version number of the service or API. */ - version?: string | null; - } - - - /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ - export interface WithdrawByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** The base response of the withdrawOffer call. */ - export interface WithdrawResponse { - - /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ - listingId?: string | null; - - /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ - warnings?: Array; - } - - export class LocationClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 - * @return {InventoryLocationResponse} Success - */ - GetInventoryLocation(merchantLocationKey: string, callback: (data : InventoryLocationResponse) => any) { - this.httpClient.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), callback, this.error, this.statusCode); - } - - /** - * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 - * @param {InventoryLocationFull} requestBody Inventory Location details - * @return {void} - */ - CreateInventoryLocation(merchantLocationKey: string, callback: (data : void) => any, requestBody: InventoryLocationFull) { - this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. - * Delete location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 - * @return {void} - */ - DeleteInventoryLocation(merchantLocationKey: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), callback, this.error, this.statusCode); - } - - /** - * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/disable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 - * @return {string} Success - */ - DisableInventoryLocation(merchantLocationKey: string, callback: (data : string) => any) { - this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/enable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 - * @return {string} Success - */ - EnableInventoryLocation(merchantLocationKey: string, callback: (data : string) => any) { - this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 - * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {LocationResponse} Success - */ - GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined, callback: (data : LocationResponse) => any) { - this.httpClient.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); - } - - /** - * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey}/update_location_details - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 - * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). - * @return {void} - */ - UpdateInventoryLocation(merchantLocationKey: string, callback: (data : void) => any, requestBody: InventoryLocation) { - this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Inventory_itemClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Get inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. - * @return {InventoryItemWithSkuLocaleGroupid} Success - */ - GetInventoryItem(sku: string, callback: (data : InventoryItemWithSkuLocaleGroupid) => any) { - this.httpClient.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), callback, this.error, this.statusCode); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. - * Put inventory_item/{sku} - * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. - * @param {InventoryItem} requestBody Details of the inventory item record. - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItem(sku: string, callback: (data : BaseResponse) => any, requestBody: InventoryItem) { - this.httpClient.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Delete inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. - * @return {void} - */ - DeleteInventoryItem(sku: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), callback, this.error, this.statusCode); - } - - /** - * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. - * Get inventory_item - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {InventoryItems} Success - */ - GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined, callback: (data : InventoryItems) => any) { - this.httpClient.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); - } - - /** - * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Post bulk_update_price_quantity - * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace - * @return {BulkPriceQuantityResponse} Success - */ - BulkUpdatePriceQuantity(callback: (data : BulkPriceQuantityResponse) => any, requestBody: BulkPriceQuantity) { - this.httpClient.post(this.baseUri + 'bulk_update_price_quantity', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. - * Post bulk_create_or_replace_inventory_item - * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkInventoryItemResponse} Success - */ - BulkCreateOrReplaceInventoryItem(callback: (data : BulkInventoryItemResponse) => any, requestBody: BulkInventoryItem) { - this.httpClient.post(this.baseUri + 'bulk_create_or_replace_inventory_item', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Post bulk_get_inventory_item - * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkGetInventoryItemResponse} Success - */ - BulkGetInventoryItem(callback: (data : BulkGetInventoryItemResponse) => any, requestBody: BulkGetInventoryItem) { - this.httpClient.post(this.baseUri + 'bulk_get_inventory_item', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Product_compatibilityClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Get inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {Compatibility} Success - */ - GetProductCompatibility(sku: string, callback: (data : Compatibility) => any) { - this.httpClient.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', callback, this.error, this.statusCode); - } - - /** - * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @param {Compatibility} requestBody Details of the compatibility - * @return {BaseResponse} Success - */ - CreateOrReplaceProductCompatibility(sku: string, callback: (data : BaseResponse) => any, requestBody: Compatibility) { - this.httpClient.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Delete inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {void} - */ - DeleteProductCompatibility(sku: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', callback, this.error, this.statusCode); - } - } - - export class OfferClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer - * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. - * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. - * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {Offers} Success - */ - GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : Offers) => any) { - this.httpClient.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); - } - - /** - * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. - * Post offer - * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {void} - */ - CreateOffer(callback: (data : void) => any, requestBody: EbayOfferDetailsWithKeys) { - this.httpClient.post(this.baseUri + 'offer', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is to be retrieved. - * @return {EbayOfferDetailsWithAll} Success - */ - GetOffer(offerId: string, callback: (data : EbayOfferDetailsWithAll) => any) { - this.httpClient.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), callback, this.error, this.statusCode); - } - - /** - * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. - * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel - * @return {OfferResponse} Success - */ - UpdateOffer(offerId: string, callback: (data : OfferResponse) => any, requestBody: EbayOfferDetailsWithId) { - this.httpClient.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. - * Delete offer/{offerId} - * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. - * @return {void} - */ - DeleteOffer(offerId: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), callback, this.error, this.statusCode); - } - - /** - * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post offer/{offerId}/publish/ - * @param {string} offerId The unique identifier of the offer that is to be published. - * @return {PublishResponse} Success - */ - PublishOffer(offerId: string, callback: (data : PublishResponse) => any) { - this.httpClient.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. - * Post offer/publish_by_inventory_item_group/ - * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. - * @return {PublishResponse} Success - */ - PublishOfferByInventoryItemGroup(callback: (data : PublishResponse) => any, requestBody: PublishByInventoryItemGroupRequest) { - this.httpClient.post(this.baseUri + 'offer/publish_by_inventory_item_group/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. - * Post offer/withdraw_by_inventory_item_group - * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. - * @return {void} - */ - WithdrawOfferByInventoryItemGroup(callback: (data : void) => any, requestBody: WithdrawByInventoryItemGroupRequest) { - this.httpClient.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. - * Post offer/get_listing_fees - * @param {OfferKeysWithId} requestBody List of offers that needs fee information - * @return {FeesSummaryResponse} Success - */ - GetListingFees(callback: (data : FeesSummaryResponse) => any, requestBody: OfferKeysWithId) { - this.httpClient.post(this.baseUri + 'offer/get_listing_fees', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. - * Post bulk_create_offer - * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {BulkOfferResponse} Success - */ - BulkCreateOffer(callback: (data : BulkOfferResponse) => any, requestBody: BulkEbayOfferDetailsWithKeys) { - this.httpClient.post(this.baseUri + 'bulk_create_offer', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post bulk_publish_offer - * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. - * @return {BulkPublishResponse} Success - */ - BulkPublishOffer(callback: (data : BulkPublishResponse) => any, requestBody: BulkOffer) { - this.httpClient.post(this.baseUri + 'bulk_publish_offer', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. - * Post offer/{offerId}/withdraw - * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. - * @return {WithdrawResponse} Success - */ - WithdrawOffer(offerId: string, callback: (data : WithdrawResponse) => any) { - this.httpClient.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Inventory_item_groupClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. - * Get inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. - * @return {InventoryItemGroup} Success - */ - GetInventoryItemGroup(inventoryItemGroupKey: string, callback: (data : InventoryItemGroup) => any) { - this.httpClient.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), callback, this.error, this.statusCode); - } - - /** - * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. - * @param {InventoryItemGroup} requestBody Details of the inventory Item Group - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, callback: (data : BaseResponse) => any, requestBody: InventoryItemGroup) { - this.httpClient.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call deletes the inventory item group for a given inventoryItemGroupKey value. - * Delete inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. - * @return {void} - */ - DeleteInventoryItemGroup(inventoryItemGroupKey: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), callback, this.error, this.statusCode); - } - } - - export class ListingClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. - * Post bulk_migrate_listing - * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory - * @return {BulkMigrateListingResponse} Success - */ - BulkMigrateListing(callback: (data : BulkMigrateListingResponse) => any, requestBody: BulkMigrateListing) { - this.httpClient.post(this.baseUri + 'bulk_migrate_listing', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - -} - +/// +export namespace MyNS { + + /** This type is used to define the physical address of an inventory location. */ + export interface Address { + + /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine1?: string | null; + + /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine2?: string | null; + + /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ + city?: string | null; + + /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ + country?: string | null; + + /** The county in which the address resides. This field is returned if defined for an inventory location. */ + county?: string | null; + + /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ + postalCode?: string | null; + + /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ + stateOrProvince?: string | null; + } + + + /** This type is used to express a dollar value and the applicable currency. */ + export interface Amount { + + /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ + currency?: string | null; + + /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ + value?: string | null; + } + + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + export interface Availability { + + /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + pickupAtLocationAvailability?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + } + + + /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ + export interface PickupAtLocationAvailability { + + /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ + availabilityType?: string | null; + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + fulfillmentTime?: TimeDuration; + + /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ + merchantLocationKey?: string | null; + + /** + * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + export interface TimeDuration { + + /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + export interface ShipToLocationAvailability { + + /** + * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ + export interface BaseResponse { + + /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ + warnings?: Array; + } + + + /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ + export interface Error { + + /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ + category?: string | null; + + /** The name of the domain in which the error or warning occurred. */ + domain?: string | null; + + /** + * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ + longMessage?: string | null; + + /** A description of the condition that caused the error or warning. */ + message?: string | null; + + /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ + outputRefIds?: Array; + + /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. */ + subdomain?: string | null; + } + + + /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ + export interface ErrorParameter { + + /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ + name?: string | null; + + /** This is the actual value that was passed in for the element specified in the name field. */ + value?: string | null; + } + + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + export interface BestOffer { + + /** This type is used to express a dollar value and the applicable currency. */ + autoAcceptPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + autoDeclinePrice?: Amount; + + /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ + bestOfferEnabled?: boolean | null; + } + + + /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ + export interface BulkEbayOfferDetailsWithKeys { + + /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ + requests?: Array; + } + + + /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ + export interface EbayOfferDetailsWithKeys { + + /** + * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + + /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ + donationPercentage?: string | null; + } + + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + export interface ListingPolicies { + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + bestOfferTerms?: BestOffer; + + /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + eBayPlusIfEligible?: boolean | null; + + /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + fulfillmentPolicyId?: string | null; + + /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + paymentPolicyId?: string | null; + + /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + returnPolicyId?: string | null; + + /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ + shippingCostOverrides?: Array; + } + + + /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ + export interface ShippingCostOverride { + + /** This type is used to express a dollar value and the applicable currency. */ + additionalShippingCost?: Amount; + + /** + * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + priority?: number | null; + + /** This type is used to express a dollar value and the applicable currency. */ + shippingCost?: Amount; + + /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ + shippingServiceType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + surcharge?: Amount; + } + + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + export interface PricingSummary { + + /** This type is used to express a dollar value and the applicable currency. */ + minimumAdvertisedPrice?: Amount; + + /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + originallySoldForRetailPriceOn?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + originalRetailPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + + /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + pricingVisibility?: string | null; + } + + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + export interface Tax { + + /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ + applyTax?: boolean | null; + + /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ + thirdPartyTaxCategory?: string | null; + + /** + * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. + * Type: double + */ + vatPercentage?: number | null; + } + + + /** This type is used by the base request of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItem { + + /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ + requests?: Array; + } + + + /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ + export interface GetInventoryItem { + + /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemResponse { + + /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ + export interface GetInventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ + errors?: Array; + + /** This type is used to provide details about each retrieved inventory item record. */ + inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ + warnings?: Array; + } + + + /** This type is used to provide details about each retrieved inventory item record. */ + export interface InventoryItemWithSkuLocaleGroupKeys { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface PackageWeightAndSize { + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + dimensions?: Dimension; + + /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ + packageType?: string | null; + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + weight?: Weight; + } + + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Dimension { + + /** + * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + height?: number | null; + + /** + * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + length?: number | null; + + /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + width?: number | null; + } + + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Weight { + + /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } + * Type: double + */ + value?: number | null; + } + + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + export interface Product { + + /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ + aspects?: Array; + + /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ + brand?: string | null; + + /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ + description?: string | null; + + /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ + ean?: Array; + + /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ + epid?: string | null; + + /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ + imageUrls?: Array; + + /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ + isbn?: Array; + + /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ + mpn?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ + title?: string | null; + + /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ + upc?: Array; + } + + + /** The base request of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItem { + + /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ + requests?: Array; + } + + + /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ + export interface InventoryItemWithSkuLocale { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemResponse { + + /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ + export interface InventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ + errors?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base container of the bulkMigrateListings request payload. */ + export interface BulkMigrateListing { + + /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ + requests?: Array; + } + + + /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ + export interface MigrateListing { + + /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ + listingId?: string | null; + } + + + /** This type is used by the response payload of the bulkMigrateListings call. */ + export interface BulkMigrateListingResponse { + + /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ + responses?: Array; + } + + + /** This type is used to display the results of each listing that the seller attempted to migrate. */ + export interface MigrateListingResponse { + + /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ + errors?: Array; + + /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ + inventoryItemGroupKey?: string | null; + + /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ + inventoryItems?: Array; + + /** The unique identifier of the eBay listing that the seller attempted to migrate. */ + listingId?: string | null; + + /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ + warnings?: Array; + } + + + /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ + export interface InventoryItemListing { + + /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ + offerId?: string | null; + + /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ + sku?: string | null; + } + + + /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ + export interface BulkOffer { + + /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ + requests?: Array; + } + + + /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ + export interface OfferKeyWithId { + + /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ + offerId?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOffer method. */ + export interface BulkOfferResponse { + + /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ + export interface OfferSkuResponse { + + /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ + errors?: Array; + + /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ + offerId?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ + sku?: string | null; + + /** + * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ + warnings?: Array; + } + + + /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + export interface BulkPriceQuantity { + + /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + requests?: Array; + } + + + /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ + export interface PriceQuantity { + + /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ + offers?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + + /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ + export interface OfferPriceQuantity { + + /** + * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ + offerId?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + } + + + /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + export interface BulkPriceQuantityResponse { + + /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + responses?: Array; + } + + + /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ + export interface PriceQuantityResponse { + + /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ + errors?: Array; + + /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ + offerId?: string | null; + + /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ + sku?: string | null; + + /** + * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base response of the bulkPublishOffer method. */ + export interface BulkPublishResponse { + + /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ + responses?: Array; + } + + + /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ + export interface OfferResponseWithListingId { + + /** This container will be returned if there were one or more errors associated with publishing the offer. */ + errors?: Array; + + /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ + listingId?: string | null; + + /** The unique identifier of the offer that the seller published (or attempted to publish). */ + offerId?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with publishing the offer. */ + warnings?: Array; + } + + + /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ + export interface Compatibility { + + /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ + compatibleProducts?: Array; + + /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ + sku?: string | null; + } + + + /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ + export interface CompatibleProduct { + + /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ + compatibilityProperties?: Array; + + /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ + notes?: string | null; + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + productFamilyProperties?: ProductFamilyProperties; + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + productIdentifier?: ProductIdentifier; + } + + + /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ + export interface NameValueList { + + /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ + name?: string | null; + + /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ + value?: string | null; + } + + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + export interface ProductFamilyProperties { + + /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ + engine?: string | null; + + /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ + make?: string | null; + + /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ + model?: string | null; + + /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ + trim?: string | null; + + /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ + year?: string | null; + } + + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + export interface ProductIdentifier { + + /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ + epid?: string | null; + + /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ + gtin?: string | null; + + /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ + ktype?: string | null; + } + + + /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ + export interface EbayOfferDetailsWithAll { + + /** + * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + listing?: ListingDetails; + + /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ + merchantLocationKey?: string | null; + + /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ + offerId?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ + sku?: string | null; + + /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + export interface ListingDetails { + + /** The unique identifier of the eBay listing that is associated with the published offer. */ + listingId?: string | null; + + /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ + listingStatus?: string | null; + + /** + * This integer value indicates the quantity of the product that has been sold for the published offer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + soldQuantity?: number | null; + } + + + /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ + export interface EbayOfferDetailsWithId { + + /** + * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ + export interface Fee { + + /** This type is used to express a dollar value and the applicable currency. */ + amount?: Amount; + + /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + feeType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + promotionalDiscount?: Amount; + } + + + /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ + export interface FeeSummary { + + /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + fees?: Array; + + /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response payload for the getListingFees call. */ + export interface FeesSummaryResponse { + + /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ + feeSummaries?: Array; + } + + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + export interface GeoCoordinates { + + /** + * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + longitude?: number | null; + } + + + /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ + export interface Interval { + + /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + close?: string | null; + + /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + open?: string | null; + } + + + /** This type is used to provide detailed information about an inventory item. */ + export interface InventoryItem { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + } + + + /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ + export interface InventoryItemGroup { + + /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ + aspects?: Array; + + /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ + description?: string | null; + + /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ + imageUrls?: Array; + + /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ + inventoryItemGroupKey?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ + title?: string | null; + + /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ + variantSKUs?: Array; + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + variesBy?: VariesBy; + } + + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + export interface VariesBy { + + /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ + aspectsImageVariesBy?: Array; + + /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ + specifications?: Array; + } + + + /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ + export interface Specification { + + /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ + name?: string | null; + + /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ + values?: Array; + } + + export interface InventoryItemWithSkuLocaleGroupid { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ + groupIds?: Array; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used by the base response payload of getInventoryItems call. */ + export interface InventoryItems { + + /** This is the URL to the current page of inventory items. */ + href?: string | null; + + /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ + inventoryItems?: Array; + + /** + * This integer value is the number of inventory items that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ + next?: string | null; + + /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ + prev?: string | null; + + /** + * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ + export interface InventoryLocation { + + /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ + locationInstructions?: string | null; + + /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ + locationWebUrl?: string | null; + + /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ + name?: string | null; + + /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ + operatingHours?: Array; + + /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ + phone?: string | null; + + /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ + specialHours?: Array; + } + + + /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ + export interface OperatingHours { + + /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ + dayOfWeekEnum?: string | null; + + /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ + intervals?: Array; + } + + + /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ + export interface SpecialHours { + + /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ + date?: string | null; + + /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ + intervals?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ + export interface InventoryLocationFull { + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + location?: LocationDetails; + + /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ + locationInstructions?: string | null; + + /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ + locationTypes?: Array; + + /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ + phone?: string | null; + + /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ + specialHours?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + export interface LocationDetails { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + } + + + /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ + export interface InventoryLocationResponse { + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + location?: Location; + + /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ + locationInstructions?: string | null; + + /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ + locationTypes?: Array; + + /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ + phone?: string | null; + + /** This container shows the special operating hours for a store location on a specific date or dates. */ + specialHours?: Array; + } + + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + export interface Location { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + + /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ + locationId?: string | null; + } + + + /** This type is used by the base response payload for the getInventoryLocations call. */ + export interface LocationResponse { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of one or more of the merchant's inventory locations. */ + locations?: Array; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the base request payload of the getListingFees call. */ + export interface OfferKeysWithId { + + /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ + offers?: Array; + } + + + /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ + export interface OfferResponse { + + /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ + offerId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ + export interface Offers { + + /** This is the URL to the current page of offers. */ + href?: string | null; + + /** + * This integer value is the number of offers that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ + next?: string | null; + + /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ + offers?: Array; + + /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ + prev?: string | null; + + /** + * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ + export interface PublishByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ + export interface PublishResponse { + + /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ + listingId?: string | null; + + /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ + warnings?: Array; + } + + + /** This type is used to show the version number and instance of the service or API. */ + export interface Version { + + /** This type is used to show the version number and instance of the service or API. */ + instance?: Version; + + /** The version number of the service or API. */ + version?: string | null; + } + + + /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ + export interface WithdrawByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** The base response of the withdrawOffer call. */ + export interface WithdrawResponse { + + /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ + listingId?: string | null; + + /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ + warnings?: Array; + } + + export class LocationClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 + * @return {InventoryLocationResponse} Success + */ + GetInventoryLocation(merchantLocationKey: string, callback: (data : InventoryLocationResponse) => any) { + this.httpClient.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), callback, this.error, this.statusCode); + } + + /** + * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 + * @param {InventoryLocationFull} requestBody Inventory Location details + * @return {void} + */ + CreateInventoryLocation(merchantLocationKey: string, callback: (data : void) => any, requestBody: InventoryLocationFull) { + this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. + * Delete location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 + * @return {void} + */ + DeleteInventoryLocation(merchantLocationKey: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), callback, this.error, this.statusCode); + } + + /** + * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/disable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 + * @return {string} Success + */ + DisableInventoryLocation(merchantLocationKey: string, callback: (data : string) => any) { + this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/enable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 + * @return {string} Success + */ + EnableInventoryLocation(merchantLocationKey: string, callback: (data : string) => any) { + this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 + * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {LocationResponse} Success + */ + GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined, callback: (data : LocationResponse) => any) { + this.httpClient.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); + } + + /** + * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey}/update_location_details + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 + * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). + * @return {void} + */ + UpdateInventoryLocation(merchantLocationKey: string, callback: (data : void) => any, requestBody: InventoryLocation) { + this.httpClient.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Inventory_itemClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Get inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. + * @return {InventoryItemWithSkuLocaleGroupid} Success + */ + GetInventoryItem(sku: string, callback: (data : InventoryItemWithSkuLocaleGroupid) => any) { + this.httpClient.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), callback, this.error, this.statusCode); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. + * Put inventory_item/{sku} + * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. + * @param {InventoryItem} requestBody Details of the inventory item record. + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItem(sku: string, callback: (data : BaseResponse) => any, requestBody: InventoryItem) { + this.httpClient.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Delete inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. + * @return {void} + */ + DeleteInventoryItem(sku: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), callback, this.error, this.statusCode); + } + + /** + * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. + * Get inventory_item + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {InventoryItems} Success + */ + GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined, callback: (data : InventoryItems) => any) { + this.httpClient.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); + } + + /** + * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Post bulk_update_price_quantity + * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace + * @return {BulkPriceQuantityResponse} Success + */ + BulkUpdatePriceQuantity(callback: (data : BulkPriceQuantityResponse) => any, requestBody: BulkPriceQuantity) { + this.httpClient.post(this.baseUri + 'bulk_update_price_quantity', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. + * Post bulk_create_or_replace_inventory_item + * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkInventoryItemResponse} Success + */ + BulkCreateOrReplaceInventoryItem(callback: (data : BulkInventoryItemResponse) => any, requestBody: BulkInventoryItem) { + this.httpClient.post(this.baseUri + 'bulk_create_or_replace_inventory_item', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Post bulk_get_inventory_item + * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkGetInventoryItemResponse} Success + */ + BulkGetInventoryItem(callback: (data : BulkGetInventoryItemResponse) => any, requestBody: BulkGetInventoryItem) { + this.httpClient.post(this.baseUri + 'bulk_get_inventory_item', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Product_compatibilityClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Get inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {Compatibility} Success + */ + GetProductCompatibility(sku: string, callback: (data : Compatibility) => any) { + this.httpClient.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', callback, this.error, this.statusCode); + } + + /** + * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @param {Compatibility} requestBody Details of the compatibility + * @return {BaseResponse} Success + */ + CreateOrReplaceProductCompatibility(sku: string, callback: (data : BaseResponse) => any, requestBody: Compatibility) { + this.httpClient.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Delete inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {void} + */ + DeleteProductCompatibility(sku: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', callback, this.error, this.statusCode); + } + } + + export class OfferClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer + * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. + * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. + * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {Offers} Success + */ + GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : Offers) => any) { + this.httpClient.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); + } + + /** + * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. + * Post offer + * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {void} + */ + CreateOffer(callback: (data : void) => any, requestBody: EbayOfferDetailsWithKeys) { + this.httpClient.post(this.baseUri + 'offer', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is to be retrieved. + * @return {EbayOfferDetailsWithAll} Success + */ + GetOffer(offerId: string, callback: (data : EbayOfferDetailsWithAll) => any) { + this.httpClient.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), callback, this.error, this.statusCode); + } + + /** + * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. + * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel + * @return {OfferResponse} Success + */ + UpdateOffer(offerId: string, callback: (data : OfferResponse) => any, requestBody: EbayOfferDetailsWithId) { + this.httpClient.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. + * Delete offer/{offerId} + * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. + * @return {void} + */ + DeleteOffer(offerId: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), callback, this.error, this.statusCode); + } + + /** + * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post offer/{offerId}/publish/ + * @param {string} offerId The unique identifier of the offer that is to be published. + * @return {PublishResponse} Success + */ + PublishOffer(offerId: string, callback: (data : PublishResponse) => any) { + this.httpClient.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. + * Post offer/publish_by_inventory_item_group/ + * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. + * @return {PublishResponse} Success + */ + PublishOfferByInventoryItemGroup(callback: (data : PublishResponse) => any, requestBody: PublishByInventoryItemGroupRequest) { + this.httpClient.post(this.baseUri + 'offer/publish_by_inventory_item_group/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. + * Post offer/withdraw_by_inventory_item_group + * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. + * @return {void} + */ + WithdrawOfferByInventoryItemGroup(callback: (data : void) => any, requestBody: WithdrawByInventoryItemGroupRequest) { + this.httpClient.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. + * Post offer/get_listing_fees + * @param {OfferKeysWithId} requestBody List of offers that needs fee information + * @return {FeesSummaryResponse} Success + */ + GetListingFees(callback: (data : FeesSummaryResponse) => any, requestBody: OfferKeysWithId) { + this.httpClient.post(this.baseUri + 'offer/get_listing_fees', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. + * Post bulk_create_offer + * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {BulkOfferResponse} Success + */ + BulkCreateOffer(callback: (data : BulkOfferResponse) => any, requestBody: BulkEbayOfferDetailsWithKeys) { + this.httpClient.post(this.baseUri + 'bulk_create_offer', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post bulk_publish_offer + * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. + * @return {BulkPublishResponse} Success + */ + BulkPublishOffer(callback: (data : BulkPublishResponse) => any, requestBody: BulkOffer) { + this.httpClient.post(this.baseUri + 'bulk_publish_offer', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. + * Post offer/{offerId}/withdraw + * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. + * @return {WithdrawResponse} Success + */ + WithdrawOffer(offerId: string, callback: (data : WithdrawResponse) => any) { + this.httpClient.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Inventory_item_groupClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. + * Get inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. + * @return {InventoryItemGroup} Success + */ + GetInventoryItemGroup(inventoryItemGroupKey: string, callback: (data : InventoryItemGroup) => any) { + this.httpClient.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), callback, this.error, this.statusCode); + } + + /** + * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. + * @param {InventoryItemGroup} requestBody Details of the inventory Item Group + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, callback: (data : BaseResponse) => any, requestBody: InventoryItemGroup) { + this.httpClient.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call deletes the inventory item group for a given inventoryItemGroupKey value. + * Delete inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. + * @return {void} + */ + DeleteInventoryItemGroup(inventoryItemGroupKey: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), callback, this.error, this.statusCode); + } + } + + export class ListingClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. + * Post bulk_migrate_listing + * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory + * @return {BulkMigrateListingResponse} Success + */ + BulkMigrateListing(callback: (data : BulkMigrateListingResponse) => any, requestBody: BulkMigrateListing) { + this.httpClient.post(this.baseUri + 'bulk_migrate_listing', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_listing.txt b/Tests/SwagTsTests/JqResults/sell_listing.ts similarity index 98% rename from Tests/SwagTsTests/JqResults/sell_listing.txt rename to Tests/SwagTsTests/JqResults/sell_listing.ts index 9c26da74..514db9ef 100644 --- a/Tests/SwagTsTests/JqResults/sell_listing.txt +++ b/Tests/SwagTsTests/JqResults/sell_listing.ts @@ -1,169 +1,169 @@ -/// -export namespace MyNS { - - /** The type that defines the fields for the currency and a monetary amount. */ - export interface Amount { - - /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. */ - value?: string | null; - } - - - /** The type that defines the fields for the item aspects. */ - export interface Aspect { - - /** The name of an aspect, such and Brand. */ - name?: string | null; - - /** A list of potential values for this aspect. */ - values?: Array; - } - - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ - donationPercentage?: string | null; - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** The type that defines the fields for the listing details. */ - export interface ItemDraft { - - /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - categoryId?: string | null; - - /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The type that defines the fields for the price details for an item. */ - pricingSummary?: PricingSummary; - - /** The type that defines the fields for the aspects of a product. */ - product?: Product; - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - } - - - /** The type that defines the fields for the price details for an item. */ - export interface PricingSummary { - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionReservePrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionStartPrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - price?: Amount; - } - - - /** The type that defines the fields for the aspects of a product. */ - export interface Product { - - /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ - aspects?: Array; - - /** The name brand of the item, such as Nike, Apple, etc. */ - brand?: string | null; - - /** The description of the item that was created by the seller. This can be plain text or rich content. */ - description?: string | null; - - /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - epid?: string | null; - - /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ - imageUrls?: Array; - - /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ - title?: string | null; - } - - - /** The type that defines the field for the createItemDraft response. */ - export interface ItemDraftResponse { - - /** The eBay generated ID of the listing draft. */ - itemDraftId?: string | null; - - /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ - sellFlowNativeUri?: string | null; - - /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ - sellFlowUrl?: string | null; - } - - export class Item_draftClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. - * Post item_draft/ - * @return {void} - */ - CreateItemDraft(callback: (data : void) => any, requestBody: ItemDraft) { - this.httpClient.post(this.baseUri + 'item_draft/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - -} - +/// +export namespace MyNS { + + /** The type that defines the fields for the currency and a monetary amount. */ + export interface Amount { + + /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. */ + value?: string | null; + } + + + /** The type that defines the fields for the item aspects. */ + export interface Aspect { + + /** The name of an aspect, such and Brand. */ + name?: string | null; + + /** A list of potential values for this aspect. */ + values?: Array; + } + + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ + donationPercentage?: string | null; + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** The type that defines the fields for the listing details. */ + export interface ItemDraft { + + /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + categoryId?: string | null; + + /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The type that defines the fields for the price details for an item. */ + pricingSummary?: PricingSummary; + + /** The type that defines the fields for the aspects of a product. */ + product?: Product; + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + } + + + /** The type that defines the fields for the price details for an item. */ + export interface PricingSummary { + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionReservePrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionStartPrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + price?: Amount; + } + + + /** The type that defines the fields for the aspects of a product. */ + export interface Product { + + /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ + aspects?: Array; + + /** The name brand of the item, such as Nike, Apple, etc. */ + brand?: string | null; + + /** The description of the item that was created by the seller. This can be plain text or rich content. */ + description?: string | null; + + /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + epid?: string | null; + + /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ + imageUrls?: Array; + + /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ + title?: string | null; + } + + + /** The type that defines the field for the createItemDraft response. */ + export interface ItemDraftResponse { + + /** The eBay generated ID of the listing draft. */ + itemDraftId?: string | null; + + /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ + sellFlowNativeUri?: string | null; + + /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ + sellFlowUrl?: string | null; + } + + export class Item_draftClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. + * Post item_draft/ + * @return {void} + */ + CreateItemDraft(callback: (data : void) => any, requestBody: ItemDraft) { + this.httpClient.post(this.baseUri + 'item_draft/', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_logistics.txt b/Tests/SwagTsTests/JqResults/sell_logistics.ts similarity index 98% rename from Tests/SwagTsTests/JqResults/sell_logistics.txt rename to Tests/SwagTsTests/JqResults/sell_logistics.ts index 4e07393b..07573bcf 100644 --- a/Tests/SwagTsTests/JqResults/sell_logistics.txt +++ b/Tests/SwagTsTests/JqResults/sell_logistics.ts @@ -1,484 +1,484 @@ -/// -export namespace MyNS { - - /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ - export interface AdditionalOption { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalCost?: Amount; - - /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ - optionType?: string | null; - } - - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains contact information for an individual buyer or seller. */ - export interface Contact { - - /** The company name with which the contact is associated. */ - companyName?: string | null; - - /** This complex type specifies the details of a geographical address. */ - contactAddress?: ContactAddress; - - /** The contact's full name. */ - fullName?: string | null; - - /** This complex type contains a string field representing a telephone number. */ - primaryPhone?: PhoneNumber; - } - - - /** This complex type specifies the details of a geographical address. */ - export interface ContactAddress { - - /** The first line of the street address. */ - addressLine1?: string | null; - - /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ - addressLine2?: string | null; - - /** The city in which the address is located. */ - city?: string | null; - - /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ - county?: string | null; - - /** The postal code of the address. */ - postalCode?: string | null; - - /** The state or province in which the address is located. States and provinces often contain multiple counties. */ - stateOrProvince?: string | null; - } - - - /** This complex type contains a string field representing a telephone number. */ - export interface PhoneNumber { - - /** A telephone number. */ - phoneNumber?: string | null; - } - - - /** This complex type contains the request payload for the createFromShippingQuote method. */ - export interface CreateShipmentFromQuoteRequest { - - /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ - additionalOptions?: Array; - - /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ - labelCustomMessage?: string | null; - - /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ - labelSize?: string | null; - - /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ - rateId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ - shippingQuoteId?: string | null; - } - - - /** This complex type defines the dimensions of a package to be shipped. */ - export interface Dimensions { - - /** The numeric value of the height of the package. */ - height?: string | null; - - /** The numeric value of the length of the package. */ - length?: string | null; - - /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the width of the package. */ - width?: string | null; - } - - - /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ - export interface Order { - - /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ - channel?: string | null; - - /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ - orderId?: string | null; - } - - - /** This complex type specifies the dimensions and weight of a package. */ - export interface PackageSpecification { - - /** This complex type defines the dimensions of a package to be shipped. */ - dimensions?: Dimensions; - - /** This complex type contains information about the weight of an object such as a shipping package. */ - weight?: Weight; - } - - - /** This complex type contains information about the weight of an object such as a shipping package. */ - export interface Weight { - - /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the weight of the package, as measured by the value of unit. */ - value?: string | null; - } - - - /** This complex type defines a time window for the pickup of a package. */ - export interface PickupSlot { - - /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ - pickupSlotEndTime?: string | null; - - /** Seller-defined name for the pickup slot. */ - pickupSlotId?: string | null; - - /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ - pickupSlotStartTime?: string | null; - - /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ - pickupSlotTimeZone?: string | null; - } - - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - export interface PurchasedRate { - - /** An list of additional, optional features that have been purchased for the shipment. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ - destinationTimeZone?: string | null; - - /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - maxEstimatedDeliveryDate?: string | null; - - /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ - pickupSlotId?: string | null; - - /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ - rateId?: string | null; - - /** The ID code for the carrier that was selected for the package shipment. */ - shippingCarrierCode?: string | null; - - /** The name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ - shippingQuoteId?: string | null; - - /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ - shippingServiceCode?: string | null; - - /** The name of the shipping service. */ - shippingServiceName?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - totalShippingCost?: Amount; - } - - - /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ - export interface Rate { - - /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ - destinationTimeZone?: string | null; - - /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ - maxEstimatedDeliveryDate?: string | null; - - /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** A list of available pickup slots for the package. */ - pickupSlots?: Array; - - /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The unique eBay-assigned ID for this shipping rate. */ - rateId?: string | null; - - /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ - rateRecommendation?: Array; - - /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ - shippingCarrierCode?: string | null; - - /** The common name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ - shippingServiceCode?: string | null; - - /** The common name of the shipping service. */ - shippingServiceName?: string | null; - } - - - /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ - export interface Shipment { - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - cancellation?: ShipmentCancellation; - - /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - creationDate?: string | null; - - /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ - labelCustomMessage?: string | null; - - /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ - labelDownloadUrl?: string | null; - - /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ - labelSize?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - rate?: PurchasedRate; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ - shipmentId?: string | null; - - /** A unique carrier-assigned ID string that can be used to track the shipment. */ - shipmentTrackingNumber?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - export interface ShipmentCancellation { - - /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ - cancellationRequestedDate?: string | null; - - /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ - cancellationStatus?: string | null; - } - - - /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ - export interface ShippingQuote { - - /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ - creationDate?: string | null; - - /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ - expirationDate?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ - rates?: Array; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ - shippingQuoteId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - - /** A list of any warnings triggered by the request. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning message. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ - export interface ShippingQuoteRequest { - - /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - export class ShipmentClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. - * Post shipment/create_from_shipping_quote - * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. - * @return {void} - */ - CreateFromShippingQuote(callback: (data : void) => any, requestBody: CreateShipmentFromQuoteRequest) { - this.httpClient.post(this.baseUri + 'shipment/create_from_shipping_quote', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. - * Get shipment/{shipmentId} - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - GetShipment(shipmentId: string, callback: (data : Shipment) => any) { - this.httpClient.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), callback, this.error, this.statusCode); - } - - /** - * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. - * Get shipment/{shipmentId}/download_label_file - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {void} Success - */ - DownloadLabelFile(shipmentId: string, callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', callback, this.error, this.statusCode); - } - - /** - * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. - * Post shipment/{shipmentId}/cancel - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - CancelShipment(shipmentId: string, callback: (data : Shipment) => any) { - this.httpClient.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Shipping_quoteClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. - * Post shipping_quote - * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. - * @return {void} - */ - CreateShippingQuote(callback: (data : void) => any, requestBody: ShippingQuoteRequest) { - this.httpClient.post(this.baseUri + 'shipping_quote', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. - * Get shipping_quote/{shippingQuoteId} - * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. - * @return {ShippingQuote} Success - */ - GetShippingQuote(shippingQuoteId: string, callback: (data : ShippingQuote) => any) { - this.httpClient.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + + /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ + export interface AdditionalOption { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalCost?: Amount; + + /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ + optionType?: string | null; + } + + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains contact information for an individual buyer or seller. */ + export interface Contact { + + /** The company name with which the contact is associated. */ + companyName?: string | null; + + /** This complex type specifies the details of a geographical address. */ + contactAddress?: ContactAddress; + + /** The contact's full name. */ + fullName?: string | null; + + /** This complex type contains a string field representing a telephone number. */ + primaryPhone?: PhoneNumber; + } + + + /** This complex type specifies the details of a geographical address. */ + export interface ContactAddress { + + /** The first line of the street address. */ + addressLine1?: string | null; + + /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ + addressLine2?: string | null; + + /** The city in which the address is located. */ + city?: string | null; + + /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ + county?: string | null; + + /** The postal code of the address. */ + postalCode?: string | null; + + /** The state or province in which the address is located. States and provinces often contain multiple counties. */ + stateOrProvince?: string | null; + } + + + /** This complex type contains a string field representing a telephone number. */ + export interface PhoneNumber { + + /** A telephone number. */ + phoneNumber?: string | null; + } + + + /** This complex type contains the request payload for the createFromShippingQuote method. */ + export interface CreateShipmentFromQuoteRequest { + + /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ + additionalOptions?: Array; + + /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ + labelCustomMessage?: string | null; + + /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ + labelSize?: string | null; + + /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ + rateId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ + shippingQuoteId?: string | null; + } + + + /** This complex type defines the dimensions of a package to be shipped. */ + export interface Dimensions { + + /** The numeric value of the height of the package. */ + height?: string | null; + + /** The numeric value of the length of the package. */ + length?: string | null; + + /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the width of the package. */ + width?: string | null; + } + + + /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ + export interface Order { + + /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ + channel?: string | null; + + /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ + orderId?: string | null; + } + + + /** This complex type specifies the dimensions and weight of a package. */ + export interface PackageSpecification { + + /** This complex type defines the dimensions of a package to be shipped. */ + dimensions?: Dimensions; + + /** This complex type contains information about the weight of an object such as a shipping package. */ + weight?: Weight; + } + + + /** This complex type contains information about the weight of an object such as a shipping package. */ + export interface Weight { + + /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the weight of the package, as measured by the value of unit. */ + value?: string | null; + } + + + /** This complex type defines a time window for the pickup of a package. */ + export interface PickupSlot { + + /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ + pickupSlotEndTime?: string | null; + + /** Seller-defined name for the pickup slot. */ + pickupSlotId?: string | null; + + /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ + pickupSlotStartTime?: string | null; + + /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ + pickupSlotTimeZone?: string | null; + } + + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + export interface PurchasedRate { + + /** An list of additional, optional features that have been purchased for the shipment. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ + destinationTimeZone?: string | null; + + /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + maxEstimatedDeliveryDate?: string | null; + + /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ + pickupSlotId?: string | null; + + /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ + rateId?: string | null; + + /** The ID code for the carrier that was selected for the package shipment. */ + shippingCarrierCode?: string | null; + + /** The name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ + shippingQuoteId?: string | null; + + /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ + shippingServiceCode?: string | null; + + /** The name of the shipping service. */ + shippingServiceName?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + totalShippingCost?: Amount; + } + + + /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ + export interface Rate { + + /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ + destinationTimeZone?: string | null; + + /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ + maxEstimatedDeliveryDate?: string | null; + + /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** A list of available pickup slots for the package. */ + pickupSlots?: Array; + + /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The unique eBay-assigned ID for this shipping rate. */ + rateId?: string | null; + + /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ + rateRecommendation?: Array; + + /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ + shippingCarrierCode?: string | null; + + /** The common name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ + shippingServiceCode?: string | null; + + /** The common name of the shipping service. */ + shippingServiceName?: string | null; + } + + + /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ + export interface Shipment { + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + cancellation?: ShipmentCancellation; + + /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + creationDate?: string | null; + + /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ + labelCustomMessage?: string | null; + + /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ + labelDownloadUrl?: string | null; + + /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ + labelSize?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + rate?: PurchasedRate; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ + shipmentId?: string | null; + + /** A unique carrier-assigned ID string that can be used to track the shipment. */ + shipmentTrackingNumber?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + export interface ShipmentCancellation { + + /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ + cancellationRequestedDate?: string | null; + + /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ + cancellationStatus?: string | null; + } + + + /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ + export interface ShippingQuote { + + /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ + creationDate?: string | null; + + /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ + expirationDate?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ + rates?: Array; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ + shippingQuoteId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + + /** A list of any warnings triggered by the request. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning message. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ + export interface ShippingQuoteRequest { + + /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + export class ShipmentClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. + * Post shipment/create_from_shipping_quote + * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. + * @return {void} + */ + CreateFromShippingQuote(callback: (data : void) => any, requestBody: CreateShipmentFromQuoteRequest) { + this.httpClient.post(this.baseUri + 'shipment/create_from_shipping_quote', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. + * Get shipment/{shipmentId} + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + GetShipment(shipmentId: string, callback: (data : Shipment) => any) { + this.httpClient.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), callback, this.error, this.statusCode); + } + + /** + * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. + * Get shipment/{shipmentId}/download_label_file + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {void} Success + */ + DownloadLabelFile(shipmentId: string, callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', callback, this.error, this.statusCode); + } + + /** + * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. + * Post shipment/{shipmentId}/cancel + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + CancelShipment(shipmentId: string, callback: (data : Shipment) => any) { + this.httpClient.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Shipping_quoteClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. + * Post shipping_quote + * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. + * @return {void} + */ + CreateShippingQuote(callback: (data : void) => any, requestBody: ShippingQuoteRequest) { + this.httpClient.post(this.baseUri + 'shipping_quote', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. + * Get shipping_quote/{shippingQuoteId} + * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. + * @return {ShippingQuote} Success + */ + GetShippingQuote(shippingQuoteId: string, callback: (data : ShippingQuote) => any) { + this.httpClient.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_marketing.txt b/Tests/SwagTsTests/JqResults/sell_marketing.ts similarity index 98% rename from Tests/SwagTsTests/JqResults/sell_marketing.txt rename to Tests/SwagTsTests/JqResults/sell_marketing.ts index d9fab5bf..c762d60a 100644 --- a/Tests/SwagTsTests/JqResults/sell_marketing.txt +++ b/Tests/SwagTsTests/JqResults/sell_marketing.ts @@ -1,1762 +1,1762 @@ -/// -export namespace MyNS { - - /** This type defines the fields for an ad. */ - export interface Ad { - - /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ - adId?: string | null; - - /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type is a container for a list of ad IDs. */ - export interface AdIds { - - /** A list of ad ID's. */ - adIds?: Array; - } - - - /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface AdPagedCollection { - - /** A list of ads contained on this page from the paginated response. */ - ads?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for an ad ID and its associated URL. */ - export interface AdReference { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** The URI of an ad. You can use this URI to retrieve the ad. */ - href?: string | null; - } - - - /** This type is a container for a list of ad IDs and their associated URIs. */ - export interface AdReferences { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines the fields returned in an ad response. */ - export interface AdResponse { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** An array of errors associated with the request. */ - errors?: Array; - - /** The URI that points to the ad. */ - href?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields returned in an error condition. */ - export interface Error { - - /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** The name of the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ - longMessage?: string | null; - - /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ - message?: string | null; - - /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** A name/value pair that provides parameter details regarding a warning or error condition. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** The value that was set for the element specified in the name field. */ - value?: string | null; - } - - - /** This type defines the container for an array of ads. */ - export interface Ads { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - export interface Amount { - - /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ - value?: string | null; - } - - - /** This type defines the fields for any warning error messages. */ - export interface BaseResponse { - - /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ - warnings?: Array; - } - - - /** This type defines the fields for the create ads in bulk response. */ - export interface BulkAdResponse { - - /** A list of ads processed by the call. */ - responses?: Array; - } - - - /** This type defines the fields for the create ads in bulk by listing IDs. */ - export interface BulkCreateAdRequest { - - /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ - requests?: Array; - } - - - /** This type defines the fields for the create ad request. */ - export interface CreateAdRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ - export interface BulkCreateAdsByInventoryReferenceRequest { - - /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to create ads by inventory reference ID request. */ - export interface CreateAdsByInventoryReferenceRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ - export interface BulkCreateAdsByInventoryReferenceResponse { - - /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ - responses?: Array; - } - - - /** This type defines the fields returned when you create an ad by inventory reference ID. */ - export interface CreateAdsByInventoryReferenceResponse { - - /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ - ads?: Array; - - /** An array of errors or warnings associated with the create-ads request. */ - errors?: Array; - - /** The seller's inventory reference ID that's associated with the ad. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that the call uses to remove ads in bulk. */ - export interface BulkDeleteAdRequest { - - /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - requests?: Array; - } - - - /** This type defines the fields used in a delete-ad request. */ - export interface DeleteAdRequest { - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ - export interface BulkDeleteAdResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned in a delete-ad response. */ - export interface DeleteAdResponse { - - /** The ID of the ad that was deleted. */ - adId?: string | null; - - /** An array of the errors or warnings associated with the request. */ - errors?: Array; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ - export interface BulkDeleteAdsByInventoryReferenceRequest { - - /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ - export interface DeleteAdsByInventoryReferenceRequest { - - /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ - export interface BulkDeleteAdsByInventoryReferenceResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ - export interface DeleteAdsByInventoryReferenceResponse { - - /** The list of ad IDs that were removed from the campaign. */ - adIds?: Array; - - /** The container for the errors associated with the request. */ - errors?: Array; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that describe an ad campaign. */ - export interface Campaign { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ - campaignId?: string | null; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ - campaignStatus?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - export interface CampaignCriterion { - - /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ - criterionType?: string | null; - - /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ - selectionRules?: Array; - } - - - /** This type specifies the selection rules used to create a campaign. */ - export interface SelectionRule { - - /** A list of the brands of the items to be included in the campaign. */ - brands?: Array; - - /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ - categoryIds?: Array; - - /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ - categoryScope?: string | null; - - /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ - listingConditionIds?: Array; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - maxPrice?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minPrice?: Amount; - } - - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - export interface FundingStrategy { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ - fundingModel?: string | null; - } - - - /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface CampaignPagedCollection { - - /** A list of campaigns contained on this page from the paginated response. */ - campaigns?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type contains a list of campaigns. */ - export interface Campaigns { - - /** An array of campaigns and their details. */ - campaigns?: Array; - } - - - /** This type defines the fields needed for a clone-campaign request. */ - export interface CloneCampaignRequest { - - /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ - export interface CreateCampaignRequest { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ - export interface CreateReportTask { - - /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ - dimensions?: Array; - - /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ - inventoryReferences?: Array; - - /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ - listingIds?: Array; - - /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ - metricKeys?: Array; - - /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ - export interface Dimension { - - /** A list of annotations associated with the dimension of the report. */ - annotationKeys?: Array; - - /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ - dimensionKey?: string | null; - } - - - /** This type defines the fields contained in an inventory reference ID. */ - export interface InventoryReference { - - /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ - inventoryReferenceId?: string | null; - - /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ - export interface DimensionKeyAnnotation { - - /** An annotation key associated with the dimension. */ - annotationKey?: string | null; - - /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - } - - - /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ - export interface DimensionMetadata { - - /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the dimension used to create the report. */ - dimensionKey?: string | null; - - /** An list of annotation keys associated with the specified dimension of the report. */ - dimensionKeyAnnotations?: Array; - } - - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - export interface DiscountBenefit { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffItem?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffOrder?: Amount; - - /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ - percentageOffItem?: string | null; - - /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ - percentageOffOrder?: string | null; - } - - - /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ - export interface DiscountRule { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountSpecification?: DiscountSpecification; - - /** - * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - export interface DiscountSpecification { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - forEachAmount?: Amount; - - /** - * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - forEachQuantity?: number | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minAmount?: Amount; - - /** - * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - minQuantity?: number | null; - - /** - * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfDiscountedItems?: number | null; - } - - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - export interface InventoryCriterion { - - /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ - inventoryCriterionType?: string | null; - - /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ - inventoryItems?: Array; - - /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ - listingIds?: Array; - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - ruleCriteria?: RuleCriteria; - } - - - /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ - export interface InventoryItem { - - /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ - inventoryReferenceId?: string | null; - } - - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - export interface RuleCriteria { - - /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeInventoryItems?: Array; - - /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeListingIds?: Array; - - /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ - markupInventoryItems?: Array; - - /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ - markupListingIds?: Array; - - /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ - selectionRules?: Array; - } - - - /** This type defines the fields used to describe an item price markdown promotion. */ - export interface ItemPriceMarkdown { - - /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ - applyFreeShipping?: boolean | null; - - /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ - blockPriceIncreaseInItemRevision?: boolean | null; - - /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ - selectedInventoryDiscounts?: Array; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ - export interface SelectedInventoryDiscount { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ - discountId?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** - * For markdown promotions, this field is reserved for future use. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ - export interface ItemPromotion { - - /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This complex type defines the fields returned for a promotion. */ - export interface ItemPromotionResponse { - - /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the name and data type of a metric. */ - export interface MetricMetadata { - - /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the metric. */ - metricKey?: string | null; - } - - - /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ - export interface PromotionDetail { - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** The URI of the promotion details. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields in a promotion-level report. */ - export interface PromotionReportDetail { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemRevenue?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderRevenue?: Amount; - - /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ - averageOrderSize?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** - * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemsSoldQuantity?: number | null; - - /** - * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfOrdersSold?: number | null; - - /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ - percentageSalesLift?: string | null; - - /** The URI of the promotion report. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ - promotionReportId?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ - promotions?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsReportPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list of promotionReports contained in the paginated result set. */ - promotionReports?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields included in the report. */ - export interface ReportMetadata { - - /** A list containing the metadata for the dimension used in the report. */ - dimensionMetadata?: Array; - - /** - * The maximum number of dimensions that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfDimensionsToRequest?: number | null; - - /** - * The maximum number of metrics that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfMetricsToRequest?: number | null; - - /** A list containing the metadata for the metrics in the report. */ - metricMetadata?: Array; - - /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the metadata used by the all report types. */ - export interface ReportMetadatas { - - /** A list of the metadata for the associated report type. */ - reportMetadata?: Array; - } - - - /** This type defines the fields in a report task. */ - export interface ReportTask { - - /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** A list containing the dimension in the report. */ - dimensions?: Array; - - /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ - inventoryReferences?: Array; - - /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingIds?: Array; - - /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A list of metrics for the report task. */ - metricKeys?: Array; - - /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportExpirationDate?: string | null; - - /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The URL of the generated report, which can be used to download the report once it has been generated. */ - reportHref?: string | null; - - /** A unique eBay-assigned ID for the report. */ - reportId?: string | null; - - /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ - reportName?: string | null; - - /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCompletionDate?: string | null; - - /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCreationDate?: string | null; - - /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskExpectedCompletionDate?: string | null; - - /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ - reportTaskId?: string | null; - - /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ - reportTaskStatus?: string | null; - - /** A status message with additional information about the report task. */ - reportTaskStatusMessage?: string | null; - - /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface ReportTaskPagedCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** A list of report tasks contained on this page from the paginated response. */ - reportTasks?: Array; - } - - - /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ - export interface SummaryReportResponse { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** The date the report was generated. */ - lastUpdated?: string | null; - - /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ - percentageSalesLift?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type specifies the bid percentage for an ad campaign. */ - export interface UpdateBidPercentageRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - } - - - /** This type specifies the updated name, and start and end dates for an update-campaign request. */ - export interface UpdateCampaignIdentificationRequest { - - /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ - campaignName?: string | null; - - /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ - startDate?: string | null; - } - - export class AdClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkCreateAdsByInventoryReference(campaign_id: string, callback: (data : BulkCreateAdsByInventoryReferenceResponse) => any, requestBody: BulkCreateAdsByInventoryReferenceRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @return {BulkAdResponse} Success - */ - BulkCreateAdsByListingId(campaign_id: string, callback: (data : BulkAdResponse) => any, requestBody: BulkCreateAdRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. - * @return {BulkDeleteAdsByInventoryReferenceResponse} Success - */ - BulkDeleteAdsByInventoryReference(campaign_id: string, callback: (data : BulkDeleteAdsByInventoryReferenceResponse) => any, requestBody: BulkDeleteAdsByInventoryReferenceRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. - * @return {BulkDeleteAdResponse} Success - */ - BulkDeleteAdsByListingId(campaign_id: string, callback: (data : BulkDeleteAdResponse) => any, requestBody: BulkDeleteAdRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkUpdateAdsBidByInventoryReference(campaign_id: string, callback: (data : BulkCreateAdsByInventoryReferenceResponse) => any, requestBody: BulkCreateAdsByInventoryReferenceRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. - * @return {BulkAdResponse} Success - */ - BulkUpdateAdsBidByListingId(campaign_id: string, callback: (data : BulkAdResponse) => any, requestBody: BulkCreateAdRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {AdPagedCollection} Success - */ - GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined, callback: (data : AdPagedCollection) => any) { - this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); - } - - /** - * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. - * @return {void} - */ - CreateAdByListingId(campaign_id: string, callback: (data : void) => any, requestBody: CreateAdRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. - * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. - * @return {void} - */ - CreateAdsByInventoryReference(campaign_id: string, callback: (data : void) => any, requestBody: CreateAdsByInventoryReferenceRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. - * Get ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Ad} Success - */ - GetAd(ad_id: string, campaign_id: string, callback: (data : Ad) => any) { - this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), callback, this.error, this.statusCode); - } - - /** - * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. - * Delete ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteAd(ad_id: string, campaign_id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), callback, this.error, this.statusCode); - } - - /** - * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. - * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. - * @return {AdIds} Success - */ - DeleteAdsByInventoryReference(campaign_id: string, callback: (data : AdIds) => any, requestBody: DeleteAdsByInventoryReferenceRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. - * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. - * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. - * @return {Ads} Success - */ - GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string, callback: (data : Ads) => any) { - this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), callback, this.error, this.statusCode); - } - - /** - * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. - * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid - * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. - * @return {void} - */ - UpdateBid(ad_id: string, campaign_id: string, callback: (data : void) => any, requestBody: UpdateBidPercentageRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class CampaignClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). - * Post ad_campaign/{campaign_id}/clone - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. - * @return {void} - */ - CloneCampaign(campaign_id: string, callback: (data : void) => any, requestBody: CloneCampaignRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign - * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name - * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status - * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. - * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. - * @return {CampaignPagedCollection} Success - */ - GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined, callback: (data : CampaignPagedCollection) => any) { - this.httpClient.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), callback, this.error, this.statusCode); - } - - /** - * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. - * Post ad_campaign - * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. - * @return {void} - */ - CreateCampaign(callback: (data : void) => any, requestBody: CreateCampaignRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Campaign} Success - */ - GetCampaign(campaign_id: string, callback: (data : Campaign) => any) { - this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), callback, this.error, this.statusCode); - } - - /** - * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Delete ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteCampaign(campaign_id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), callback, this.error, this.statusCode); - } - - /** - * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/end - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - EndCampaign(campaign_id: string, callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/find_campaign_by_ad_reference - * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} listing_id Identifier of the eBay listing associated with the ad. - * @return {Campaigns} Success - */ - FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined, callback: (data : Campaigns) => any) { - this.httpClient.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), callback, this.error, this.statusCode); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/get_campaign_by_name - * @param {string} campaign_name Name of the campaign. - * @return {Campaign} Success - */ - GetCampaignByName(campaign_name: string, callback: (data : Campaign) => any) { - this.httpClient.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), callback, this.error, this.statusCode); - } - - /** - * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/pause - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - PauseCampaign(campaign_id: string, callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/resume - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - ResumeCampaign(campaign_id: string, callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. - * Post ad_campaign/{campaign_id}/update_campaign_identification - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. - * @return {void} - */ - UpdateCampaignIdentification(campaign_id: string, callback: (data : void) => any, requestBody: UpdateCampaignIdentificationRequest) { - this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Ad_reportClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. - * Get ad_report/{report_id} - * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. - * @return {void} Success - */ - GetReport(report_id: string, callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), callback, this.error, this.statusCode); - } - } - - export class Ad_report_metadataClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. - * Get ad_report_metadata - * @return {ReportMetadatas} Success - */ - GetReportMetadata(callback: (data : ReportMetadatas) => any) { - this.httpClient.get(this.baseUri + 'ad_report_metadata', callback, this.error, this.statusCode); - } - - /** - * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. - * Get ad_report_metadata/{report_type} - * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT - * @return {ReportMetadata} Success - */ - GetReportMetadataForReportType(report_type: string, callback: (data : ReportMetadata) => any) { - this.httpClient.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), callback, this.error, this.statusCode); - } - } - - export class Ad_report_taskClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. - * Get ad_report_task - * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 - * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED - * @return {ReportTaskPagedCollection} Success - */ - GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined, callback: (data : ReportTaskPagedCollection) => any) { - this.httpClient.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), callback, this.error, this.statusCode); - } - - /** - * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. - * Post ad_report_task - * @param {CreateReportTask} requestBody The container for the fields that define the report task. - * @return {void} - */ - CreateReportTask(callback: (data : void) => any, requestBody: CreateReportTask) { - this.httpClient.post(this.baseUri + 'ad_report_task', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Get ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {ReportTask} Success - */ - GetReportTask(report_task_id: string, callback: (data : ReportTask) => any) { - this.httpClient.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), callback, this.error, this.statusCode); - } - - /** - * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Delete ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {void} - */ - DeleteReportTask(report_task_id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), callback, this.error, this.statusCode); - } - } - - export class Item_price_markdownClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. - * Post item_price_markdown - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {void} - */ - CreateItemPriceMarkdownPromotion(callback: (data : void) => any, requestBody: ItemPriceMarkdown) { - this.httpClient.post(this.baseUri + 'item_price_markdown', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPriceMarkdown} Success - */ - GetItemPriceMarkdownPromotion(promotion_id: string, callback: (data : ItemPriceMarkdown) => any) { - this.httpClient.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); - } - - /** - * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. - * Put item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {string} Success - */ - UpdateItemPriceMarkdownPromotion(promotion_id: string, callback: (data : string) => any, requestBody: ItemPriceMarkdown) { - this.httpClient.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. - * Delete item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPriceMarkdownPromotion(promotion_id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); - } - } - - export class Item_promotionClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. - * Post item_promotion - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {void} - */ - CreateItemPromotion(callback: (data : void) => any, requestBody: ItemPromotion) { - this.httpClient.post(this.baseUri + 'item_promotion', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPromotionResponse} Success - */ - GetItemPromotion(promotion_id: string, callback: (data : ItemPromotionResponse) => any) { - this.httpClient.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); - } - - /** - * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. - * Put item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {BaseResponse} Success - */ - UpdateItemPromotion(promotion_id: string, callback: (data : BaseResponse) => any, requestBody: ItemPromotion) { - this.httpClient.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. - * Delete item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPromotion(promotion_id: string, callback: (data : void) => any) { - this.httpClient.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); - } - } - - export class PromotionClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 - * Get promotion/{promotion_id}/get_listing_set - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {string} q Reserved for future use. - * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html - * @return {void} - */ - GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined, callback: (data : void) => any) { - this.httpClient.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), callback, this.error, this.statusCode); - } - - /** - * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 - * Get promotion - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 - * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @return {PromotionsPagedCollection} Success - */ - GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined, callback: (data : PromotionsPagedCollection) => any) { - this.httpClient.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), callback, this.error, this.statusCode); - } - - /** - * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). - * Post promotion/{promotion_id}/pause - * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - PausePromotion(promotion_id: string, callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - - /** - * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. - * Post promotion/{promotion_id}/resume - * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - ResumePromotion(promotion_id: string, callback: (data : void) => any) { - this.httpClient.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - - export class Promotion_reportClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. - * Get promotion_report - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 - * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @return {PromotionsReportPagedCollection} Success - */ - GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, callback: (data : PromotionsReportPagedCollection) => any) { - this.httpClient.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), callback, this.error, this.statusCode); - } - } - - export class Promotion_summary_reportClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. - * Get promotion_summary_report - * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @return {SummaryReportResponse} Success - */ - GetPromotionSummaryReport(marketplace_id: string, callback: (data : SummaryReportResponse) => any) { - this.httpClient.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + + /** This type defines the fields for an ad. */ + export interface Ad { + + /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ + adId?: string | null; + + /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type is a container for a list of ad IDs. */ + export interface AdIds { + + /** A list of ad ID's. */ + adIds?: Array; + } + + + /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface AdPagedCollection { + + /** A list of ads contained on this page from the paginated response. */ + ads?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for an ad ID and its associated URL. */ + export interface AdReference { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** The URI of an ad. You can use this URI to retrieve the ad. */ + href?: string | null; + } + + + /** This type is a container for a list of ad IDs and their associated URIs. */ + export interface AdReferences { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines the fields returned in an ad response. */ + export interface AdResponse { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** An array of errors associated with the request. */ + errors?: Array; + + /** The URI that points to the ad. */ + href?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields returned in an error condition. */ + export interface Error { + + /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** The name of the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ + longMessage?: string | null; + + /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ + message?: string | null; + + /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** A name/value pair that provides parameter details regarding a warning or error condition. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** The value that was set for the element specified in the name field. */ + value?: string | null; + } + + + /** This type defines the container for an array of ads. */ + export interface Ads { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + export interface Amount { + + /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ + value?: string | null; + } + + + /** This type defines the fields for any warning error messages. */ + export interface BaseResponse { + + /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ + warnings?: Array; + } + + + /** This type defines the fields for the create ads in bulk response. */ + export interface BulkAdResponse { + + /** A list of ads processed by the call. */ + responses?: Array; + } + + + /** This type defines the fields for the create ads in bulk by listing IDs. */ + export interface BulkCreateAdRequest { + + /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ + requests?: Array; + } + + + /** This type defines the fields for the create ad request. */ + export interface CreateAdRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ + export interface BulkCreateAdsByInventoryReferenceRequest { + + /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to create ads by inventory reference ID request. */ + export interface CreateAdsByInventoryReferenceRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ + export interface BulkCreateAdsByInventoryReferenceResponse { + + /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ + responses?: Array; + } + + + /** This type defines the fields returned when you create an ad by inventory reference ID. */ + export interface CreateAdsByInventoryReferenceResponse { + + /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ + ads?: Array; + + /** An array of errors or warnings associated with the create-ads request. */ + errors?: Array; + + /** The seller's inventory reference ID that's associated with the ad. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that the call uses to remove ads in bulk. */ + export interface BulkDeleteAdRequest { + + /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + requests?: Array; + } + + + /** This type defines the fields used in a delete-ad request. */ + export interface DeleteAdRequest { + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ + export interface BulkDeleteAdResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned in a delete-ad response. */ + export interface DeleteAdResponse { + + /** The ID of the ad that was deleted. */ + adId?: string | null; + + /** An array of the errors or warnings associated with the request. */ + errors?: Array; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ + export interface BulkDeleteAdsByInventoryReferenceRequest { + + /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ + export interface DeleteAdsByInventoryReferenceRequest { + + /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ + export interface BulkDeleteAdsByInventoryReferenceResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ + export interface DeleteAdsByInventoryReferenceResponse { + + /** The list of ad IDs that were removed from the campaign. */ + adIds?: Array; + + /** The container for the errors associated with the request. */ + errors?: Array; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that describe an ad campaign. */ + export interface Campaign { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ + campaignId?: string | null; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ + campaignStatus?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + export interface CampaignCriterion { + + /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ + criterionType?: string | null; + + /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ + selectionRules?: Array; + } + + + /** This type specifies the selection rules used to create a campaign. */ + export interface SelectionRule { + + /** A list of the brands of the items to be included in the campaign. */ + brands?: Array; + + /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ + categoryIds?: Array; + + /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ + categoryScope?: string | null; + + /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ + listingConditionIds?: Array; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + maxPrice?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minPrice?: Amount; + } + + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + export interface FundingStrategy { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ + fundingModel?: string | null; + } + + + /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface CampaignPagedCollection { + + /** A list of campaigns contained on this page from the paginated response. */ + campaigns?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type contains a list of campaigns. */ + export interface Campaigns { + + /** An array of campaigns and their details. */ + campaigns?: Array; + } + + + /** This type defines the fields needed for a clone-campaign request. */ + export interface CloneCampaignRequest { + + /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ + export interface CreateCampaignRequest { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ + export interface CreateReportTask { + + /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ + dimensions?: Array; + + /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ + inventoryReferences?: Array; + + /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ + listingIds?: Array; + + /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ + metricKeys?: Array; + + /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ + export interface Dimension { + + /** A list of annotations associated with the dimension of the report. */ + annotationKeys?: Array; + + /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ + dimensionKey?: string | null; + } + + + /** This type defines the fields contained in an inventory reference ID. */ + export interface InventoryReference { + + /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ + inventoryReferenceId?: string | null; + + /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ + export interface DimensionKeyAnnotation { + + /** An annotation key associated with the dimension. */ + annotationKey?: string | null; + + /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + } + + + /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ + export interface DimensionMetadata { + + /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the dimension used to create the report. */ + dimensionKey?: string | null; + + /** An list of annotation keys associated with the specified dimension of the report. */ + dimensionKeyAnnotations?: Array; + } + + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + export interface DiscountBenefit { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffItem?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffOrder?: Amount; + + /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ + percentageOffItem?: string | null; + + /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ + percentageOffOrder?: string | null; + } + + + /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ + export interface DiscountRule { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountSpecification?: DiscountSpecification; + + /** + * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + export interface DiscountSpecification { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + forEachAmount?: Amount; + + /** + * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + forEachQuantity?: number | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minAmount?: Amount; + + /** + * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + minQuantity?: number | null; + + /** + * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfDiscountedItems?: number | null; + } + + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + export interface InventoryCriterion { + + /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ + inventoryCriterionType?: string | null; + + /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ + inventoryItems?: Array; + + /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ + listingIds?: Array; + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + ruleCriteria?: RuleCriteria; + } + + + /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ + export interface InventoryItem { + + /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ + inventoryReferenceId?: string | null; + } + + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + export interface RuleCriteria { + + /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeInventoryItems?: Array; + + /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeListingIds?: Array; + + /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ + markupInventoryItems?: Array; + + /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ + markupListingIds?: Array; + + /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ + selectionRules?: Array; + } + + + /** This type defines the fields used to describe an item price markdown promotion. */ + export interface ItemPriceMarkdown { + + /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ + applyFreeShipping?: boolean | null; + + /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ + blockPriceIncreaseInItemRevision?: boolean | null; + + /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ + selectedInventoryDiscounts?: Array; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ + export interface SelectedInventoryDiscount { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ + discountId?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** + * For markdown promotions, this field is reserved for future use. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ + export interface ItemPromotion { + + /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This complex type defines the fields returned for a promotion. */ + export interface ItemPromotionResponse { + + /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the name and data type of a metric. */ + export interface MetricMetadata { + + /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the metric. */ + metricKey?: string | null; + } + + + /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ + export interface PromotionDetail { + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** The URI of the promotion details. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields in a promotion-level report. */ + export interface PromotionReportDetail { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemRevenue?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderRevenue?: Amount; + + /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ + averageOrderSize?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** + * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemsSoldQuantity?: number | null; + + /** + * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfOrdersSold?: number | null; + + /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ + percentageSalesLift?: string | null; + + /** The URI of the promotion report. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ + promotionReportId?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ + promotions?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsReportPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list of promotionReports contained in the paginated result set. */ + promotionReports?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields included in the report. */ + export interface ReportMetadata { + + /** A list containing the metadata for the dimension used in the report. */ + dimensionMetadata?: Array; + + /** + * The maximum number of dimensions that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfDimensionsToRequest?: number | null; + + /** + * The maximum number of metrics that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfMetricsToRequest?: number | null; + + /** A list containing the metadata for the metrics in the report. */ + metricMetadata?: Array; + + /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the metadata used by the all report types. */ + export interface ReportMetadatas { + + /** A list of the metadata for the associated report type. */ + reportMetadata?: Array; + } + + + /** This type defines the fields in a report task. */ + export interface ReportTask { + + /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** A list containing the dimension in the report. */ + dimensions?: Array; + + /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ + inventoryReferences?: Array; + + /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingIds?: Array; + + /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A list of metrics for the report task. */ + metricKeys?: Array; + + /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportExpirationDate?: string | null; + + /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The URL of the generated report, which can be used to download the report once it has been generated. */ + reportHref?: string | null; + + /** A unique eBay-assigned ID for the report. */ + reportId?: string | null; + + /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ + reportName?: string | null; + + /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCompletionDate?: string | null; + + /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCreationDate?: string | null; + + /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskExpectedCompletionDate?: string | null; + + /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ + reportTaskId?: string | null; + + /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ + reportTaskStatus?: string | null; + + /** A status message with additional information about the report task. */ + reportTaskStatusMessage?: string | null; + + /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface ReportTaskPagedCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** A list of report tasks contained on this page from the paginated response. */ + reportTasks?: Array; + } + + + /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ + export interface SummaryReportResponse { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** The date the report was generated. */ + lastUpdated?: string | null; + + /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ + percentageSalesLift?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type specifies the bid percentage for an ad campaign. */ + export interface UpdateBidPercentageRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + } + + + /** This type specifies the updated name, and start and end dates for an update-campaign request. */ + export interface UpdateCampaignIdentificationRequest { + + /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ + campaignName?: string | null; + + /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ + startDate?: string | null; + } + + export class AdClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkCreateAdsByInventoryReference(campaign_id: string, callback: (data : BulkCreateAdsByInventoryReferenceResponse) => any, requestBody: BulkCreateAdsByInventoryReferenceRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @return {BulkAdResponse} Success + */ + BulkCreateAdsByListingId(campaign_id: string, callback: (data : BulkAdResponse) => any, requestBody: BulkCreateAdRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. + * @return {BulkDeleteAdsByInventoryReferenceResponse} Success + */ + BulkDeleteAdsByInventoryReference(campaign_id: string, callback: (data : BulkDeleteAdsByInventoryReferenceResponse) => any, requestBody: BulkDeleteAdsByInventoryReferenceRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. + * @return {BulkDeleteAdResponse} Success + */ + BulkDeleteAdsByListingId(campaign_id: string, callback: (data : BulkDeleteAdResponse) => any, requestBody: BulkDeleteAdRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkUpdateAdsBidByInventoryReference(campaign_id: string, callback: (data : BulkCreateAdsByInventoryReferenceResponse) => any, requestBody: BulkCreateAdsByInventoryReferenceRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. + * @return {BulkAdResponse} Success + */ + BulkUpdateAdsBidByListingId(campaign_id: string, callback: (data : BulkAdResponse) => any, requestBody: BulkCreateAdRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {AdPagedCollection} Success + */ + GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined, callback: (data : AdPagedCollection) => any) { + this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); + } + + /** + * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. + * @return {void} + */ + CreateAdByListingId(campaign_id: string, callback: (data : void) => any, requestBody: CreateAdRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. + * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. + * @return {void} + */ + CreateAdsByInventoryReference(campaign_id: string, callback: (data : void) => any, requestBody: CreateAdsByInventoryReferenceRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. + * Get ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Ad} Success + */ + GetAd(ad_id: string, campaign_id: string, callback: (data : Ad) => any) { + this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), callback, this.error, this.statusCode); + } + + /** + * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. + * Delete ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteAd(ad_id: string, campaign_id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), callback, this.error, this.statusCode); + } + + /** + * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. + * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. + * @return {AdIds} Success + */ + DeleteAdsByInventoryReference(campaign_id: string, callback: (data : AdIds) => any, requestBody: DeleteAdsByInventoryReferenceRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. + * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. + * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. + * @return {Ads} Success + */ + GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string, callback: (data : Ads) => any) { + this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), callback, this.error, this.statusCode); + } + + /** + * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. + * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid + * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. + * @return {void} + */ + UpdateBid(ad_id: string, campaign_id: string, callback: (data : void) => any, requestBody: UpdateBidPercentageRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class CampaignClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). + * Post ad_campaign/{campaign_id}/clone + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. + * @return {void} + */ + CloneCampaign(campaign_id: string, callback: (data : void) => any, requestBody: CloneCampaignRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign + * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name + * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status + * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. + * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. + * @return {CampaignPagedCollection} Success + */ + GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined, callback: (data : CampaignPagedCollection) => any) { + this.httpClient.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), callback, this.error, this.statusCode); + } + + /** + * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. + * Post ad_campaign + * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. + * @return {void} + */ + CreateCampaign(callback: (data : void) => any, requestBody: CreateCampaignRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Campaign} Success + */ + GetCampaign(campaign_id: string, callback: (data : Campaign) => any) { + this.httpClient.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), callback, this.error, this.statusCode); + } + + /** + * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Delete ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteCampaign(campaign_id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), callback, this.error, this.statusCode); + } + + /** + * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/end + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + EndCampaign(campaign_id: string, callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/find_campaign_by_ad_reference + * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} listing_id Identifier of the eBay listing associated with the ad. + * @return {Campaigns} Success + */ + FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined, callback: (data : Campaigns) => any) { + this.httpClient.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), callback, this.error, this.statusCode); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/get_campaign_by_name + * @param {string} campaign_name Name of the campaign. + * @return {Campaign} Success + */ + GetCampaignByName(campaign_name: string, callback: (data : Campaign) => any) { + this.httpClient.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), callback, this.error, this.statusCode); + } + + /** + * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/pause + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + PauseCampaign(campaign_id: string, callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/resume + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + ResumeCampaign(campaign_id: string, callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. + * Post ad_campaign/{campaign_id}/update_campaign_identification + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. + * @return {void} + */ + UpdateCampaignIdentification(campaign_id: string, callback: (data : void) => any, requestBody: UpdateCampaignIdentificationRequest) { + this.httpClient.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Ad_reportClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. + * Get ad_report/{report_id} + * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. + * @return {void} Success + */ + GetReport(report_id: string, callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), callback, this.error, this.statusCode); + } + } + + export class Ad_report_metadataClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. + * Get ad_report_metadata + * @return {ReportMetadatas} Success + */ + GetReportMetadata(callback: (data : ReportMetadatas) => any) { + this.httpClient.get(this.baseUri + 'ad_report_metadata', callback, this.error, this.statusCode); + } + + /** + * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. + * Get ad_report_metadata/{report_type} + * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT + * @return {ReportMetadata} Success + */ + GetReportMetadataForReportType(report_type: string, callback: (data : ReportMetadata) => any) { + this.httpClient.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), callback, this.error, this.statusCode); + } + } + + export class Ad_report_taskClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. + * Get ad_report_task + * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 + * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED + * @return {ReportTaskPagedCollection} Success + */ + GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined, callback: (data : ReportTaskPagedCollection) => any) { + this.httpClient.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), callback, this.error, this.statusCode); + } + + /** + * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. + * Post ad_report_task + * @param {CreateReportTask} requestBody The container for the fields that define the report task. + * @return {void} + */ + CreateReportTask(callback: (data : void) => any, requestBody: CreateReportTask) { + this.httpClient.post(this.baseUri + 'ad_report_task', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Get ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {ReportTask} Success + */ + GetReportTask(report_task_id: string, callback: (data : ReportTask) => any) { + this.httpClient.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), callback, this.error, this.statusCode); + } + + /** + * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Delete ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {void} + */ + DeleteReportTask(report_task_id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), callback, this.error, this.statusCode); + } + } + + export class Item_price_markdownClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. + * Post item_price_markdown + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {void} + */ + CreateItemPriceMarkdownPromotion(callback: (data : void) => any, requestBody: ItemPriceMarkdown) { + this.httpClient.post(this.baseUri + 'item_price_markdown', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPriceMarkdown} Success + */ + GetItemPriceMarkdownPromotion(promotion_id: string, callback: (data : ItemPriceMarkdown) => any) { + this.httpClient.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); + } + + /** + * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. + * Put item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {string} Success + */ + UpdateItemPriceMarkdownPromotion(promotion_id: string, callback: (data : string) => any, requestBody: ItemPriceMarkdown) { + this.httpClient.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. + * Delete item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPriceMarkdownPromotion(promotion_id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); + } + } + + export class Item_promotionClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. + * Post item_promotion + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {void} + */ + CreateItemPromotion(callback: (data : void) => any, requestBody: ItemPromotion) { + this.httpClient.post(this.baseUri + 'item_promotion', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPromotionResponse} Success + */ + GetItemPromotion(promotion_id: string, callback: (data : ItemPromotionResponse) => any) { + this.httpClient.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); + } + + /** + * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. + * Put item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {BaseResponse} Success + */ + UpdateItemPromotion(promotion_id: string, callback: (data : BaseResponse) => any, requestBody: ItemPromotion) { + this.httpClient.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. + * Delete item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPromotion(promotion_id: string, callback: (data : void) => any) { + this.httpClient.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), callback, this.error, this.statusCode); + } + } + + export class PromotionClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 + * Get promotion/{promotion_id}/get_listing_set + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {string} q Reserved for future use. + * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html + * @return {void} + */ + GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined, callback: (data : void) => any) { + this.httpClient.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), callback, this.error, this.statusCode); + } + + /** + * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 + * Get promotion + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 + * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @return {PromotionsPagedCollection} Success + */ + GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined, callback: (data : PromotionsPagedCollection) => any) { + this.httpClient.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), callback, this.error, this.statusCode); + } + + /** + * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). + * Post promotion/{promotion_id}/pause + * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + PausePromotion(promotion_id: string, callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + + /** + * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. + * Post promotion/{promotion_id}/resume + * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + ResumePromotion(promotion_id: string, callback: (data : void) => any) { + this.httpClient.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + + export class Promotion_reportClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. + * Get promotion_report + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 + * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @return {PromotionsReportPagedCollection} Success + */ + GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, callback: (data : PromotionsReportPagedCollection) => any) { + this.httpClient.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), callback, this.error, this.statusCode); + } + } + + export class Promotion_summary_reportClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. + * Get promotion_summary_report + * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @return {SummaryReportResponse} Success + */ + GetPromotionSummaryReport(marketplace_id: string, callback: (data : SummaryReportResponse) => any) { + this.httpClient.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_metadata.txt b/Tests/SwagTsTests/JqResults/sell_metadata.ts similarity index 98% rename from Tests/SwagTsTests/JqResults/sell_metadata.txt rename to Tests/SwagTsTests/JqResults/sell_metadata.ts index 595b6ae0..85be454c 100644 --- a/Tests/SwagTsTests/JqResults/sell_metadata.txt +++ b/Tests/SwagTsTests/JqResults/sell_metadata.ts @@ -1,363 +1,363 @@ -/// -export namespace MyNS { - - /** A unique ID for a sales tax jurisdiction. */ - export interface SalesTaxJurisdiction { - - /** The unique ID for a sales tax jurisdiction. */ - salesTaxJurisdictionId?: string | null; - } - - - /** This complex type contains a list of sales tax jurisdictions. */ - export interface SalesTaxJurisdictions { - - /** A list of sales tax jurisdictions. */ - salesTaxJurisdictions?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An amount of time, as measured by the time-measurement units specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for a error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - export interface AutomotivePartsCompatibilityPolicy { - - /** The category ID to which the automotive-parts-compatibility policies apply. */ - categoryId?: string | null; - - /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ - compatibilityBasedOn?: string | null; - - /** Indicates the compatibility classification of the part based on high-level vehicle types. */ - compatibleVehicleTypes?: Array; - - /** - * Specifies the maximum number of compatible vehicle-applications allowed per item. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfCompatibleVehicles?: number | null; - } - - export interface AutomotivePartsCompatibilityPolicyResponse { - - /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ - automotivePartsCompatibilityPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - export interface Exclusion { - - /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ - brands?: Array; - } - - export interface ItemCondition { - - /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ - conditionDescription?: string | null; - - /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ - conditionId?: string | null; - } - - export interface ItemConditionPolicy { - - /** The category ID to which the item-condition policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ - itemConditionRequired?: boolean | null; - - /** The item-condition values allowed in the category. */ - itemConditions?: Array; - } - - export interface ItemConditionPolicyResponse { - - /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ - itemConditionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ListingStructurePolicy { - - /** The category ID to which the listing-structure policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ - variationsSupported?: boolean | null; - } - - export interface ListingStructurePolicyResponse { - - /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ - listingStructurePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface NegotiatedPricePolicy { - - /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ - bestOfferAutoAcceptEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ - bestOfferAutoDeclineEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ - bestOfferCounterEnabled?: boolean | null; - - /** The category ID to which the negotiated-price policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - } - - export interface NegotiatedPricePolicyResponse { - - /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ - negotiatedPricePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ - export interface ProductAdoptionPolicy { - - /** The category ID to which the listing policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - exclusion?: Exclusion; - - /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ - productRequired?: boolean | null; - } - - - /** This is the response object returned by a call to getProductAdoptionPolicies. */ - export interface ProductAdoptionPolicyResponse { - - /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ - productAdoptionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ReturnPolicy { - - /** The category ID to which the return policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - domestic?: ReturnPolicyDetails; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - international?: ReturnPolicyDetails; - - /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ - required?: boolean | null; - } - - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - export interface ReturnPolicyDetails { - - /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ - policyDescriptionEnabled?: boolean | null; - - /** A list of refund methods allowed for the associated category. */ - refundMethods?: Array; - - /** A list of return methods allowed for the associated category. */ - returnMethods?: Array; - - /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ - returnPeriods?: Array; - - /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ - returnsAcceptanceEnabled?: boolean | null; - - /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ - returnShippingCostPayers?: Array; - } - - export interface ReturnPolicyResponse { - - /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ - returnPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export class CountryClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. - * Get country/{countryCode}/sales_tax_jurisdiction - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. - * @return {SalesTaxJurisdictions} Success - */ - GetSalesTaxJurisdictions(countryCode: string, callback: (data : SalesTaxJurisdictions) => any) { - this.httpClient.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', callback, this.error, this.statusCode); - } - } - - export class MarketplaceClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT - * @return {AutomotivePartsCompatibilityPolicyResponse} Success - */ - GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : AutomotivePartsCompatibilityPolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - - /** - * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_item_condition_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ItemConditionPolicyResponse} Success - */ - GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ItemConditionPolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - - /** - * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_listing_structure_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ListingStructurePolicyResponse} Success - */ - GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ListingStructurePolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - - /** - * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_negotiated_price_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {NegotiatedPricePolicyResponse} Success - */ - GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : NegotiatedPricePolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - - /** - * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_product_adoption_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ProductAdoptionPolicyResponse} Success - */ - GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ProductAdoptionPolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - - /** - * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_return_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ReturnPolicyResponse) => any) { - this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); - } - } - -} - +/// +export namespace MyNS { + + /** A unique ID for a sales tax jurisdiction. */ + export interface SalesTaxJurisdiction { + + /** The unique ID for a sales tax jurisdiction. */ + salesTaxJurisdictionId?: string | null; + } + + + /** This complex type contains a list of sales tax jurisdictions. */ + export interface SalesTaxJurisdictions { + + /** A list of sales tax jurisdictions. */ + salesTaxJurisdictions?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An amount of time, as measured by the time-measurement units specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for a error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + export interface AutomotivePartsCompatibilityPolicy { + + /** The category ID to which the automotive-parts-compatibility policies apply. */ + categoryId?: string | null; + + /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ + compatibilityBasedOn?: string | null; + + /** Indicates the compatibility classification of the part based on high-level vehicle types. */ + compatibleVehicleTypes?: Array; + + /** + * Specifies the maximum number of compatible vehicle-applications allowed per item. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfCompatibleVehicles?: number | null; + } + + export interface AutomotivePartsCompatibilityPolicyResponse { + + /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ + automotivePartsCompatibilityPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + export interface Exclusion { + + /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ + brands?: Array; + } + + export interface ItemCondition { + + /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ + conditionDescription?: string | null; + + /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ + conditionId?: string | null; + } + + export interface ItemConditionPolicy { + + /** The category ID to which the item-condition policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ + itemConditionRequired?: boolean | null; + + /** The item-condition values allowed in the category. */ + itemConditions?: Array; + } + + export interface ItemConditionPolicyResponse { + + /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ + itemConditionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ListingStructurePolicy { + + /** The category ID to which the listing-structure policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ + variationsSupported?: boolean | null; + } + + export interface ListingStructurePolicyResponse { + + /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ + listingStructurePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface NegotiatedPricePolicy { + + /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ + bestOfferAutoAcceptEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ + bestOfferAutoDeclineEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ + bestOfferCounterEnabled?: boolean | null; + + /** The category ID to which the negotiated-price policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + } + + export interface NegotiatedPricePolicyResponse { + + /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ + negotiatedPricePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ + export interface ProductAdoptionPolicy { + + /** The category ID to which the listing policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + exclusion?: Exclusion; + + /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ + productRequired?: boolean | null; + } + + + /** This is the response object returned by a call to getProductAdoptionPolicies. */ + export interface ProductAdoptionPolicyResponse { + + /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ + productAdoptionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ReturnPolicy { + + /** The category ID to which the return policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + domestic?: ReturnPolicyDetails; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + international?: ReturnPolicyDetails; + + /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ + required?: boolean | null; + } + + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + export interface ReturnPolicyDetails { + + /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ + policyDescriptionEnabled?: boolean | null; + + /** A list of refund methods allowed for the associated category. */ + refundMethods?: Array; + + /** A list of return methods allowed for the associated category. */ + returnMethods?: Array; + + /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ + returnPeriods?: Array; + + /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ + returnsAcceptanceEnabled?: boolean | null; + + /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ + returnShippingCostPayers?: Array; + } + + export interface ReturnPolicyResponse { + + /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ + returnPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export class CountryClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. + * Get country/{countryCode}/sales_tax_jurisdiction + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. + * @return {SalesTaxJurisdictions} Success + */ + GetSalesTaxJurisdictions(countryCode: string, callback: (data : SalesTaxJurisdictions) => any) { + this.httpClient.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', callback, this.error, this.statusCode); + } + } + + export class MarketplaceClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT + * @return {AutomotivePartsCompatibilityPolicyResponse} Success + */ + GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : AutomotivePartsCompatibilityPolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + + /** + * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_item_condition_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ItemConditionPolicyResponse} Success + */ + GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ItemConditionPolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + + /** + * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_listing_structure_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ListingStructurePolicyResponse} Success + */ + GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ListingStructurePolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + + /** + * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_negotiated_price_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {NegotiatedPricePolicyResponse} Success + */ + GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : NegotiatedPricePolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + + /** + * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_product_adoption_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ProductAdoptionPolicyResponse} Success + */ + GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ProductAdoptionPolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + + /** + * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_return_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(filter: string | null | undefined, marketplace_id: string, callback: (data : ReturnPolicyResponse) => any) { + this.httpClient.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), callback, this.error, this.statusCode); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_negotiation.txt b/Tests/SwagTsTests/JqResults/sell_negotiation.ts similarity index 98% rename from Tests/SwagTsTests/JqResults/sell_negotiation.txt rename to Tests/SwagTsTests/JqResults/sell_negotiation.ts index 4ced6e57..6c58b05b 100644 --- a/Tests/SwagTsTests/JqResults/sell_negotiation.txt +++ b/Tests/SwagTsTests/JqResults/sell_negotiation.ts @@ -1,236 +1,236 @@ -/// -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ - export interface CreateOffersRequest { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ - allowCounterOffer?: boolean | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ - offeredItems?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A complex type that defines the offer being made to an "interested" buyer. */ - export interface OfferedItem { - - /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ - discountPercentage?: string | null; - - /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ - listingId?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - price?: Amount; - - /** - * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ - export interface EligibleItem { - - /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ - listingId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** A complex type that defines an offer that a seller makes to eligible buyers. */ - export interface Offer { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ - allowCounterOffer?: boolean | null; - - /** This complex type identifies an eBay user. */ - buyer?: User; - - /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - creationDate?: string | null; - - /** The eBay UserName of the user (seller) who initiated the offer. */ - initiatedBy?: string | null; - - /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ - lastModifiedDate?: string | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ - offeredItems?: Array; - - /** A unique eBay-assigned identifier for the offer. */ - offerId?: string | null; - - /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ - offerStatus?: string | null; - - /** The type of offer being made. For implementation help, refer to eBay API documentation */ - offerType?: string | null; - - /** A unique, eBay-assigned ID for the revision of the offer. */ - revision?: string | null; - } - - - /** This complex type identifies an eBay user. */ - export interface User { - - /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ - maskedUsername?: string | null; - } - - - /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ - export interface PagedEligibleItemCollection { - - /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ - eligibleItems?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object returned from a SendOfferToInterestedBuyers request. */ - export interface SendOfferToInterestedBuyersCollectionResponse { - - /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ - offers?: Array; - } - - export class OfferClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Get find_eligible_items - * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 - * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {PagedEligibleItemCollection} Success - */ - FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined, callback: (data : PagedEligibleItemCollection) => any) { - this.httpClient.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); - } - - /** - * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Post send_offer_to_interested_buyers - * @param {CreateOffersRequest} requestBody Send offer to eligible items request. - * @return {SendOfferToInterestedBuyersCollectionResponse} Success - */ - SendOfferToInterestedBuyers(callback: (data : SendOfferToInterestedBuyersCollectionResponse) => any, requestBody: CreateOffersRequest) { - this.httpClient.post(this.baseUri + 'send_offer_to_interested_buyers', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - -} - +/// +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ + export interface CreateOffersRequest { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ + allowCounterOffer?: boolean | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ + offeredItems?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A complex type that defines the offer being made to an "interested" buyer. */ + export interface OfferedItem { + + /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ + discountPercentage?: string | null; + + /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ + listingId?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + price?: Amount; + + /** + * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ + export interface EligibleItem { + + /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ + listingId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** A complex type that defines an offer that a seller makes to eligible buyers. */ + export interface Offer { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ + allowCounterOffer?: boolean | null; + + /** This complex type identifies an eBay user. */ + buyer?: User; + + /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + creationDate?: string | null; + + /** The eBay UserName of the user (seller) who initiated the offer. */ + initiatedBy?: string | null; + + /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ + lastModifiedDate?: string | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ + offeredItems?: Array; + + /** A unique eBay-assigned identifier for the offer. */ + offerId?: string | null; + + /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ + offerStatus?: string | null; + + /** The type of offer being made. For implementation help, refer to eBay API documentation */ + offerType?: string | null; + + /** A unique, eBay-assigned ID for the revision of the offer. */ + revision?: string | null; + } + + + /** This complex type identifies an eBay user. */ + export interface User { + + /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ + maskedUsername?: string | null; + } + + + /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ + export interface PagedEligibleItemCollection { + + /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ + eligibleItems?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object returned from a SendOfferToInterestedBuyers request. */ + export interface SendOfferToInterestedBuyersCollectionResponse { + + /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ + offers?: Array; + } + + export class OfferClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Get find_eligible_items + * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 + * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {PagedEligibleItemCollection} Success + */ + FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined, callback: (data : PagedEligibleItemCollection) => any) { + this.httpClient.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), callback, this.error, this.statusCode); + } + + /** + * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Post send_offer_to_interested_buyers + * @param {CreateOffersRequest} requestBody Send offer to eligible items request. + * @return {SendOfferToInterestedBuyersCollectionResponse} Success + */ + SendOfferToInterestedBuyers(callback: (data : SendOfferToInterestedBuyersCollectionResponse) => any, requestBody: CreateOffersRequest) { + this.httpClient.post(this.baseUri + 'send_offer_to_interested_buyers', requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + +} + diff --git a/Tests/SwagTsTests/JqResults/sell_recommendation.txt b/Tests/SwagTsTests/JqResults/sell_recommendation.ts similarity index 98% rename from Tests/SwagTsTests/JqResults/sell_recommendation.txt rename to Tests/SwagTsTests/JqResults/sell_recommendation.ts index 85617cff..5d00d14d 100644 --- a/Tests/SwagTsTests/JqResults/sell_recommendation.txt +++ b/Tests/SwagTsTests/JqResults/sell_recommendation.ts @@ -1,160 +1,160 @@ -/// -export namespace MyNS { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - export interface Ad { - - /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ - bidPercentages?: Array; - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - promoteWithAd?: PromoteWithAd; - } - - - /** A complex type that returns data related to Promoted Listings bid percentages. */ - export interface BidPercentages { - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - basis?: Basis; - - /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ - value?: string | null; - } - - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - export enum Basis { TRENDING = 0 } - - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ - export interface FindListingRecommendationRequest { - - /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ - listingIds?: Array; - } - - - /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ - export interface ListingRecommendation { - - /** An ID that identifies the active listing associated with the eBay recommendations. */ - listingId?: string | null; - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - marketing?: MarketingRecommendation; - } - - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - export interface MarketingRecommendation { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - ad?: Ad; - - /** A message that can conditionally accompany the listing information. */ - message?: string | null; - } - - - /** The high-level object used to return a set of Promoted Listings ad recommendations. */ - export interface PagedListingRecommendationCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ - listingRecommendations?: Array; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - export class Listing_recommendationClient { - constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { - } - - /** - * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. - * Post find - * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} - * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {void} Success - */ - FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : void) => any, requestBody: FindListingRecommendationRequest) { - this.httpClient.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); - } - } - -} - +/// +export namespace MyNS { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + export interface Ad { + + /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ + bidPercentages?: Array; + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + promoteWithAd?: PromoteWithAd; + } + + + /** A complex type that returns data related to Promoted Listings bid percentages. */ + export interface BidPercentages { + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + basis?: Basis; + + /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ + value?: string | null; + } + + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + export enum Basis { TRENDING = 0 } + + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ + export interface FindListingRecommendationRequest { + + /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ + listingIds?: Array; + } + + + /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ + export interface ListingRecommendation { + + /** An ID that identifies the active listing associated with the eBay recommendations. */ + listingId?: string | null; + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + marketing?: MarketingRecommendation; + } + + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + export interface MarketingRecommendation { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + ad?: Ad; + + /** A message that can conditionally accompany the listing information. */ + message?: string | null; + } + + + /** The high-level object used to return a set of Promoted Listings ad recommendations. */ + export interface PagedListingRecommendationCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ + listingRecommendations?: Array; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + export class Listing_recommendationClient { + constructor(private baseUri: string = HttpClient.locationOrigin, private httpClient: HttpClientBase = new HttpClient(), private error?: (xhr: JQueryXHR, ajaxOptions: string, thrown: string) => any, private statusCode?: { [key: string]: any; }) { + } + + /** + * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. + * Post find + * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} + * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {void} Success + */ + FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, callback: (data : void) => any, requestBody: FindListingRecommendationRequest) { + this.httpClient.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), requestBody, callback, this.error, this.statusCode, 'application/json;charset=UTF-8'); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/AirOne.txt b/Tests/SwagTsTests/NG2FormGroupResults/AirOne.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/AirOne.txt rename to Tests/SwagTsTests/NG2FormGroupResults/AirOne.ts index 89a2e74e..98b369e9 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/AirOne.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/AirOne.ts @@ -1,1369 +1,1369 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ProviderIdentifierType { - - /** Vaccination provider number such as Medicare provider number or AIR provider number. */ - providerNumber: string; - hpioNumber?: string | null; - hpiiNumber?: string | null; - } - export interface ProviderIdentifierTypeFormProperties { - - /** Vaccination provider number such as Medicare provider number or AIR provider number. */ - providerNumber: FormControl, - hpioNumber: FormControl, - hpiiNumber: FormControl, - } - export function CreateProviderIdentifierTypeFormGroup() { - return new FormGroup({ - providerNumber: new FormControl(undefined, [Validators.required, Validators.minLength(6), Validators.maxLength(8)]), - hpioNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), - hpiiNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), - }); - - } - - export interface AccessType { - code: string; - name?: string | null; - hasAccess: boolean; - } - export interface AccessTypeFormProperties { - code: FormControl, - name: FormControl, - hasAccess: FormControl, - } - export function CreateAccessTypeFormGroup() { - return new FormGroup({ - code: new FormControl(undefined, [Validators.required]), - name: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(255)]), - hasAccess: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface AirAccessListRequestType { - informationProvider: ProviderIdentifierType; - } - export interface AirAccessListRequestTypeFormProperties { - } - export function CreateAirAccessListRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface AirAccessListResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - accessList?: Array; - errors?: Array; - } - export interface AirAccessListResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateAirAccessListResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface ErrorMessageType { - - /** Error code */ - code: string; - - /** Error field name */ - field?: string | null; - - /** Error message details */ - message?: string | null; - } - export interface ErrorMessageTypeFormProperties { - - /** Error code */ - code: FormControl, - - /** Error field name */ - field: FormControl, - - /** Error message details */ - message: FormControl, - } - export function CreateErrorMessageTypeFormGroup() { - return new FormGroup({ - code: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - field: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface MedicareCardType { - - /** Individual's Medicare card number */ - medicareCardNumber: string; - - /** Medicare Individual Reference Number */ - medicareIRN?: string | null; - } - export interface MedicareCardTypeFormProperties { - - /** Individual's Medicare card number */ - medicareCardNumber: FormControl, - - /** Medicare Individual Reference Number */ - medicareIRN: FormControl, - } - export function CreateMedicareCardTypeFormGroup() { - return new FormGroup({ - medicareCardNumber: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - medicareIRN: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface PersonalDetailsType { - - /** Individual's date of birth in format DDMMYYYY */ - dateOfBirth: string; - - /** Individual' First Name */ - firstName?: string | null; - - /** Individual' Last Name */ - lastName: string; - - /** Individual's gender */ - gender?: string | null; - } - export interface PersonalDetailsTypeFormProperties { - - /** Individual's date of birth in format DDMMYYYY */ - dateOfBirth: FormControl, - - /** Individual' First Name */ - firstName: FormControl, - - /** Individual' Last Name */ - lastName: FormControl, - - /** Individual's gender */ - gender: FormControl, - } - export function CreatePersonalDetailsTypeFormGroup() { - return new FormGroup({ - dateOfBirth: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), - firstName: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), - lastName: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(40)]), - gender: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface SearchAddressType { - postCode: string; - } - export interface SearchAddressTypeFormProperties { - postCode: FormControl, - } - export function CreateSearchAddressTypeFormGroup() { - return new FormGroup({ - postCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - }); - - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postCode: string; - } - export interface AddressTypeFormProperties { - addressLineOne: FormControl, - addressLineTwo: FormControl, - locality: FormControl, - postCode: FormControl, - } - export function CreateAddressTypeFormGroup() { - return new FormGroup({ - addressLineOne: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), - addressLineTwo: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(40)]), - locality: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), - postCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - }); - - } - - export interface IndividualType { - personalDetails?: PersonalDetailsType; - medicareCard?: MedicareCardType; - address?: SearchAddressType; - ihiNumber?: string | null; - } - export interface IndividualTypeFormProperties { - ihiNumber: FormControl, - } - export function CreateIndividualTypeFormGroup() { - return new FormGroup({ - ihiNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), - }); - - } - - export interface ResponseIndividualType { - personalDetails?: PersonalDetailsType; - medicareCard?: MedicareCardType; - address?: AddressType; - } - export interface ResponseIndividualTypeFormProperties { - } - export function CreateResponseIndividualTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface IndividualDetailsType { - individualIdentifier?: string | null; - individual?: ResponseIndividualType; - - /** Individual's catchup date in format DDMMYYYY */ - catchupDate?: string | null; - endDateCode?: string | null; - indigenousStatus?: boolean | null; - additionalVaccineIndicator?: boolean | null; - medContraindicationIndicator?: boolean | null; - naturalImmunityIndicator?: boolean | null; - vaccineTrialIndicator?: boolean | null; - actionRequiredIndicator?: boolean | null; - } - export interface IndividualDetailsTypeFormProperties { - individualIdentifier: FormControl, - - /** Individual's catchup date in format DDMMYYYY */ - catchupDate: FormControl, - endDateCode: FormControl, - indigenousStatus: FormControl, - additionalVaccineIndicator: FormControl, - medContraindicationIndicator: FormControl, - naturalImmunityIndicator: FormControl, - vaccineTrialIndicator: FormControl, - actionRequiredIndicator: FormControl, - } - export function CreateIndividualDetailsTypeFormGroup() { - return new FormGroup({ - individualIdentifier: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(128)]), - catchupDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - endDateCode: new FormControl(undefined), - indigenousStatus: new FormControl(undefined), - additionalVaccineIndicator: new FormControl(undefined), - medContraindicationIndicator: new FormControl(undefined), - naturalImmunityIndicator: new FormControl(undefined), - vaccineTrialIndicator: new FormControl(undefined), - actionRequiredIndicator: new FormControl(undefined), - }); - - } - - export interface IdentifyIndividualRequestType { - individual: IndividualType; - informationProvider: ProviderIdentifierType; - } - export interface IdentifyIndividualRequestTypeFormProperties { - } - export function CreateIdentifyIndividualRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface IndividualDetailsResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - individualDetails?: IndividualDetailsType; - errors?: Array; - } - export interface IndividualDetailsResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateIndividualDetailsResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface AdditionalVaccineIndicatorRequestType { - individualIdentifier: string; - acknowledgement: boolean; - informationProvider: ProviderIdentifierType; - } - export interface AdditionalVaccineIndicatorRequestTypeFormProperties { - individualIdentifier: FormControl, - acknowledgement: FormControl, - } - export function CreateAdditionalVaccineIndicatorRequestTypeFormGroup() { - return new FormGroup({ - individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), - acknowledgement: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface AdditionalVaccineIndicatorResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - export interface AdditionalVaccineIndicatorResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateAdditionalVaccineIndicatorResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface DueVaccineType { - disease?: string | null; - vaccineDose?: string | null; - - /** Due date in format DDMMYYYY */ - dueDate?: string | null; - } - export interface DueVaccineTypeFormProperties { - disease: FormControl, - vaccineDose: FormControl, - - /** Due date in format DDMMYYYY */ - dueDate: FormControl, - } - export function CreateDueVaccineTypeFormGroup() { - return new FormGroup({ - disease: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), - vaccineDose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - dueDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface EncounterHistoryType { - - /** Claim id of the encounter */ - claimId: string; - - /** Claim sequence number of the encounter */ - claimSeqNum: number; - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: number; - episodes?: Array; - editable?: boolean | null; - - /** Date submitted in format DDMMYYYY */ - dateOfService?: string | null; - - /** Date submitted in format DDMMYYYY */ - dateSubmitted?: string | null; - schoolId?: string | null; - } - export interface EncounterHistoryTypeFormProperties { - - /** Claim id of the encounter */ - claimId: FormControl, - - /** Claim sequence number of the encounter */ - claimSeqNum: FormControl, - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: FormControl, - editable: FormControl, - - /** Date submitted in format DDMMYYYY */ - dateOfService: FormControl, - - /** Date submitted in format DDMMYYYY */ - dateSubmitted: FormControl, - schoolId: FormControl, - } - export function CreateEncounterHistoryTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.required]), - claimSeqNum: new FormControl(undefined, [Validators.required]), - immEncSeqNum: new FormControl(undefined, [Validators.required]), - editable: new FormControl(undefined), - dateOfService: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - dateSubmitted: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), - }); - - } - - export interface EpisodeResponseType { - id: number; - vaccineCode: string; - vaccineDose?: string | null; - vaccineBatch?: string | null; - vaccineSerialNumber?: string | null; - actionRequiredIndicator: boolean; - editable: boolean; - information?: InformationType; - } - export interface EpisodeResponseTypeFormProperties { - id: FormControl, - vaccineCode: FormControl, - vaccineDose: FormControl, - vaccineBatch: FormControl, - vaccineSerialNumber: FormControl, - actionRequiredIndicator: FormControl, - editable: FormControl, - } - export function CreateEpisodeResponseTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required]), - vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), - vaccineDose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - vaccineBatch: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(15)]), - vaccineSerialNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(108)]), - actionRequiredIndicator: new FormControl(undefined, [Validators.required]), - editable: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface ImmunisationDetailsResponseType { - dueList?: Array; - encounters?: Array; - } - export interface ImmunisationDetailsResponseTypeFormProperties { - } - export function CreateImmunisationDetailsResponseTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface AirHistoryRequestType { - individualIdentifier: string; - informationProvider: ProviderIdentifierType; - } - export interface AirHistoryRequestTypeFormProperties { - individualIdentifier: FormControl, - } - export function CreateAirHistoryRequestTypeFormGroup() { - return new FormGroup({ - individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), - }); - - } - - export interface ImmunisationHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - immunisationDetails?: ImmunisationDetailsResponseType; - errors?: Array; - } - export interface ImmunisationHistoryResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateImmunisationHistoryResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface InformationType { - status: string; - code?: string | null; - text?: string | null; - messageCode?: string | null; - messageText?: string | null; - } - export interface InformationTypeFormProperties { - status: FormControl, - code: FormControl, - text: FormControl, - messageCode: FormControl, - messageText: FormControl, - } - export function CreateInformationTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(20)]), - code: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(10)]), - text: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - messageCode: new FormControl(undefined, [Validators.minLength(4), Validators.maxLength(4)]), - messageText: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface ImmunisationHistoryStatementType { - mimeType: ImmunisationHistoryStatementTypeMimeType; - - /** File name of the PDF immunisation history statement */ - fileName: string; - - /** Base64-encoded content of PDF immunisation history statement */ - fileContent: string; - } - export interface ImmunisationHistoryStatementTypeFormProperties { - mimeType: FormControl, - - /** File name of the PDF immunisation history statement */ - fileName: FormControl, - - /** Base64-encoded content of PDF immunisation history statement */ - fileContent: FormControl, - } - export function CreateImmunisationHistoryStatementTypeFormGroup() { - return new FormGroup({ - mimeType: new FormControl(undefined, [Validators.required]), - fileName: new FormControl(undefined, [Validators.required]), - fileContent: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum ImmunisationHistoryStatementTypeMimeType { 'application/pdf' = 0 } - - export interface ImmunisationHistoryStatementResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - immunisationHistoryStatement?: ImmunisationHistoryStatementType; - errors?: Array; - } - export interface ImmunisationHistoryStatementResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateImmunisationHistoryStatementResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface IndigenousStatusRequestType { - individualIdentifier: string; - indigenousStatus: boolean; - informationProvider: ProviderIdentifierType; - } - export interface IndigenousStatusRequestTypeFormProperties { - individualIdentifier: FormControl, - indigenousStatus: FormControl, - } - export function CreateIndigenousStatusRequestTypeFormGroup() { - return new FormGroup({ - individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), - indigenousStatus: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface IndigenousStatusResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - export interface IndigenousStatusResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateIndigenousStatusResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface MedicalContraindiationResponseType { - vaccineCode: string; - typeCode: MedicalContraindiationResponseTypeTypeCode; - - /** Start date in format DDMMYYYY */ - startDate: string; - - /** End date in format DDMMYYYY */ - endDate?: string | null; - reason: MedicalContraindiationResponseTypeReason; - - /** AnaphylaxisDate date in format DDMMYYYY */ - anaphylaxisDate?: string | null; - } - export interface MedicalContraindiationResponseTypeFormProperties { - vaccineCode: FormControl, - typeCode: FormControl, - - /** Start date in format DDMMYYYY */ - startDate: FormControl, - - /** End date in format DDMMYYYY */ - endDate: FormControl, - reason: FormControl, - - /** AnaphylaxisDate date in format DDMMYYYY */ - anaphylaxisDate: FormControl, - } - export function CreateMedicalContraindiationResponseTypeFormGroup() { - return new FormGroup({ - vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), - typeCode: new FormControl(undefined, [Validators.required]), - startDate: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), - endDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - reason: new FormControl(undefined, [Validators.required]), - anaphylaxisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export enum MedicalContraindiationResponseTypeTypeCode { P = 0, T = 1 } - - export enum MedicalContraindiationResponseTypeReason { M = 0, S = 1, P = 2, I = 3, A = 4 } - - export interface MedicalContraindicationHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - medContraindicationList?: Array; - errors?: Array; - } - export interface MedicalContraindicationHistoryResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateMedicalContraindicationHistoryResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface MedicalContraindiationRequestType { - vaccineCode: string; - typeCode: MedicalContraindiationResponseTypeTypeCode; - - /** End date in format DDMMYYYY */ - endDate?: string | null; - reason: MedicalContraindiationResponseTypeReason; - - /** Previous anaphylaxis date in format DDMMYYYY */ - anaphylaxisDate?: string | null; - } - export interface MedicalContraindiationRequestTypeFormProperties { - vaccineCode: FormControl, - typeCode: FormControl, - - /** End date in format DDMMYYYY */ - endDate: FormControl, - reason: FormControl, - - /** Previous anaphylaxis date in format DDMMYYYY */ - anaphylaxisDate: FormControl, - } - export function CreateMedicalContraindiationRequestTypeFormGroup() { - return new FormGroup({ - vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), - typeCode: new FormControl(undefined, [Validators.required]), - endDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - reason: new FormControl(undefined, [Validators.required]), - anaphylaxisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface AddMedicalContraindicationRequestType { - individualIdentifier: string; - contraindication: MedicalContraindiationRequestType; - informationProvider: ProviderIdentifierType; - } - export interface AddMedicalContraindicationRequestTypeFormProperties { - individualIdentifier: FormControl, - } - export function CreateAddMedicalContraindicationRequestTypeFormGroup() { - return new FormGroup({ - individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), - }); - - } - - export interface AddMedicalContraindicationResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - export interface AddMedicalContraindicationResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateAddMedicalContraindicationResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface NaturalImmunityResponseType { - disease: string; - - /** Notification date in format DDMMYYYY */ - notificationDate: string; - - /** Lab test date in format DDMMYYYY */ - labTestDate?: string | null; - - /** Diagnosis date in format DDMMYYYY */ - diagnosisDate?: string | null; - } - export interface NaturalImmunityResponseTypeFormProperties { - disease: FormControl, - - /** Notification date in format DDMMYYYY */ - notificationDate: FormControl, - - /** Lab test date in format DDMMYYYY */ - labTestDate: FormControl, - - /** Diagnosis date in format DDMMYYYY */ - diagnosisDate: FormControl, - } - export function CreateNaturalImmunityResponseTypeFormGroup() { - return new FormGroup({ - disease: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), - notificationDate: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), - labTestDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - diagnosisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface NaturalImmunityHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - naturalImmunityList?: Array; - errors?: Array; - } - export interface NaturalImmunityHistoryResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateNaturalImmunityHistoryResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface NaturalImmunityRequestType { - disease: string; - - /** Lab test date in format DDMMYYYY - it is required if diagnosisDate is not provided */ - labTestDate?: string | null; - - /** Diagnosis date in format DDMMYYYY - it is required if labTestDate is not provided */ - diagnosisDate?: string | null; - } - export interface NaturalImmunityRequestTypeFormProperties { - disease: FormControl, - - /** Lab test date in format DDMMYYYY - it is required if diagnosisDate is not provided */ - labTestDate: FormControl, - - /** Diagnosis date in format DDMMYYYY - it is required if labTestDate is not provided */ - diagnosisDate: FormControl, - } - export function CreateNaturalImmunityRequestTypeFormGroup() { - return new FormGroup({ - disease: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), - labTestDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - diagnosisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface AddNaturalImmunityRequestType { - individualIdentifier: string; - immunity: NaturalImmunityRequestType; - informationProvider: ProviderIdentifierType; - } - export interface AddNaturalImmunityRequestTypeFormProperties { - individualIdentifier: FormControl, - } - export function CreateAddNaturalImmunityRequestTypeFormGroup() { - return new FormGroup({ - individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), - }); - - } - - export interface AddNaturalImmunityResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - export interface AddNaturalImmunityResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateAddNaturalImmunityResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface VaccineTrialType { - antigenCode?: string | null; - dose?: string | null; - - /** Start date in format DDMMYYYY */ - startDate?: string | null; - - /** End date in format DDMMYYYY */ - endDate?: string | null; - } - export interface VaccineTrialTypeFormProperties { - antigenCode: FormControl, - dose: FormControl, - - /** Start date in format DDMMYYYY */ - startDate: FormControl, - - /** End date in format DDMMYYYY */ - endDate: FormControl, - } - export function CreateVaccineTrialTypeFormGroup() { - return new FormGroup({ - antigenCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), - dose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - startDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - endDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface VaccineTrialHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - vaccineTrialList?: Array; - errors?: Array; - } - export interface VaccineTrialHistoryResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateVaccineTrialHistoryResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface IndividualIdentifierType { - personalDetails?: PersonalDetailsType; - medicareCard?: MedicareCardType; - address?: AddressType; - ihiNumber?: string | null; - atsiIndicator?: IndividualIdentifierTypeAtsiIndicator | null; - acceptAndConfirm?: string | null; - } - export interface IndividualIdentifierTypeFormProperties { - ihiNumber: FormControl, - atsiIndicator: FormControl, - acceptAndConfirm: FormControl, - } - export function CreateIndividualIdentifierTypeFormGroup() { - return new FormGroup({ - ihiNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), - atsiIndicator: new FormControl(undefined), - acceptAndConfirm: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export enum IndividualIdentifierTypeAtsiIndicator { Y = 0, N = 1 } - - export interface CatchupDateRequestType { - individual: IndividualIdentifierType; - informationProvider: ProviderIdentifierType; - } - export interface CatchupDateRequestTypeFormProperties { - } - export function CreateCatchupDateRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface CatchupDateResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - - /** Immunisation schedule catchup date in format ddMMyyyy */ - catchupDate?: string | null; - errors?: Array; - } - export interface CatchupDateResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - - /** Immunisation schedule catchup date in format ddMMyyyy */ - catchupDate: FormControl, - } - export function CreateCatchupDateResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - codeType: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(20)]), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - catchupDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface EpisodeType { - id: number; - vaccineCode: string; - vaccineDose?: string | null; - vaccineBatch?: string | null; - vaccineSerialNumber?: string | null; - } - export interface EpisodeTypeFormProperties { - id: FormControl, - vaccineCode: FormControl, - vaccineDose: FormControl, - vaccineBatch: FormControl, - vaccineSerialNumber: FormControl, - } - export function CreateEpisodeTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required]), - vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), - vaccineDose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - vaccineBatch: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(15)]), - vaccineSerialNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(108)]), - }); - - } - - export interface EncounterType { - id: number; - claimSequenceNumber?: string | null; - episodes: Array; - immunisationProvider?: ProviderIdentifierType; - schoolId?: string | null; - administeredOverseas?: boolean | null; - acceptAndConfirm?: string | null; - - /** The date on which the Individual received the immunisation in format ddMMyyy */ - dateOfService: string; - } - export interface EncounterTypeFormProperties { - id: FormControl, - claimSequenceNumber: FormControl, - schoolId: FormControl, - administeredOverseas: FormControl, - acceptAndConfirm: FormControl, - - /** The date on which the Individual received the immunisation in format ddMMyyy */ - dateOfService: FormControl, - } - export function CreateEncounterTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required]), - claimSequenceNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(4)]), - schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), - administeredOverseas: new FormControl(undefined), - acceptAndConfirm: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - dateOfService: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface EncounterResponseType { - id: number; - claimSequenceNumber: string; - episodes: Array; - information?: InformationType; - - /** Claim id of the encounter */ - claimId?: string | null; - - /** Claim sequence number of the encounter */ - claimSeqNum?: number | null; - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: number; - schoolId?: string | null; - - /** Date of service in format DDMMYYYY */ - dateOfService: string; - } - export interface EncounterResponseTypeFormProperties { - id: FormControl, - claimSequenceNumber: FormControl, - - /** Claim id of the encounter */ - claimId: FormControl, - - /** Claim sequence number of the encounter */ - claimSeqNum: FormControl, - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: FormControl, - schoolId: FormControl, - - /** Date of service in format DDMMYYYY */ - dateOfService: FormControl, - } - export function CreateEncounterResponseTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required]), - claimSequenceNumber: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(4)]), - claimId: new FormControl(undefined, [Validators.minLength(5), Validators.maxLength(8)]), - claimSeqNum: new FormControl(undefined), - immEncSeqNum: new FormControl(undefined, [Validators.required]), - schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), - dateOfService: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface ClaimDetailsResponseType { - claimId?: string | null; - encounters?: Array; - } - export interface ClaimDetailsResponseTypeFormProperties { - claimId: FormControl, - } - export function CreateClaimDetailsResponseTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface AddEncounterRequestType { - individual: IndividualIdentifierType; - encounters: Array; - informationProvider: ProviderIdentifierType; - claimId?: string | null; - } - export interface AddEncounterRequestTypeFormProperties { - claimId: FormControl, - } - export function CreateAddEncounterRequestTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface AddEncounterResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - claimDetails?: ClaimDetailsResponseType; - errors?: Array; - } - export interface AddEncounterResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateAddEncounterResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - export interface EncounterRequestType { - - /** Claim id of the encounter */ - claimId: string; - - /** Claim sequence number of the encounter */ - claimSeqNum: number; - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: number; - episodes: Array; - schoolId?: string | null; - - /** Date of service in format DDMMYYYY */ - dateOfService: string; - } - export interface EncounterRequestTypeFormProperties { - - /** Claim id of the encounter */ - claimId: FormControl, - - /** Claim sequence number of the encounter */ - claimSeqNum: FormControl, - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: FormControl, - schoolId: FormControl, - - /** Date of service in format DDMMYYYY */ - dateOfService: FormControl, - } - export function CreateEncounterRequestTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.required, Validators.minLength(5), Validators.maxLength(8)]), - claimSeqNum: new FormControl(undefined, [Validators.required]), - immEncSeqNum: new FormControl(undefined, [Validators.required]), - schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), - dateOfService: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface UpdateEncounterRequestType { - individualIdentifier: string; - encounter: EncounterRequestType; - informationProvider: ProviderIdentifierType; - } - export interface UpdateEncounterRequestTypeFormProperties { - individualIdentifier: FormControl, - } - export function CreateUpdateEncounterRequestTypeFormGroup() { - return new FormGroup({ - individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), - }); - - } - - export interface UpdateEncounterResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - encounter?: EncounterResponseType; - errors?: Array; - } - export interface UpdateEncounterResponseTypeFormProperties { - statusCode: FormControl, - codeType: FormControl, - message: FormControl, - } - export function CreateUpdateEncounterResponseTypeFormGroup() { - return new FormGroup({ - statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), - codeType: new FormControl(undefined), - message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Get authorisation access list - * Post v1/authorisation/access/list - * @return {AirAccessListResponseType} 200 OK - */ - AirAuthorisationAccessList1EigwPost(requestBody: AirAccessListRequestType): Observable { - return this.http.post(this.baseUri + 'v1/authorisation/access/list', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Identify Individual details request - * Post v1/individual/details - * @return {IndividualDetailsResponseType} 200 OK - */ - AirImmunisationIndividualDetails1EigwPost(requestBody: IdentifyIndividualRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Add additional vaccine indicator request - * Post v1/individual/additional-vaccine-indicator/add - * @return {AdditionalVaccineIndicatorResponseType} 200 OK - */ - AirImmunisationAdditionalVaccineIndicatorAdd1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/add', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Remove additional vaccine indicator request - * Post v1/individual/additional-vaccine-indicator/remove - * @return {AdditionalVaccineIndicatorResponseType} 200 OK - */ - AirImmunisationAdditionalVaccineIndicatorRemove1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/remove', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get immunisation details request - * Post v1/individual/immunisation-history/details - * @return {ImmunisationHistoryResponseType} 200 OK - */ - AirImmunisationHistoryDetails1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/immunisation-history/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Vaccine Trial History - * Post v1/individual/immunisation-history/statement - * @return {ImmunisationHistoryStatementResponseType} 200 OK - */ - AirImmunisationHistoryStatement1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/immunisation-history/statement', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update Indigenous Status request - * Post v1/individual/indigenous-status/update - * @return {IndigenousStatusResponseType} 200 OK - */ - AirImmunisationIndigenousStatusUpdate1EigwPost(requestBody: IndigenousStatusRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/indigenous-status/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Medical Contraindication History - * Post v1/individual/medical-contraindication/history - * @return {MedicalContraindicationHistoryResponseType} 200 OK - */ - AirImmunisationMedContraindicationHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Record Medical Contraindication request - * Post v1/individual/medical-contraindication/record - * @return {AddMedicalContraindicationResponseType} 200 OK - */ - AirImmunisationMedContraindicationRecord1EigwPost(requestBody: AddMedicalContraindicationRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Natural Immunity History - * Post v1/individual/natural-immunity/history - * @return {NaturalImmunityHistoryResponseType} 200 OK - */ - AirImmunisationNaturalImmunityHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/natural-immunity/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Record Natural Immunity request - * Post v1/individual/natural-immunity/record - * @return {AddNaturalImmunityResponseType} 200 OK - */ - AirImmunisationNaturalImmunityRecord1EigwPost(requestBody: AddNaturalImmunityRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/natural-immunity/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Vaccine Trial History - * Post v1/individual/vaccine-trial/history - * @return {VaccineTrialHistoryResponseType} 200 OK - */ - AirImmunisationVaccineTrialHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/vaccine-trial/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Post v1.1/schedule/catchup - * @return {CatchupDateResponseType} 200 OK - */ - AirImmunisationScheduleCatchup110EigwPost(requestBody: CatchupDateRequestType): Observable { - return this.http.post(this.baseUri + 'v1.1/schedule/catchup', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Record Encounter request - * Post v1.1/encounters/record - * @return {AddEncounterResponseType} 200 OK - */ - AirImmunisationEncounterRecord110EigwPost(requestBody: AddEncounterRequestType): Observable { - return this.http.post(this.baseUri + 'v1.1/encounters/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update Encounter request - * Post v1/encounter/update - * @return {UpdateEncounterResponseType} 200 OK - */ - AirImmunisationEncounterUpdate1EigwPost(requestBody: UpdateEncounterRequestType): Observable { - return this.http.post(this.baseUri + 'v1/encounter/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ProviderIdentifierType { + + /** Vaccination provider number such as Medicare provider number or AIR provider number. */ + providerNumber: string; + hpioNumber?: string | null; + hpiiNumber?: string | null; + } + export interface ProviderIdentifierTypeFormProperties { + + /** Vaccination provider number such as Medicare provider number or AIR provider number. */ + providerNumber: FormControl, + hpioNumber: FormControl, + hpiiNumber: FormControl, + } + export function CreateProviderIdentifierTypeFormGroup() { + return new FormGroup({ + providerNumber: new FormControl(undefined, [Validators.required, Validators.minLength(6), Validators.maxLength(8)]), + hpioNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), + hpiiNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), + }); + + } + + export interface AccessType { + code: string; + name?: string | null; + hasAccess: boolean; + } + export interface AccessTypeFormProperties { + code: FormControl, + name: FormControl, + hasAccess: FormControl, + } + export function CreateAccessTypeFormGroup() { + return new FormGroup({ + code: new FormControl(undefined, [Validators.required]), + name: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(255)]), + hasAccess: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface AirAccessListRequestType { + informationProvider: ProviderIdentifierType; + } + export interface AirAccessListRequestTypeFormProperties { + } + export function CreateAirAccessListRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface AirAccessListResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + accessList?: Array; + errors?: Array; + } + export interface AirAccessListResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateAirAccessListResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface ErrorMessageType { + + /** Error code */ + code: string; + + /** Error field name */ + field?: string | null; + + /** Error message details */ + message?: string | null; + } + export interface ErrorMessageTypeFormProperties { + + /** Error code */ + code: FormControl, + + /** Error field name */ + field: FormControl, + + /** Error message details */ + message: FormControl, + } + export function CreateErrorMessageTypeFormGroup() { + return new FormGroup({ + code: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + field: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface MedicareCardType { + + /** Individual's Medicare card number */ + medicareCardNumber: string; + + /** Medicare Individual Reference Number */ + medicareIRN?: string | null; + } + export interface MedicareCardTypeFormProperties { + + /** Individual's Medicare card number */ + medicareCardNumber: FormControl, + + /** Medicare Individual Reference Number */ + medicareIRN: FormControl, + } + export function CreateMedicareCardTypeFormGroup() { + return new FormGroup({ + medicareCardNumber: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + medicareIRN: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface PersonalDetailsType { + + /** Individual's date of birth in format DDMMYYYY */ + dateOfBirth: string; + + /** Individual' First Name */ + firstName?: string | null; + + /** Individual' Last Name */ + lastName: string; + + /** Individual's gender */ + gender?: string | null; + } + export interface PersonalDetailsTypeFormProperties { + + /** Individual's date of birth in format DDMMYYYY */ + dateOfBirth: FormControl, + + /** Individual' First Name */ + firstName: FormControl, + + /** Individual' Last Name */ + lastName: FormControl, + + /** Individual's gender */ + gender: FormControl, + } + export function CreatePersonalDetailsTypeFormGroup() { + return new FormGroup({ + dateOfBirth: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), + firstName: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), + lastName: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(40)]), + gender: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface SearchAddressType { + postCode: string; + } + export interface SearchAddressTypeFormProperties { + postCode: FormControl, + } + export function CreateSearchAddressTypeFormGroup() { + return new FormGroup({ + postCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + }); + + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postCode: string; + } + export interface AddressTypeFormProperties { + addressLineOne: FormControl, + addressLineTwo: FormControl, + locality: FormControl, + postCode: FormControl, + } + export function CreateAddressTypeFormGroup() { + return new FormGroup({ + addressLineOne: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), + addressLineTwo: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(40)]), + locality: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), + postCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + }); + + } + + export interface IndividualType { + personalDetails?: PersonalDetailsType; + medicareCard?: MedicareCardType; + address?: SearchAddressType; + ihiNumber?: string | null; + } + export interface IndividualTypeFormProperties { + ihiNumber: FormControl, + } + export function CreateIndividualTypeFormGroup() { + return new FormGroup({ + ihiNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), + }); + + } + + export interface ResponseIndividualType { + personalDetails?: PersonalDetailsType; + medicareCard?: MedicareCardType; + address?: AddressType; + } + export interface ResponseIndividualTypeFormProperties { + } + export function CreateResponseIndividualTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface IndividualDetailsType { + individualIdentifier?: string | null; + individual?: ResponseIndividualType; + + /** Individual's catchup date in format DDMMYYYY */ + catchupDate?: string | null; + endDateCode?: string | null; + indigenousStatus?: boolean | null; + additionalVaccineIndicator?: boolean | null; + medContraindicationIndicator?: boolean | null; + naturalImmunityIndicator?: boolean | null; + vaccineTrialIndicator?: boolean | null; + actionRequiredIndicator?: boolean | null; + } + export interface IndividualDetailsTypeFormProperties { + individualIdentifier: FormControl, + + /** Individual's catchup date in format DDMMYYYY */ + catchupDate: FormControl, + endDateCode: FormControl, + indigenousStatus: FormControl, + additionalVaccineIndicator: FormControl, + medContraindicationIndicator: FormControl, + naturalImmunityIndicator: FormControl, + vaccineTrialIndicator: FormControl, + actionRequiredIndicator: FormControl, + } + export function CreateIndividualDetailsTypeFormGroup() { + return new FormGroup({ + individualIdentifier: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(128)]), + catchupDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + endDateCode: new FormControl(undefined), + indigenousStatus: new FormControl(undefined), + additionalVaccineIndicator: new FormControl(undefined), + medContraindicationIndicator: new FormControl(undefined), + naturalImmunityIndicator: new FormControl(undefined), + vaccineTrialIndicator: new FormControl(undefined), + actionRequiredIndicator: new FormControl(undefined), + }); + + } + + export interface IdentifyIndividualRequestType { + individual: IndividualType; + informationProvider: ProviderIdentifierType; + } + export interface IdentifyIndividualRequestTypeFormProperties { + } + export function CreateIdentifyIndividualRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface IndividualDetailsResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + individualDetails?: IndividualDetailsType; + errors?: Array; + } + export interface IndividualDetailsResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateIndividualDetailsResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface AdditionalVaccineIndicatorRequestType { + individualIdentifier: string; + acknowledgement: boolean; + informationProvider: ProviderIdentifierType; + } + export interface AdditionalVaccineIndicatorRequestTypeFormProperties { + individualIdentifier: FormControl, + acknowledgement: FormControl, + } + export function CreateAdditionalVaccineIndicatorRequestTypeFormGroup() { + return new FormGroup({ + individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), + acknowledgement: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface AdditionalVaccineIndicatorResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + export interface AdditionalVaccineIndicatorResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateAdditionalVaccineIndicatorResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface DueVaccineType { + disease?: string | null; + vaccineDose?: string | null; + + /** Due date in format DDMMYYYY */ + dueDate?: string | null; + } + export interface DueVaccineTypeFormProperties { + disease: FormControl, + vaccineDose: FormControl, + + /** Due date in format DDMMYYYY */ + dueDate: FormControl, + } + export function CreateDueVaccineTypeFormGroup() { + return new FormGroup({ + disease: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), + vaccineDose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + dueDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface EncounterHistoryType { + + /** Claim id of the encounter */ + claimId: string; + + /** Claim sequence number of the encounter */ + claimSeqNum: number; + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: number; + episodes?: Array; + editable?: boolean | null; + + /** Date submitted in format DDMMYYYY */ + dateOfService?: string | null; + + /** Date submitted in format DDMMYYYY */ + dateSubmitted?: string | null; + schoolId?: string | null; + } + export interface EncounterHistoryTypeFormProperties { + + /** Claim id of the encounter */ + claimId: FormControl, + + /** Claim sequence number of the encounter */ + claimSeqNum: FormControl, + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: FormControl, + editable: FormControl, + + /** Date submitted in format DDMMYYYY */ + dateOfService: FormControl, + + /** Date submitted in format DDMMYYYY */ + dateSubmitted: FormControl, + schoolId: FormControl, + } + export function CreateEncounterHistoryTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.required]), + claimSeqNum: new FormControl(undefined, [Validators.required]), + immEncSeqNum: new FormControl(undefined, [Validators.required]), + editable: new FormControl(undefined), + dateOfService: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + dateSubmitted: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), + }); + + } + + export interface EpisodeResponseType { + id: number; + vaccineCode: string; + vaccineDose?: string | null; + vaccineBatch?: string | null; + vaccineSerialNumber?: string | null; + actionRequiredIndicator: boolean; + editable: boolean; + information?: InformationType; + } + export interface EpisodeResponseTypeFormProperties { + id: FormControl, + vaccineCode: FormControl, + vaccineDose: FormControl, + vaccineBatch: FormControl, + vaccineSerialNumber: FormControl, + actionRequiredIndicator: FormControl, + editable: FormControl, + } + export function CreateEpisodeResponseTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required]), + vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), + vaccineDose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + vaccineBatch: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(15)]), + vaccineSerialNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(108)]), + actionRequiredIndicator: new FormControl(undefined, [Validators.required]), + editable: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface ImmunisationDetailsResponseType { + dueList?: Array; + encounters?: Array; + } + export interface ImmunisationDetailsResponseTypeFormProperties { + } + export function CreateImmunisationDetailsResponseTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface AirHistoryRequestType { + individualIdentifier: string; + informationProvider: ProviderIdentifierType; + } + export interface AirHistoryRequestTypeFormProperties { + individualIdentifier: FormControl, + } + export function CreateAirHistoryRequestTypeFormGroup() { + return new FormGroup({ + individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), + }); + + } + + export interface ImmunisationHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + immunisationDetails?: ImmunisationDetailsResponseType; + errors?: Array; + } + export interface ImmunisationHistoryResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateImmunisationHistoryResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface InformationType { + status: string; + code?: string | null; + text?: string | null; + messageCode?: string | null; + messageText?: string | null; + } + export interface InformationTypeFormProperties { + status: FormControl, + code: FormControl, + text: FormControl, + messageCode: FormControl, + messageText: FormControl, + } + export function CreateInformationTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(20)]), + code: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(10)]), + text: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + messageCode: new FormControl(undefined, [Validators.minLength(4), Validators.maxLength(4)]), + messageText: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface ImmunisationHistoryStatementType { + mimeType: ImmunisationHistoryStatementTypeMimeType; + + /** File name of the PDF immunisation history statement */ + fileName: string; + + /** Base64-encoded content of PDF immunisation history statement */ + fileContent: string; + } + export interface ImmunisationHistoryStatementTypeFormProperties { + mimeType: FormControl, + + /** File name of the PDF immunisation history statement */ + fileName: FormControl, + + /** Base64-encoded content of PDF immunisation history statement */ + fileContent: FormControl, + } + export function CreateImmunisationHistoryStatementTypeFormGroup() { + return new FormGroup({ + mimeType: new FormControl(undefined, [Validators.required]), + fileName: new FormControl(undefined, [Validators.required]), + fileContent: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum ImmunisationHistoryStatementTypeMimeType { 'application/pdf' = 0 } + + export interface ImmunisationHistoryStatementResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + immunisationHistoryStatement?: ImmunisationHistoryStatementType; + errors?: Array; + } + export interface ImmunisationHistoryStatementResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateImmunisationHistoryStatementResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface IndigenousStatusRequestType { + individualIdentifier: string; + indigenousStatus: boolean; + informationProvider: ProviderIdentifierType; + } + export interface IndigenousStatusRequestTypeFormProperties { + individualIdentifier: FormControl, + indigenousStatus: FormControl, + } + export function CreateIndigenousStatusRequestTypeFormGroup() { + return new FormGroup({ + individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), + indigenousStatus: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface IndigenousStatusResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + export interface IndigenousStatusResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateIndigenousStatusResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface MedicalContraindiationResponseType { + vaccineCode: string; + typeCode: MedicalContraindiationResponseTypeTypeCode; + + /** Start date in format DDMMYYYY */ + startDate: string; + + /** End date in format DDMMYYYY */ + endDate?: string | null; + reason: MedicalContraindiationResponseTypeReason; + + /** AnaphylaxisDate date in format DDMMYYYY */ + anaphylaxisDate?: string | null; + } + export interface MedicalContraindiationResponseTypeFormProperties { + vaccineCode: FormControl, + typeCode: FormControl, + + /** Start date in format DDMMYYYY */ + startDate: FormControl, + + /** End date in format DDMMYYYY */ + endDate: FormControl, + reason: FormControl, + + /** AnaphylaxisDate date in format DDMMYYYY */ + anaphylaxisDate: FormControl, + } + export function CreateMedicalContraindiationResponseTypeFormGroup() { + return new FormGroup({ + vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), + typeCode: new FormControl(undefined, [Validators.required]), + startDate: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), + endDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + reason: new FormControl(undefined, [Validators.required]), + anaphylaxisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export enum MedicalContraindiationResponseTypeTypeCode { P = 0, T = 1 } + + export enum MedicalContraindiationResponseTypeReason { M = 0, S = 1, P = 2, I = 3, A = 4 } + + export interface MedicalContraindicationHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + medContraindicationList?: Array; + errors?: Array; + } + export interface MedicalContraindicationHistoryResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateMedicalContraindicationHistoryResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface MedicalContraindiationRequestType { + vaccineCode: string; + typeCode: MedicalContraindiationResponseTypeTypeCode; + + /** End date in format DDMMYYYY */ + endDate?: string | null; + reason: MedicalContraindiationResponseTypeReason; + + /** Previous anaphylaxis date in format DDMMYYYY */ + anaphylaxisDate?: string | null; + } + export interface MedicalContraindiationRequestTypeFormProperties { + vaccineCode: FormControl, + typeCode: FormControl, + + /** End date in format DDMMYYYY */ + endDate: FormControl, + reason: FormControl, + + /** Previous anaphylaxis date in format DDMMYYYY */ + anaphylaxisDate: FormControl, + } + export function CreateMedicalContraindiationRequestTypeFormGroup() { + return new FormGroup({ + vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), + typeCode: new FormControl(undefined, [Validators.required]), + endDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + reason: new FormControl(undefined, [Validators.required]), + anaphylaxisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface AddMedicalContraindicationRequestType { + individualIdentifier: string; + contraindication: MedicalContraindiationRequestType; + informationProvider: ProviderIdentifierType; + } + export interface AddMedicalContraindicationRequestTypeFormProperties { + individualIdentifier: FormControl, + } + export function CreateAddMedicalContraindicationRequestTypeFormGroup() { + return new FormGroup({ + individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), + }); + + } + + export interface AddMedicalContraindicationResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + export interface AddMedicalContraindicationResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateAddMedicalContraindicationResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface NaturalImmunityResponseType { + disease: string; + + /** Notification date in format DDMMYYYY */ + notificationDate: string; + + /** Lab test date in format DDMMYYYY */ + labTestDate?: string | null; + + /** Diagnosis date in format DDMMYYYY */ + diagnosisDate?: string | null; + } + export interface NaturalImmunityResponseTypeFormProperties { + disease: FormControl, + + /** Notification date in format DDMMYYYY */ + notificationDate: FormControl, + + /** Lab test date in format DDMMYYYY */ + labTestDate: FormControl, + + /** Diagnosis date in format DDMMYYYY */ + diagnosisDate: FormControl, + } + export function CreateNaturalImmunityResponseTypeFormGroup() { + return new FormGroup({ + disease: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), + notificationDate: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), + labTestDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + diagnosisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface NaturalImmunityHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + naturalImmunityList?: Array; + errors?: Array; + } + export interface NaturalImmunityHistoryResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateNaturalImmunityHistoryResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface NaturalImmunityRequestType { + disease: string; + + /** Lab test date in format DDMMYYYY - it is required if diagnosisDate is not provided */ + labTestDate?: string | null; + + /** Diagnosis date in format DDMMYYYY - it is required if labTestDate is not provided */ + diagnosisDate?: string | null; + } + export interface NaturalImmunityRequestTypeFormProperties { + disease: FormControl, + + /** Lab test date in format DDMMYYYY - it is required if diagnosisDate is not provided */ + labTestDate: FormControl, + + /** Diagnosis date in format DDMMYYYY - it is required if labTestDate is not provided */ + diagnosisDate: FormControl, + } + export function CreateNaturalImmunityRequestTypeFormGroup() { + return new FormGroup({ + disease: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), + labTestDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + diagnosisDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface AddNaturalImmunityRequestType { + individualIdentifier: string; + immunity: NaturalImmunityRequestType; + informationProvider: ProviderIdentifierType; + } + export interface AddNaturalImmunityRequestTypeFormProperties { + individualIdentifier: FormControl, + } + export function CreateAddNaturalImmunityRequestTypeFormGroup() { + return new FormGroup({ + individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), + }); + + } + + export interface AddNaturalImmunityResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + export interface AddNaturalImmunityResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateAddNaturalImmunityResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface VaccineTrialType { + antigenCode?: string | null; + dose?: string | null; + + /** Start date in format DDMMYYYY */ + startDate?: string | null; + + /** End date in format DDMMYYYY */ + endDate?: string | null; + } + export interface VaccineTrialTypeFormProperties { + antigenCode: FormControl, + dose: FormControl, + + /** Start date in format DDMMYYYY */ + startDate: FormControl, + + /** End date in format DDMMYYYY */ + endDate: FormControl, + } + export function CreateVaccineTrialTypeFormGroup() { + return new FormGroup({ + antigenCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), + dose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + startDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + endDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface VaccineTrialHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + vaccineTrialList?: Array; + errors?: Array; + } + export interface VaccineTrialHistoryResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateVaccineTrialHistoryResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface IndividualIdentifierType { + personalDetails?: PersonalDetailsType; + medicareCard?: MedicareCardType; + address?: AddressType; + ihiNumber?: string | null; + atsiIndicator?: IndividualIdentifierTypeAtsiIndicator | null; + acceptAndConfirm?: string | null; + } + export interface IndividualIdentifierTypeFormProperties { + ihiNumber: FormControl, + atsiIndicator: FormControl, + acceptAndConfirm: FormControl, + } + export function CreateIndividualIdentifierTypeFormGroup() { + return new FormGroup({ + ihiNumber: new FormControl(undefined, [Validators.minLength(16), Validators.maxLength(16)]), + atsiIndicator: new FormControl(undefined), + acceptAndConfirm: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export enum IndividualIdentifierTypeAtsiIndicator { Y = 0, N = 1 } + + export interface CatchupDateRequestType { + individual: IndividualIdentifierType; + informationProvider: ProviderIdentifierType; + } + export interface CatchupDateRequestTypeFormProperties { + } + export function CreateCatchupDateRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface CatchupDateResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + + /** Immunisation schedule catchup date in format ddMMyyyy */ + catchupDate?: string | null; + errors?: Array; + } + export interface CatchupDateResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + + /** Immunisation schedule catchup date in format ddMMyyyy */ + catchupDate: FormControl, + } + export function CreateCatchupDateResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + codeType: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(20)]), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + catchupDate: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface EpisodeType { + id: number; + vaccineCode: string; + vaccineDose?: string | null; + vaccineBatch?: string | null; + vaccineSerialNumber?: string | null; + } + export interface EpisodeTypeFormProperties { + id: FormControl, + vaccineCode: FormControl, + vaccineDose: FormControl, + vaccineBatch: FormControl, + vaccineSerialNumber: FormControl, + } + export function CreateEpisodeTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required]), + vaccineCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(6)]), + vaccineDose: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + vaccineBatch: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(15)]), + vaccineSerialNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(108)]), + }); + + } + + export interface EncounterType { + id: number; + claimSequenceNumber?: string | null; + episodes: Array; + immunisationProvider?: ProviderIdentifierType; + schoolId?: string | null; + administeredOverseas?: boolean | null; + acceptAndConfirm?: string | null; + + /** The date on which the Individual received the immunisation in format ddMMyyy */ + dateOfService: string; + } + export interface EncounterTypeFormProperties { + id: FormControl, + claimSequenceNumber: FormControl, + schoolId: FormControl, + administeredOverseas: FormControl, + acceptAndConfirm: FormControl, + + /** The date on which the Individual received the immunisation in format ddMMyyy */ + dateOfService: FormControl, + } + export function CreateEncounterTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required]), + claimSequenceNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(4)]), + schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), + administeredOverseas: new FormControl(undefined), + acceptAndConfirm: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + dateOfService: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface EncounterResponseType { + id: number; + claimSequenceNumber: string; + episodes: Array; + information?: InformationType; + + /** Claim id of the encounter */ + claimId?: string | null; + + /** Claim sequence number of the encounter */ + claimSeqNum?: number | null; + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: number; + schoolId?: string | null; + + /** Date of service in format DDMMYYYY */ + dateOfService: string; + } + export interface EncounterResponseTypeFormProperties { + id: FormControl, + claimSequenceNumber: FormControl, + + /** Claim id of the encounter */ + claimId: FormControl, + + /** Claim sequence number of the encounter */ + claimSeqNum: FormControl, + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: FormControl, + schoolId: FormControl, + + /** Date of service in format DDMMYYYY */ + dateOfService: FormControl, + } + export function CreateEncounterResponseTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required]), + claimSequenceNumber: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(4)]), + claimId: new FormControl(undefined, [Validators.minLength(5), Validators.maxLength(8)]), + claimSeqNum: new FormControl(undefined), + immEncSeqNum: new FormControl(undefined, [Validators.required]), + schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), + dateOfService: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface ClaimDetailsResponseType { + claimId?: string | null; + encounters?: Array; + } + export interface ClaimDetailsResponseTypeFormProperties { + claimId: FormControl, + } + export function CreateClaimDetailsResponseTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface AddEncounterRequestType { + individual: IndividualIdentifierType; + encounters: Array; + informationProvider: ProviderIdentifierType; + claimId?: string | null; + } + export interface AddEncounterRequestTypeFormProperties { + claimId: FormControl, + } + export function CreateAddEncounterRequestTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface AddEncounterResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + claimDetails?: ClaimDetailsResponseType; + errors?: Array; + } + export interface AddEncounterResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateAddEncounterResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + export interface EncounterRequestType { + + /** Claim id of the encounter */ + claimId: string; + + /** Claim sequence number of the encounter */ + claimSeqNum: number; + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: number; + episodes: Array; + schoolId?: string | null; + + /** Date of service in format DDMMYYYY */ + dateOfService: string; + } + export interface EncounterRequestTypeFormProperties { + + /** Claim id of the encounter */ + claimId: FormControl, + + /** Claim sequence number of the encounter */ + claimSeqNum: FormControl, + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: FormControl, + schoolId: FormControl, + + /** Date of service in format DDMMYYYY */ + dateOfService: FormControl, + } + export function CreateEncounterRequestTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.required, Validators.minLength(5), Validators.maxLength(8)]), + claimSeqNum: new FormControl(undefined, [Validators.required]), + immEncSeqNum: new FormControl(undefined, [Validators.required]), + schoolId: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(9)]), + dateOfService: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface UpdateEncounterRequestType { + individualIdentifier: string; + encounter: EncounterRequestType; + informationProvider: ProviderIdentifierType; + } + export interface UpdateEncounterRequestTypeFormProperties { + individualIdentifier: FormControl, + } + export function CreateUpdateEncounterRequestTypeFormGroup() { + return new FormGroup({ + individualIdentifier: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(128)]), + }); + + } + + export interface UpdateEncounterResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + encounter?: EncounterResponseType; + errors?: Array; + } + export interface UpdateEncounterResponseTypeFormProperties { + statusCode: FormControl, + codeType: FormControl, + message: FormControl, + } + export function CreateUpdateEncounterResponseTypeFormGroup() { + return new FormGroup({ + statusCode: new FormControl(undefined, [Validators.required, Validators.minLength(10), Validators.maxLength(10)]), + codeType: new FormControl(undefined), + message: new FormControl(undefined, [Validators.minLength(0), Validators.maxLength(255)]), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Get authorisation access list + * Post v1/authorisation/access/list + * @return {AirAccessListResponseType} 200 OK + */ + AirAuthorisationAccessList1EigwPost(requestBody: AirAccessListRequestType): Observable { + return this.http.post(this.baseUri + 'v1/authorisation/access/list', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Identify Individual details request + * Post v1/individual/details + * @return {IndividualDetailsResponseType} 200 OK + */ + AirImmunisationIndividualDetails1EigwPost(requestBody: IdentifyIndividualRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Add additional vaccine indicator request + * Post v1/individual/additional-vaccine-indicator/add + * @return {AdditionalVaccineIndicatorResponseType} 200 OK + */ + AirImmunisationAdditionalVaccineIndicatorAdd1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/add', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Remove additional vaccine indicator request + * Post v1/individual/additional-vaccine-indicator/remove + * @return {AdditionalVaccineIndicatorResponseType} 200 OK + */ + AirImmunisationAdditionalVaccineIndicatorRemove1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/remove', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get immunisation details request + * Post v1/individual/immunisation-history/details + * @return {ImmunisationHistoryResponseType} 200 OK + */ + AirImmunisationHistoryDetails1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/immunisation-history/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Vaccine Trial History + * Post v1/individual/immunisation-history/statement + * @return {ImmunisationHistoryStatementResponseType} 200 OK + */ + AirImmunisationHistoryStatement1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/immunisation-history/statement', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update Indigenous Status request + * Post v1/individual/indigenous-status/update + * @return {IndigenousStatusResponseType} 200 OK + */ + AirImmunisationIndigenousStatusUpdate1EigwPost(requestBody: IndigenousStatusRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/indigenous-status/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Medical Contraindication History + * Post v1/individual/medical-contraindication/history + * @return {MedicalContraindicationHistoryResponseType} 200 OK + */ + AirImmunisationMedContraindicationHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Record Medical Contraindication request + * Post v1/individual/medical-contraindication/record + * @return {AddMedicalContraindicationResponseType} 200 OK + */ + AirImmunisationMedContraindicationRecord1EigwPost(requestBody: AddMedicalContraindicationRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Natural Immunity History + * Post v1/individual/natural-immunity/history + * @return {NaturalImmunityHistoryResponseType} 200 OK + */ + AirImmunisationNaturalImmunityHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/natural-immunity/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Record Natural Immunity request + * Post v1/individual/natural-immunity/record + * @return {AddNaturalImmunityResponseType} 200 OK + */ + AirImmunisationNaturalImmunityRecord1EigwPost(requestBody: AddNaturalImmunityRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/natural-immunity/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Vaccine Trial History + * Post v1/individual/vaccine-trial/history + * @return {VaccineTrialHistoryResponseType} 200 OK + */ + AirImmunisationVaccineTrialHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/vaccine-trial/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Post v1.1/schedule/catchup + * @return {CatchupDateResponseType} 200 OK + */ + AirImmunisationScheduleCatchup110EigwPost(requestBody: CatchupDateRequestType): Observable { + return this.http.post(this.baseUri + 'v1.1/schedule/catchup', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Record Encounter request + * Post v1.1/encounters/record + * @return {AddEncounterResponseType} 200 OK + */ + AirImmunisationEncounterRecord110EigwPost(requestBody: AddEncounterRequestType): Observable { + return this.http.post(this.baseUri + 'v1.1/encounters/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update Encounter request + * Post v1/encounter/update + * @return {UpdateEncounterResponseType} 200 OK + */ + AirImmunisationEncounterUpdate1EigwPost(requestBody: UpdateEncounterRequestType): Observable { + return this.http.post(this.baseUri + 'v1/encounter/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/MozillaKinto.txt b/Tests/SwagTsTests/NG2FormGroupResults/MozillaKinto.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/MozillaKinto.txt rename to Tests/SwagTsTests/NG2FormGroupResults/MozillaKinto.ts index b442ff8e..e0740757 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/MozillaKinto.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/MozillaKinto.ts @@ -1,628 +1,628 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Get - * @return {{[id: string]: any }} Return information about the running Instance. - */ - Server_info(): Observable<{[id: string]: any }> { - return this.http.get<{[id: string]: any }>(this.baseUri + '', {}); - } - - /** - * Get __api__ - * @return {{[id: string]: any }} Return an OpenAPI description of the running instance. - */ - Get_openapi_spec(): Observable<{[id: string]: any }> { - return this.http.get<{[id: string]: any }>(this.baseUri + '__api__', {}); - } - - /** - * Get __heartbeat__ - * @return {{[id: string]: any }} Server is working properly. - */ - __heartbeat__(): Observable<{[id: string]: any }> { - return this.http.get<{[id: string]: any }>(this.baseUri + '__heartbeat__', {}); - } - - /** - * Get __lbheartbeat__ - * @return {string} Returned if server is reachable. - */ - __lbheartbeat__(): Observable { - return this.http.get(this.baseUri + '__lbheartbeat__', { responseType: 'text' }); - } - - /** - * Get __version__ - * @return {{[id: string]: any }} Return the running Instance version information. - */ - __version__(): Observable<{[id: string]: any }> { - return this.http.get<{[id: string]: any }>(this.baseUri + '__version__', {}); - } - - /** - * Post batch - * @return {BatchReturn} Return a list of operation responses. - */ - Batch(requestBody: BatchPostBody): Observable { - return this.http.post(this.baseUri + 'batch', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get buckets - * @param {number} _limit Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _since Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _to Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _before Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} last_modified Minimum: 0 - * Maximum: 9223372036854776000 - * @return {Get_bucketsReturn} Return a list of matching objects. - */ - Get_buckets(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get buckets/monitor/collections/changes/records - * @param {number} _limit Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _since Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _to Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _before Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} last_modified Minimum: 0 - * Maximum: 9223372036854776000 - * @return {Get_changessReturn} Return a list of matching objects. - */ - Get_changess(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/monitor/collections/changes/records?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get buckets/{bid}/collections/{cid}/changeset - * @param {number} _limit Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} - */ - Get_collection_changeset(_since: string | null | undefined, _expected: string, _limit: number | null | undefined, bucket: string | null | undefined, collection: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'buckets/{bid}/collections/{cid}/changeset?_since=' + (_since == null ? '' : encodeURIComponent(_since)) + '&_expected=' + (_expected == null ? '' : encodeURIComponent(_expected)) + '&_limit=' + _limit + '&bucket=' + (bucket == null ? '' : encodeURIComponent(bucket)) + '&collection=' + (collection == null ? '' : encodeURIComponent(collection)), { observe: 'response', responseType: 'text' }); - } - - /** - * Get buckets/{bucket_id}/collections - * @param {number} _limit Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _since Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _to Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _before Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} last_modified Minimum: 0 - * Maximum: 9223372036854776000 - * @return {Get_collectionsReturn} Return a list of matching objects. - */ - Get_collections(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get buckets/{bucket_id}/collections/{collection_id}/records - * @param {number} _limit Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _since Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _to Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _before Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} last_modified Minimum: 0 - * Maximum: 9223372036854776000 - * @return {Get_recordsReturn} Return a list of matching objects. - */ - Get_records(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get buckets/{bucket_id}/collections/{collection_id}/records/{id} - * @return {Get_recordReturn} Return the target object. - */ - Get_record(_fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Delete buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment - * @return {void} - */ - Delete_attachment(): Observable> { - return this.http.delete(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment', { observe: 'response', responseType: 'text' }); - } - - /** - * Post buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment - * @return {void} - */ - Create_attachment(): Observable> { - return this.http.post(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Get buckets/{bucket_id}/collections/{id} - * @return {Get_collectionReturn} Return the target object. - */ - Get_collection(_fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get buckets/{bucket_id}/groups - * @param {number} _limit Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _since Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _to Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} _before Minimum: 0 - * Maximum: 9223372036854776000 - * @param {number} last_modified Minimum: 0 - * Maximum: 9223372036854776000 - * @return {Get_groupsReturn} Return a list of matching objects. - */ - Get_groups(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/{bucket_id}/groups?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get buckets/{bucket_id}/groups/{id} - * @return {Get_groupReturn} Return the target object. - */ - Get_group(_fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/{bucket_id}/groups/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get buckets/{id} - * @return {Get_bucketReturn} Return the target object. - */ - Get_bucket(_fields: Array | null | undefined): Observable { - return this.http.get(this.baseUri + 'buckets/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Get contribute.json - * @return {{[id: string]: any }} Return open source contributing information. - */ - Contribute(): Observable<{[id: string]: any }> { - return this.http.get<{[id: string]: any }>(this.baseUri + 'contribute.json', {}); - } - } - - export interface BatchPostBody { - defaults?: BatchPostBodyDefaults; - - /** Required */ - BatchPostBodyRequests: Array; - } - export interface BatchPostBodyFormProperties { - } - export function CreateBatchPostBodyFormGroup() { - return new FormGroup({ - }); - - } - - export interface BatchPostBodyDefaults { - body?: {[id: string]: any }; - headers?: {[id: string]: any }; - method?: BatchPostBodyDefaultsMethod | null; - path?: string | null; - } - export interface BatchPostBodyDefaultsFormProperties { - body: FormControl<{[id: string]: any } | null | undefined>, - headers: FormControl<{[id: string]: any } | null | undefined>, - method: FormControl, - path: FormControl, - } - export function CreateBatchPostBodyDefaultsFormGroup() { - return new FormGroup({ - body: new FormControl<{[id: string]: any } | null | undefined>(undefined), - headers: new FormControl<{[id: string]: any } | null | undefined>(undefined), - method: new FormControl(undefined), - path: new FormControl(undefined, [Validators.pattern('^/')]), - }); - - } - - export enum BatchPostBodyDefaultsMethod { GET = 0, HEAD = 1, DELETE = 2, TRACE = 3, POST = 4, PUT = 5, PATCH = 6 } - - export interface BatchPostBodyRequests { - body?: {[id: string]: any }; - headers?: {[id: string]: any }; - method?: BatchPostBodyDefaultsMethod | null; - - /** Required */ - path: string; - } - export interface BatchPostBodyRequestsFormProperties { - body: FormControl<{[id: string]: any } | null | undefined>, - headers: FormControl<{[id: string]: any } | null | undefined>, - method: FormControl, - - /** Required */ - path: FormControl, - } - export function CreateBatchPostBodyRequestsFormGroup() { - return new FormGroup({ - body: new FormControl<{[id: string]: any } | null | undefined>(undefined), - headers: new FormControl<{[id: string]: any } | null | undefined>(undefined), - method: new FormControl(undefined), - path: new FormControl(undefined, [Validators.required, Validators.pattern('^/')]), - }); - - } - - export interface BatchReturn { - - /** Required */ - BatchReturnResponses: Array; - } - export interface BatchReturnFormProperties { - } - export function CreateBatchReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface BatchReturnResponses { - body?: {[id: string]: any }; - headers?: {[id: string]: any }; - - /** Required */ - path: string; - - /** - * Required - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - status: number; - } - export interface BatchReturnResponsesFormProperties { - body: FormControl<{[id: string]: any } | null | undefined>, - headers: FormControl<{[id: string]: any } | null | undefined>, - - /** Required */ - path: FormControl, - - /** - * Required - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - status: FormControl, - } - export function CreateBatchReturnResponsesFormGroup() { - return new FormGroup({ - body: new FormControl<{[id: string]: any } | null | undefined>(undefined), - headers: new FormControl<{[id: string]: any } | null | undefined>(undefined), - path: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Get_bucketsReturn { - Get_bucketsReturnData?: Array; - } - export interface Get_bucketsReturnFormProperties { - } - export function CreateGet_bucketsReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_bucketsReturnData { - 'collection:schema'?: {[id: string]: any }; - 'group:schema'?: {[id: string]: any }; - 'record:schema'?: {[id: string]: any }; - } - export interface Get_bucketsReturnDataFormProperties { - 'collection:schema': FormControl<{[id: string]: any } | null | undefined>, - 'group:schema': FormControl<{[id: string]: any } | null | undefined>, - 'record:schema': FormControl<{[id: string]: any } | null | undefined>, - } - export function CreateGet_bucketsReturnDataFormGroup() { - return new FormGroup({ - 'collection:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), - 'group:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), - 'record:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), - }); - - } - - export interface Get_changessReturn { - Get_changessReturnData?: Array; - } - export interface Get_changessReturnFormProperties { - } - export function CreateGet_changessReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_changessReturnData { - - /** Required */ - bucket: string; - - /** Required */ - collection: string; - - /** Required */ - host: string; - } - export interface Get_changessReturnDataFormProperties { - - /** Required */ - bucket: FormControl, - - /** Required */ - collection: FormControl, - - /** Required */ - host: FormControl, - } - export function CreateGet_changessReturnDataFormGroup() { - return new FormGroup({ - bucket: new FormControl(undefined, [Validators.required]), - collection: new FormControl(undefined, [Validators.required]), - host: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Get_collectionsReturn { - Get_collectionsReturnData?: Array; - } - export interface Get_collectionsReturnFormProperties { - } - export function CreateGet_collectionsReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_collectionsReturnData { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - cache_expires?: number | null; - schema?: {[id: string]: any }; - } - export interface Get_collectionsReturnDataFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - cache_expires: FormControl, - schema: FormControl<{[id: string]: any } | null | undefined>, - } - export function CreateGet_collectionsReturnDataFormGroup() { - return new FormGroup({ - cache_expires: new FormControl(undefined), - schema: new FormControl<{[id: string]: any } | null | undefined>(undefined), - }); - - } - - export interface Get_recordsReturn { - data?: Array; - } - export interface Get_recordsReturnFormProperties { - } - export function CreateGet_recordsReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_recordReturn { - data?: {[id: string]: any }; - permissions?: Get_recordReturnPermissions; - } - export interface Get_recordReturnFormProperties { - data: FormControl<{[id: string]: any } | null | undefined>, - } - export function CreateGet_recordReturnFormGroup() { - return new FormGroup({ - data: new FormControl<{[id: string]: any } | null | undefined>(undefined), - }); - - } - - export interface Get_recordReturnPermissions { - read?: Array; - write?: Array; - } - export interface Get_recordReturnPermissionsFormProperties { - } - export function CreateGet_recordReturnPermissionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_collectionReturn { - data?: Get_collectionReturnData; - permissions?: Get_collectionReturnPermissions; - } - export interface Get_collectionReturnFormProperties { - } - export function CreateGet_collectionReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_collectionReturnData { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - cache_expires?: number | null; - schema?: {[id: string]: any }; - } - export interface Get_collectionReturnDataFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - cache_expires: FormControl, - schema: FormControl<{[id: string]: any } | null | undefined>, - } - export function CreateGet_collectionReturnDataFormGroup() { - return new FormGroup({ - cache_expires: new FormControl(undefined), - schema: new FormControl<{[id: string]: any } | null | undefined>(undefined), - }); - - } - - export interface Get_collectionReturnPermissions { - read?: Array; - 'record:create'?: Array; - write?: Array; - } - export interface Get_collectionReturnPermissionsFormProperties { - } - export function CreateGet_collectionReturnPermissionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_groupsReturn { - Get_groupsReturnData?: Array; - } - export interface Get_groupsReturnFormProperties { - } - export function CreateGet_groupsReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_groupsReturnData { - members?: Array; - } - export interface Get_groupsReturnDataFormProperties { - } - export function CreateGet_groupsReturnDataFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_groupReturn { - data?: Get_groupReturnData; - permissions?: Get_groupReturnPermissions; - } - export interface Get_groupReturnFormProperties { - } - export function CreateGet_groupReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_groupReturnData { - members?: Array; - } - export interface Get_groupReturnDataFormProperties { - } - export function CreateGet_groupReturnDataFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_groupReturnPermissions { - read?: Array; - write?: Array; - } - export interface Get_groupReturnPermissionsFormProperties { - } - export function CreateGet_groupReturnPermissionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_bucketReturn { - data?: Get_bucketReturnData; - permissions?: Get_bucketReturnPermissions; - } - export interface Get_bucketReturnFormProperties { - } - export function CreateGet_bucketReturnFormGroup() { - return new FormGroup({ - }); - - } - - export interface Get_bucketReturnData { - 'collection:schema'?: {[id: string]: any }; - 'group:schema'?: {[id: string]: any }; - 'record:schema'?: {[id: string]: any }; - } - export interface Get_bucketReturnDataFormProperties { - 'collection:schema': FormControl<{[id: string]: any } | null | undefined>, - 'group:schema': FormControl<{[id: string]: any } | null | undefined>, - 'record:schema': FormControl<{[id: string]: any } | null | undefined>, - } - export function CreateGet_bucketReturnDataFormGroup() { - return new FormGroup({ - 'collection:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), - 'group:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), - 'record:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), - }); - - } - - export interface Get_bucketReturnPermissions { - 'collection:create'?: Array; - 'group:create'?: Array; - read?: Array; - write?: Array; - } - export interface Get_bucketReturnPermissionsFormProperties { - } - export function CreateGet_bucketReturnPermissionsFormGroup() { - return new FormGroup({ - }); - - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Get + * @return {{[id: string]: any }} Return information about the running Instance. + */ + Server_info(): Observable<{[id: string]: any }> { + return this.http.get<{[id: string]: any }>(this.baseUri + '', {}); + } + + /** + * Get __api__ + * @return {{[id: string]: any }} Return an OpenAPI description of the running instance. + */ + Get_openapi_spec(): Observable<{[id: string]: any }> { + return this.http.get<{[id: string]: any }>(this.baseUri + '__api__', {}); + } + + /** + * Get __heartbeat__ + * @return {{[id: string]: any }} Server is working properly. + */ + __heartbeat__(): Observable<{[id: string]: any }> { + return this.http.get<{[id: string]: any }>(this.baseUri + '__heartbeat__', {}); + } + + /** + * Get __lbheartbeat__ + * @return {string} Returned if server is reachable. + */ + __lbheartbeat__(): Observable { + return this.http.get(this.baseUri + '__lbheartbeat__', { responseType: 'text' }); + } + + /** + * Get __version__ + * @return {{[id: string]: any }} Return the running Instance version information. + */ + __version__(): Observable<{[id: string]: any }> { + return this.http.get<{[id: string]: any }>(this.baseUri + '__version__', {}); + } + + /** + * Post batch + * @return {BatchReturn} Return a list of operation responses. + */ + Batch(requestBody: BatchPostBody): Observable { + return this.http.post(this.baseUri + 'batch', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get buckets + * @param {number} _limit Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _since Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _to Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _before Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} last_modified Minimum: 0 + * Maximum: 9223372036854776000 + * @return {Get_bucketsReturn} Return a list of matching objects. + */ + Get_buckets(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get buckets/monitor/collections/changes/records + * @param {number} _limit Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _since Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _to Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _before Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} last_modified Minimum: 0 + * Maximum: 9223372036854776000 + * @return {Get_changessReturn} Return a list of matching objects. + */ + Get_changess(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/monitor/collections/changes/records?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get buckets/{bid}/collections/{cid}/changeset + * @param {number} _limit Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} + */ + Get_collection_changeset(_since: string | null | undefined, _expected: string, _limit: number | null | undefined, bucket: string | null | undefined, collection: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'buckets/{bid}/collections/{cid}/changeset?_since=' + (_since == null ? '' : encodeURIComponent(_since)) + '&_expected=' + (_expected == null ? '' : encodeURIComponent(_expected)) + '&_limit=' + _limit + '&bucket=' + (bucket == null ? '' : encodeURIComponent(bucket)) + '&collection=' + (collection == null ? '' : encodeURIComponent(collection)), { observe: 'response', responseType: 'text' }); + } + + /** + * Get buckets/{bucket_id}/collections + * @param {number} _limit Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _since Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _to Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _before Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} last_modified Minimum: 0 + * Maximum: 9223372036854776000 + * @return {Get_collectionsReturn} Return a list of matching objects. + */ + Get_collections(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get buckets/{bucket_id}/collections/{collection_id}/records + * @param {number} _limit Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _since Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _to Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _before Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} last_modified Minimum: 0 + * Maximum: 9223372036854776000 + * @return {Get_recordsReturn} Return a list of matching objects. + */ + Get_records(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get buckets/{bucket_id}/collections/{collection_id}/records/{id} + * @return {Get_recordReturn} Return the target object. + */ + Get_record(_fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Delete buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment + * @return {void} + */ + Delete_attachment(): Observable> { + return this.http.delete(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment', { observe: 'response', responseType: 'text' }); + } + + /** + * Post buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment + * @return {void} + */ + Create_attachment(): Observable> { + return this.http.post(this.baseUri + 'buckets/{bucket_id}/collections/{collection_id}/records/{id}/attachment', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Get buckets/{bucket_id}/collections/{id} + * @return {Get_collectionReturn} Return the target object. + */ + Get_collection(_fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/{bucket_id}/collections/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get buckets/{bucket_id}/groups + * @param {number} _limit Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _since Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _to Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} _before Minimum: 0 + * Maximum: 9223372036854776000 + * @param {number} last_modified Minimum: 0 + * Maximum: 9223372036854776000 + * @return {Get_groupsReturn} Return a list of matching objects. + */ + Get_groups(_limit: number | null | undefined, _sort: Array | null | undefined, _token: string | null | undefined, _since: number | null | undefined, _to: number | null | undefined, _before: number | null | undefined, id: string | null | undefined, last_modified: number | null | undefined, _fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/{bucket_id}/groups?_limit=' + _limit + '&' + _sort?.map(z => `_sort=${encodeURIComponent(z)}`).join('&') + '&_token=' + (_token == null ? '' : encodeURIComponent(_token)) + '&_since=' + _since + '&_to=' + _to + '&_before=' + _before + '&id=' + (id == null ? '' : encodeURIComponent(id)) + '&last_modified=' + last_modified + '&' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get buckets/{bucket_id}/groups/{id} + * @return {Get_groupReturn} Return the target object. + */ + Get_group(_fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/{bucket_id}/groups/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get buckets/{id} + * @return {Get_bucketReturn} Return the target object. + */ + Get_bucket(_fields: Array | null | undefined): Observable { + return this.http.get(this.baseUri + 'buckets/{id}?' + _fields?.map(z => `_fields=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Get contribute.json + * @return {{[id: string]: any }} Return open source contributing information. + */ + Contribute(): Observable<{[id: string]: any }> { + return this.http.get<{[id: string]: any }>(this.baseUri + 'contribute.json', {}); + } + } + + export interface BatchPostBody { + defaults?: BatchPostBodyDefaults; + + /** Required */ + BatchPostBodyRequests: Array; + } + export interface BatchPostBodyFormProperties { + } + export function CreateBatchPostBodyFormGroup() { + return new FormGroup({ + }); + + } + + export interface BatchPostBodyDefaults { + body?: {[id: string]: any }; + headers?: {[id: string]: any }; + method?: BatchPostBodyDefaultsMethod | null; + path?: string | null; + } + export interface BatchPostBodyDefaultsFormProperties { + body: FormControl<{[id: string]: any } | null | undefined>, + headers: FormControl<{[id: string]: any } | null | undefined>, + method: FormControl, + path: FormControl, + } + export function CreateBatchPostBodyDefaultsFormGroup() { + return new FormGroup({ + body: new FormControl<{[id: string]: any } | null | undefined>(undefined), + headers: new FormControl<{[id: string]: any } | null | undefined>(undefined), + method: new FormControl(undefined), + path: new FormControl(undefined, [Validators.pattern('^/')]), + }); + + } + + export enum BatchPostBodyDefaultsMethod { GET = 0, HEAD = 1, DELETE = 2, TRACE = 3, POST = 4, PUT = 5, PATCH = 6 } + + export interface BatchPostBodyRequests { + body?: {[id: string]: any }; + headers?: {[id: string]: any }; + method?: BatchPostBodyDefaultsMethod | null; + + /** Required */ + path: string; + } + export interface BatchPostBodyRequestsFormProperties { + body: FormControl<{[id: string]: any } | null | undefined>, + headers: FormControl<{[id: string]: any } | null | undefined>, + method: FormControl, + + /** Required */ + path: FormControl, + } + export function CreateBatchPostBodyRequestsFormGroup() { + return new FormGroup({ + body: new FormControl<{[id: string]: any } | null | undefined>(undefined), + headers: new FormControl<{[id: string]: any } | null | undefined>(undefined), + method: new FormControl(undefined), + path: new FormControl(undefined, [Validators.required, Validators.pattern('^/')]), + }); + + } + + export interface BatchReturn { + + /** Required */ + BatchReturnResponses: Array; + } + export interface BatchReturnFormProperties { + } + export function CreateBatchReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface BatchReturnResponses { + body?: {[id: string]: any }; + headers?: {[id: string]: any }; + + /** Required */ + path: string; + + /** + * Required + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + status: number; + } + export interface BatchReturnResponsesFormProperties { + body: FormControl<{[id: string]: any } | null | undefined>, + headers: FormControl<{[id: string]: any } | null | undefined>, + + /** Required */ + path: FormControl, + + /** + * Required + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + status: FormControl, + } + export function CreateBatchReturnResponsesFormGroup() { + return new FormGroup({ + body: new FormControl<{[id: string]: any } | null | undefined>(undefined), + headers: new FormControl<{[id: string]: any } | null | undefined>(undefined), + path: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Get_bucketsReturn { + Get_bucketsReturnData?: Array; + } + export interface Get_bucketsReturnFormProperties { + } + export function CreateGet_bucketsReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_bucketsReturnData { + 'collection:schema'?: {[id: string]: any }; + 'group:schema'?: {[id: string]: any }; + 'record:schema'?: {[id: string]: any }; + } + export interface Get_bucketsReturnDataFormProperties { + 'collection:schema': FormControl<{[id: string]: any } | null | undefined>, + 'group:schema': FormControl<{[id: string]: any } | null | undefined>, + 'record:schema': FormControl<{[id: string]: any } | null | undefined>, + } + export function CreateGet_bucketsReturnDataFormGroup() { + return new FormGroup({ + 'collection:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), + 'group:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), + 'record:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), + }); + + } + + export interface Get_changessReturn { + Get_changessReturnData?: Array; + } + export interface Get_changessReturnFormProperties { + } + export function CreateGet_changessReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_changessReturnData { + + /** Required */ + bucket: string; + + /** Required */ + collection: string; + + /** Required */ + host: string; + } + export interface Get_changessReturnDataFormProperties { + + /** Required */ + bucket: FormControl, + + /** Required */ + collection: FormControl, + + /** Required */ + host: FormControl, + } + export function CreateGet_changessReturnDataFormGroup() { + return new FormGroup({ + bucket: new FormControl(undefined, [Validators.required]), + collection: new FormControl(undefined, [Validators.required]), + host: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Get_collectionsReturn { + Get_collectionsReturnData?: Array; + } + export interface Get_collectionsReturnFormProperties { + } + export function CreateGet_collectionsReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_collectionsReturnData { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + cache_expires?: number | null; + schema?: {[id: string]: any }; + } + export interface Get_collectionsReturnDataFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + cache_expires: FormControl, + schema: FormControl<{[id: string]: any } | null | undefined>, + } + export function CreateGet_collectionsReturnDataFormGroup() { + return new FormGroup({ + cache_expires: new FormControl(undefined), + schema: new FormControl<{[id: string]: any } | null | undefined>(undefined), + }); + + } + + export interface Get_recordsReturn { + data?: Array; + } + export interface Get_recordsReturnFormProperties { + } + export function CreateGet_recordsReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_recordReturn { + data?: {[id: string]: any }; + permissions?: Get_recordReturnPermissions; + } + export interface Get_recordReturnFormProperties { + data: FormControl<{[id: string]: any } | null | undefined>, + } + export function CreateGet_recordReturnFormGroup() { + return new FormGroup({ + data: new FormControl<{[id: string]: any } | null | undefined>(undefined), + }); + + } + + export interface Get_recordReturnPermissions { + read?: Array; + write?: Array; + } + export interface Get_recordReturnPermissionsFormProperties { + } + export function CreateGet_recordReturnPermissionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_collectionReturn { + data?: Get_collectionReturnData; + permissions?: Get_collectionReturnPermissions; + } + export interface Get_collectionReturnFormProperties { + } + export function CreateGet_collectionReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_collectionReturnData { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + cache_expires?: number | null; + schema?: {[id: string]: any }; + } + export interface Get_collectionReturnDataFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + cache_expires: FormControl, + schema: FormControl<{[id: string]: any } | null | undefined>, + } + export function CreateGet_collectionReturnDataFormGroup() { + return new FormGroup({ + cache_expires: new FormControl(undefined), + schema: new FormControl<{[id: string]: any } | null | undefined>(undefined), + }); + + } + + export interface Get_collectionReturnPermissions { + read?: Array; + 'record:create'?: Array; + write?: Array; + } + export interface Get_collectionReturnPermissionsFormProperties { + } + export function CreateGet_collectionReturnPermissionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_groupsReturn { + Get_groupsReturnData?: Array; + } + export interface Get_groupsReturnFormProperties { + } + export function CreateGet_groupsReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_groupsReturnData { + members?: Array; + } + export interface Get_groupsReturnDataFormProperties { + } + export function CreateGet_groupsReturnDataFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_groupReturn { + data?: Get_groupReturnData; + permissions?: Get_groupReturnPermissions; + } + export interface Get_groupReturnFormProperties { + } + export function CreateGet_groupReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_groupReturnData { + members?: Array; + } + export interface Get_groupReturnDataFormProperties { + } + export function CreateGet_groupReturnDataFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_groupReturnPermissions { + read?: Array; + write?: Array; + } + export interface Get_groupReturnPermissionsFormProperties { + } + export function CreateGet_groupReturnPermissionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_bucketReturn { + data?: Get_bucketReturnData; + permissions?: Get_bucketReturnPermissions; + } + export interface Get_bucketReturnFormProperties { + } + export function CreateGet_bucketReturnFormGroup() { + return new FormGroup({ + }); + + } + + export interface Get_bucketReturnData { + 'collection:schema'?: {[id: string]: any }; + 'group:schema'?: {[id: string]: any }; + 'record:schema'?: {[id: string]: any }; + } + export interface Get_bucketReturnDataFormProperties { + 'collection:schema': FormControl<{[id: string]: any } | null | undefined>, + 'group:schema': FormControl<{[id: string]: any } | null | undefined>, + 'record:schema': FormControl<{[id: string]: any } | null | undefined>, + } + export function CreateGet_bucketReturnDataFormGroup() { + return new FormGroup({ + 'collection:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), + 'group:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), + 'record:schema': new FormControl<{[id: string]: any } | null | undefined>(undefined), + }); + + } + + export interface Get_bucketReturnPermissions { + 'collection:create'?: Array; + 'group:create'?: Array; + read?: Array; + write?: Array; + } + export interface Get_bucketReturnPermissionsFormProperties { + } + export function CreateGet_bucketReturnPermissionsFormGroup() { + return new FormGroup({ + }); + + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/Pet.txt b/Tests/SwagTsTests/NG2FormGroupResults/Pet.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/Pet.txt rename to Tests/SwagTsTests/NG2FormGroupResults/Pet.ts index 7dc8c3d6..47608da8 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/Pet.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/Pet.ts @@ -1,643 +1,643 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** - * Category name - * Min length: 1 - */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - export interface OrderFormProperties { - - /** Order ID */ - id: FormControl, - - /** Pet ID */ - petId: FormControl, - - /** Minimum: 1 */ - quantity: FormControl, - - /** Estimated ship date */ - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - - /** Indicates whenever order was completed or not */ - complete: FormControl, - - /** Unique Request Id */ - requestId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined, [Validators.min(1)]), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - requestId: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** - * The name given to a pet - * Required - */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** - * Tag name - * Min length: 1 - */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - export interface UserFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** - * User supplied username - * Min length: 4 - */ - username: FormControl, - - /** - * User first name - * Min length: 1 - */ - firstName: FormControl, - - /** - * User last name - * Min length: 1 - */ - lastName: FormControl, - - /** User email address */ - email: FormControl, - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password: FormControl, - - /** User phone number in international format */ - phone: FormControl, - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined, [Validators.minLength(4)]), - firstName: new FormControl(undefined, [Validators.minLength(1)]), - lastName: new FormControl(undefined, [Validators.minLength(1)]), - email: new FormControl(undefined), - password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), - phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** + * Category name + * Min length: 1 + */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + export interface OrderFormProperties { + + /** Order ID */ + id: FormControl, + + /** Pet ID */ + petId: FormControl, + + /** Minimum: 1 */ + quantity: FormControl, + + /** Estimated ship date */ + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + + /** Indicates whenever order was completed or not */ + complete: FormControl, + + /** Unique Request Id */ + requestId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined, [Validators.min(1)]), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + requestId: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** + * The name given to a pet + * Required + */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** + * Tag name + * Min length: 1 + */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + export interface UserFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** + * User supplied username + * Min length: 4 + */ + username: FormControl, + + /** + * User first name + * Min length: 1 + */ + firstName: FormControl, + + /** + * User last name + * Min length: 1 + */ + lastName: FormControl, + + /** User email address */ + email: FormControl, + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password: FormControl, + + /** User phone number in international format */ + phone: FormControl, + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined, [Validators.minLength(4)]), + firstName: new FormControl(undefined, [Validators.minLength(1)]), + lastName: new FormControl(undefined, [Validators.minLength(1)]), + email: new FormControl(undefined), + password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), + phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetByTags.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetByTags.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/PetByTags.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetByTags.ts index 75708917..a5b6c952 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetByTags.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetByTags.ts @@ -1,459 +1,459 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** - * Category name - * Min length: 1 - */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - export interface OrderFormProperties { - - /** Order ID */ - id: FormControl, - - /** Pet ID */ - petId: FormControl, - - /** Minimum: 1 */ - quantity: FormControl, - - /** Estimated ship date */ - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - - /** Indicates whenever order was completed or not */ - complete: FormControl, - - /** Unique Request Id */ - requestId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined, [Validators.min(1)]), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - requestId: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** - * The name given to a pet - * Required - */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** - * Tag name - * Min length: 1 - */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - export interface UserFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** - * User supplied username - * Min length: 4 - */ - username: FormControl, - - /** - * User first name - * Min length: 1 - */ - firstName: FormControl, - - /** - * User last name - * Min length: 1 - */ - lastName: FormControl, - - /** User email address */ - email: FormControl, - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password: FormControl, - - /** User phone number in international format */ - phone: FormControl, - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined, [Validators.minLength(4)]), - firstName: new FormControl(undefined, [Validators.minLength(1)]), - lastName: new FormControl(undefined, [Validators.minLength(1)]), - email: new FormControl(undefined), - password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), - phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** + * Category name + * Min length: 1 + */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + export interface OrderFormProperties { + + /** Order ID */ + id: FormControl, + + /** Pet ID */ + petId: FormControl, + + /** Minimum: 1 */ + quantity: FormControl, + + /** Estimated ship date */ + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + + /** Indicates whenever order was completed or not */ + complete: FormControl, + + /** Unique Request Id */ + requestId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined, [Validators.min(1)]), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + requestId: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** + * The name given to a pet + * Required + */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** + * Tag name + * Min length: 1 + */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + export interface UserFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** + * User supplied username + * Min length: 4 + */ + username: FormControl, + + /** + * User first name + * Min length: 1 + */ + firstName: FormControl, + + /** + * User last name + * Min length: 1 + */ + lastName: FormControl, + + /** User email address */ + email: FormControl, + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password: FormControl, + + /** User phone number in international format */ + phone: FormControl, + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined, [Validators.minLength(4)]), + firstName: new FormControl(undefined, [Validators.minLength(1)]), + lastName: new FormControl(undefined, [Validators.minLength(1)]), + email: new FormControl(undefined), + password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), + phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetDelete.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetDelete.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/PetDelete.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetDelete.ts index f5b82cab..6a5d4069 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetDelete.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetDelete.ts @@ -1,36 +1,36 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetFindByStatus.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetFindByStatus.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/PetFindByStatus.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetFindByStatus.ts index a98f1aeb..a112c772 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetFindByStatus.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetFindByStatus.ts @@ -1,253 +1,253 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** The measured skill for hunting */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** Category name */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** The size of the pack the dog is from */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** The name given to a pet */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** Tag name */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus2 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus2(status: PetStatus): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus2?status=' + status, {}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus3 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus3(status: PetStatus): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus3?status=' + status, {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** The measured skill for hunting */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** Category name */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** The size of the pack the dog is from */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** The name given to a pet */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** Tag name */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus2 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus2(status: PetStatus): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus2?status=' + status, {}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus3 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus3(status: PetStatus): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus3?status=' + status, {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetGodClass.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetGodClass.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/PetGodClass.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetGodClass.ts index ea7af627..f080f388 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetGodClass.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetGodClass.ts @@ -1,549 +1,549 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** The measured skill for hunting */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** Category name */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** The size of the pack the dog is from */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - export interface OrderFormProperties { - - /** Order ID */ - id: FormControl, - - /** Pet ID */ - petId: FormControl, - quantity: FormControl, - - /** Estimated ship date */ - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - - /** Indicates whenever order was completed or not */ - complete: FormControl, - - /** Unique Request Id */ - requestId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined, [Validators.min(1)]), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - requestId: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** The name given to a pet */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** Tag name */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - export interface UserFormProperties { - id: FormControl, - - /** User supplied username */ - username: FormControl, - - /** User first name */ - firstName: FormControl, - - /** User last name */ - lastName: FormControl, - - /** User email address */ - email: FormControl, - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password: FormControl, - - /** User phone number in international format */ - phone: FormControl, - - /** User status */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined, [Validators.minLength(4)]), - firstName: new FormControl(undefined, [Validators.minLength(1)]), - lastName: new FormControl(undefined, [Validators.minLength(1)]), - email: new FormControl(undefined), - password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), - phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class Misc { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPost(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPut(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - Pet_petIdGet(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - Pet_petIdDelete(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - PetFindByStatusGetByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - PetFindByTagsGetByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - StoreInventoryGet(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - StoreOrderPost(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - StoreOrder_orderIdGet(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - StoreOrder_orderIdDelete(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - UserPost(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - User_usernameGet(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - User_usernamePut(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - User_usernameDelete(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithArrayPost(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithListPost(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - UserLoginGetByUsernameAndPassword(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - UserLogoutGet(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** The measured skill for hunting */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** Category name */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** The size of the pack the dog is from */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + export interface OrderFormProperties { + + /** Order ID */ + id: FormControl, + + /** Pet ID */ + petId: FormControl, + quantity: FormControl, + + /** Estimated ship date */ + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + + /** Indicates whenever order was completed or not */ + complete: FormControl, + + /** Unique Request Id */ + requestId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined, [Validators.min(1)]), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + requestId: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** The name given to a pet */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** Tag name */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + export interface UserFormProperties { + id: FormControl, + + /** User supplied username */ + username: FormControl, + + /** User first name */ + firstName: FormControl, + + /** User last name */ + lastName: FormControl, + + /** User email address */ + email: FormControl, + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password: FormControl, + + /** User phone number in international format */ + phone: FormControl, + + /** User status */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined, [Validators.minLength(4)]), + firstName: new FormControl(undefined, [Validators.minLength(1)]), + lastName: new FormControl(undefined, [Validators.minLength(1)]), + email: new FormControl(undefined), + password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), + phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class Misc { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPost(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPut(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + Pet_petIdGet(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + Pet_petIdDelete(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + PetFindByStatusGetByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + PetFindByTagsGetByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + StoreInventoryGet(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + StoreOrderPost(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + StoreOrder_orderIdGet(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + StoreOrder_orderIdDelete(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + UserPost(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + User_usernameGet(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + User_usernamePut(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + User_usernameDelete(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithArrayPost(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithListPost(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + UserLoginGetByUsernameAndPassword(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + UserLogoutGet(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetPathAsContainer.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetPathAsContainer.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/PetPathAsContainer.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetPathAsContainer.ts index e3bcd74b..c44a10e6 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetPathAsContainer.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetPathAsContainer.ts @@ -1,627 +1,627 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** The measured skill for hunting */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** Category name */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** The size of the pack the dog is from */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - export interface OrderFormProperties { - - /** Order ID */ - id: FormControl, - - /** Pet ID */ - petId: FormControl, - quantity: FormControl, - - /** Estimated ship date */ - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - - /** Indicates whenever order was completed or not */ - complete: FormControl, - - /** Unique Request Id */ - requestId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined, [Validators.min(1)]), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - requestId: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** The name given to a pet */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** Tag name */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - export interface UserFormProperties { - id: FormControl, - - /** User supplied username */ - username: FormControl, - - /** User first name */ - firstName: FormControl, - - /** User last name */ - lastName: FormControl, - - /** User email address */ - email: FormControl, - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password: FormControl, - - /** User phone number in international format */ - phone: FormControl, - - /** User status */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined, [Validators.minLength(4)]), - firstName: new FormControl(undefined, [Validators.minLength(1)]), - lastName: new FormControl(undefined, [Validators.minLength(1)]), - email: new FormControl(undefined), - password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), - phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class PetClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Post(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Put(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class Pet_petIdClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - GetByPetId(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - DeleteByPetId(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class Pet_petIdUploadImageClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - } - - @Injectable() - export class PetFindByStatusClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - GetByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - } - - @Injectable() - export class PetFindByTagsClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - GetByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - } - - @Injectable() - export class StoreInventoryClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - Get(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - } - - @Injectable() - export class StoreOrderClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - Post(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @Injectable() - export class StoreOrder_orderIdClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - GetByOrderId(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - DeleteByOrderId(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - Post(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class User_usernameClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetByUsername(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - PutByUsername(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteByUsername(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserCreateWithArrayClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserCreateWithListClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserLoginClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - GetByUsernameAndPassword(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - } - - @Injectable() - export class UserLogoutClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - Get(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** The measured skill for hunting */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** Category name */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** The size of the pack the dog is from */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + export interface OrderFormProperties { + + /** Order ID */ + id: FormControl, + + /** Pet ID */ + petId: FormControl, + quantity: FormControl, + + /** Estimated ship date */ + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + + /** Indicates whenever order was completed or not */ + complete: FormControl, + + /** Unique Request Id */ + requestId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined, [Validators.min(1)]), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + requestId: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** The name given to a pet */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** Tag name */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + export interface UserFormProperties { + id: FormControl, + + /** User supplied username */ + username: FormControl, + + /** User first name */ + firstName: FormControl, + + /** User last name */ + lastName: FormControl, + + /** User email address */ + email: FormControl, + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password: FormControl, + + /** User phone number in international format */ + phone: FormControl, + + /** User status */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined, [Validators.minLength(4)]), + firstName: new FormControl(undefined, [Validators.minLength(1)]), + lastName: new FormControl(undefined, [Validators.minLength(1)]), + email: new FormControl(undefined), + password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), + phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class PetClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Post(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Put(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class Pet_petIdClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + GetByPetId(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + DeleteByPetId(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class Pet_petIdUploadImageClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + } + + @Injectable() + export class PetFindByStatusClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + GetByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + } + + @Injectable() + export class PetFindByTagsClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + GetByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + } + + @Injectable() + export class StoreInventoryClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + Get(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + } + + @Injectable() + export class StoreOrderClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + Post(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @Injectable() + export class StoreOrder_orderIdClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + GetByOrderId(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + DeleteByOrderId(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + Post(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class User_usernameClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetByUsername(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + PutByUsername(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteByUsername(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserCreateWithArrayClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserCreateWithListClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserLoginClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + GetByUsernameAndPassword(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + } + + @Injectable() + export class UserLogoutClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + Get(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetStoreSorted.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetStore.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/PetStoreSorted.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetStore.ts index 4aa7b963..6d312e42 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetStoreSorted.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetStore.ts @@ -1,462 +1,462 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Address { - city?: string | null; - state?: string | null; - street?: string | null; - zip?: string | null; - } - export interface AddressFormProperties { - city: FormControl, - state: FormControl, - street: FormControl, - zip: FormControl, - } - export function CreateAddressFormGroup() { - return new FormGroup({ - city: new FormControl(undefined), - state: new FormControl(undefined), - street: new FormControl(undefined), - zip: new FormControl(undefined), - }); - - } - - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - message?: string | null; - type?: string | null; - } - export interface ApiResponseFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code: FormControl, - message: FormControl, - type: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - message: new FormControl(undefined), - type: new FormControl(undefined), - }); - - } - - export interface Category { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - export interface CategoryFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - export interface Customer { - address?: Array
; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - } - export interface CustomerFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - username: FormControl, - } - export function CreateCustomerFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined), - }); - - } - - export interface Order { - complete?: boolean | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity?: number | null; - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - } - export interface OrderFormProperties { - complete: FormControl, - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity: FormControl, - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - complete: new FormControl(undefined), - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - category?: Category; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Required */ - name: string; - - /** Required */ - photoUrls: Array; - - /** pet status in the store */ - status?: PetStatus | null; - tags?: Array; - } - export interface PetFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** Required */ - name: FormControl, - - /** pet status in the store */ - status: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface Tag { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - export interface TagFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - export interface User { - email?: string | null; - firstName?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - lastName?: string | null; - password?: string | null; - phone?: string | null; - username?: string | null; - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - export interface UserFormProperties { - email: FormControl, - firstName: FormControl, - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - lastName: FormControl, - password: FormControl, - phone: FormControl, - username: FormControl, - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - email: new FormControl(undefined), - firstName: new FormControl(undefined), - id: new FormControl(undefined), - lastName: new FormControl(undefined), - password: new FormControl(undefined), - phone: new FormControl(undefined), - username: new FormControl(undefined), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add a new pet to the store - * Post pet - * @param {Pet} requestBody Create a new pet in the store - * @return {Pet} Successful operation - */ - AddPet(requestBody: Pet): Observable { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Creates list of users with given input array - * Post user/createWithList - * @return {User} Successful operation - */ - CreateUsersWithListInput(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + orderId, { observe: 'response', responseType: 'text' }); - } - - /** - * Deletes a pet - * delete a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: PetStatus | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - * Get store/order/{orderId} - * @param {string} orderId ID of order that needs to be fetched - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string | null | undefined, password: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - - /** - * Place an order for a pet - * Place a new order in the store - * Post store/order - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update an existing pet - * Update an existing pet by Id - * Put pet - * @param {Pet} requestBody Update an existent pet in the store - * @return {Pet} Successful operation - */ - UpdatePet(requestBody: Pet): Observable { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Updates a pet in the store with form data - * Post pet/{petId} - * @param {string} petId ID of pet that needs to be updated - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @param {string} name Name of pet that needs to be updated - * @param {string} status Status of pet that needs to be updated - * @return {void} - */ - UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Update user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Update an existent user in the store - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Order { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity?: number | null; + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + complete?: boolean | null; + } + export interface OrderFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity: FormControl, + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + complete: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Customer { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + address?: Array
; + } + export interface CustomerFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + username: FormControl, + } + export function CreateCustomerFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined), + }); + + } + + export interface Address { + street?: string | null; + city?: string | null; + state?: string | null; + zip?: string | null; + } + export interface AddressFormProperties { + street: FormControl, + city: FormControl, + state: FormControl, + zip: FormControl, + } + export function CreateAddressFormGroup() { + return new FormGroup({ + street: new FormControl(undefined), + city: new FormControl(undefined), + state: new FormControl(undefined), + zip: new FormControl(undefined), + }); + + } + + export interface Category { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + export interface CategoryFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + firstName?: string | null; + lastName?: string | null; + email?: string | null; + password?: string | null; + phone?: string | null; + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + export interface UserFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + username: FormControl, + firstName: FormControl, + lastName: FormControl, + email: FormControl, + password: FormControl, + phone: FormControl, + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined), + firstName: new FormControl(undefined), + lastName: new FormControl(undefined), + email: new FormControl(undefined), + password: new FormControl(undefined), + phone: new FormControl(undefined), + userStatus: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + export interface TagFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + export interface Pet { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Required */ + name: string; + category?: Category; + + /** Required */ + photoUrls: Array; + tags?: Array; + + /** pet status in the store */ + status?: PetStatus | null; + } + export interface PetFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** Required */ + name: FormControl, + + /** pet status in the store */ + status: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Update an existing pet + * Update an existing pet by Id + * Put pet + * @param {Pet} requestBody Update an existent pet in the store + * @return {Pet} Successful operation + */ + UpdatePet(requestBody: Pet): Observable { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Add a new pet to the store + * Add a new pet to the store + * Post pet + * @param {Pet} requestBody Create a new pet in the store + * @return {Pet} Successful operation + */ + AddPet(requestBody: Pet): Observable { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: PetStatus | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Updates a pet in the store with form data + * Post pet/{petId} + * @param {string} petId ID of pet that needs to be updated + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} name Name of pet that needs to be updated + * @param {string} status Status of pet that needs to be updated + * @return {void} + */ + UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Deletes a pet + * delete a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Place a new order in the store + * Post store/order + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + * Get store/order/{orderId} + * @param {string} orderId ID of order that needs to be fetched + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + orderId, { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Creates list of users with given input array + * Post user/createWithList + * @return {User} Successful operation + */ + CreateUsersWithListInput(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string | null | undefined, password: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Update user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Update an existent user in the store + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetStoreExpanded.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetStoreExpanded.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/PetStoreExpanded.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetStoreExpanded.ts index c30c146b..5f3c73de 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetStoreExpanded.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetStoreExpanded.ts @@ -1,115 +1,115 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Pet extends NewPet { - id: string; - } - export interface PetFormProperties extends NewPetFormProperties { - id: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - name: new FormControl(undefined, [Validators.required]), - tag: new FormControl(undefined), - id: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface NewPet { - name: string; - tag?: string | null; - } - export interface NewPetFormProperties { - name: FormControl, - tag: FormControl, - } - export function CreateNewPetFormGroup() { - return new FormGroup({ - name: new FormControl(undefined, [Validators.required]), - tag: new FormControl(undefined), - }); - - } - - export interface Error { - code: number; - message: string; - } - export interface ErrorFormProperties { - code: FormControl, - message: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - code: new FormControl(undefined, [Validators.required]), - message: new FormControl(undefined, [Validators.required]), - }); - - } - - @Injectable() - export class Misc { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Returns all pets from the system that the user has access to - * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - * Get pets - * @param {Array} tags tags to filter by - * @param {number} limit maximum number of results to return - * @return {Array} pet response - */ - FindPets(tags: Array | null | undefined, limit: number | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}); - } - - /** - * Creates a new pet in the store. Duplicates are allowed - * Post pets - * @param {NewPet} requestBody Pet to add to the store - * @return {Pet} pet response - */ - AddPet(requestBody: NewPet): Observable { - return this.http.post(this.baseUri + 'pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Returns a user based on a single ID, if the user does not have access to the pet - * Get pets/{id} - * @param {string} id ID of pet to fetch - * @return {Pet} pet response - */ - FindPetById(id: string): Observable { - return this.http.get(this.baseUri + 'pets/' + id, {}); - } - - /** - * deletes a single pet based on the ID supplied - * Delete pets/{id} - * @param {string} id ID of pet to delete - * @return {void} - */ - DeletePet(id: string): Observable> { - return this.http.delete(this.baseUri + 'pets/' + id, { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Pet extends NewPet { + id: string; + } + export interface PetFormProperties extends NewPetFormProperties { + id: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + name: new FormControl(undefined, [Validators.required]), + tag: new FormControl(undefined), + id: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface NewPet { + name: string; + tag?: string | null; + } + export interface NewPetFormProperties { + name: FormControl, + tag: FormControl, + } + export function CreateNewPetFormGroup() { + return new FormGroup({ + name: new FormControl(undefined, [Validators.required]), + tag: new FormControl(undefined), + }); + + } + + export interface Error { + code: number; + message: string; + } + export interface ErrorFormProperties { + code: FormControl, + message: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + code: new FormControl(undefined, [Validators.required]), + message: new FormControl(undefined, [Validators.required]), + }); + + } + + @Injectable() + export class Misc { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Returns all pets from the system that the user has access to + * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. + * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. + * Get pets + * @param {Array} tags tags to filter by + * @param {number} limit maximum number of results to return + * @return {Array} pet response + */ + FindPets(tags: Array | null | undefined, limit: number | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}); + } + + /** + * Creates a new pet in the store. Duplicates are allowed + * Post pets + * @param {NewPet} requestBody Pet to add to the store + * @return {Pet} pet response + */ + AddPet(requestBody: NewPet): Observable { + return this.http.post(this.baseUri + 'pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Returns a user based on a single ID, if the user does not have access to the pet + * Get pets/{id} + * @param {string} id ID of pet to fetch + * @return {Pet} pet response + */ + FindPetById(id: string): Observable { + return this.http.get(this.baseUri + 'pets/' + id, {}); + } + + /** + * deletes a single pet based on the ID supplied + * Delete pets/{id} + * @param {string} id ID of pet to delete + * @return {void} + */ + DeletePet(id: string): Observable> { + return this.http.delete(this.baseUri + 'pets/' + id, { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetStore.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetStoreSorted.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/PetStore.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetStoreSorted.ts index 81903b7d..7dc0884d 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetStore.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetStoreSorted.ts @@ -1,462 +1,462 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Order { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity?: number | null; - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - complete?: boolean | null; - } - export interface OrderFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity: FormControl, - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - complete: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Customer { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - address?: Array
; - } - export interface CustomerFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - username: FormControl, - } - export function CreateCustomerFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined), - }); - - } - - export interface Address { - street?: string | null; - city?: string | null; - state?: string | null; - zip?: string | null; - } - export interface AddressFormProperties { - street: FormControl, - city: FormControl, - state: FormControl, - zip: FormControl, - } - export function CreateAddressFormGroup() { - return new FormGroup({ - street: new FormControl(undefined), - city: new FormControl(undefined), - state: new FormControl(undefined), - zip: new FormControl(undefined), - }); - - } - - export interface Category { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - export interface CategoryFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - firstName?: string | null; - lastName?: string | null; - email?: string | null; - password?: string | null; - phone?: string | null; - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - export interface UserFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - username: FormControl, - firstName: FormControl, - lastName: FormControl, - email: FormControl, - password: FormControl, - phone: FormControl, - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined), - firstName: new FormControl(undefined), - lastName: new FormControl(undefined), - email: new FormControl(undefined), - password: new FormControl(undefined), - phone: new FormControl(undefined), - userStatus: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - export interface TagFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - export interface Pet { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Required */ - name: string; - category?: Category; - - /** Required */ - photoUrls: Array; - tags?: Array; - - /** pet status in the store */ - status?: PetStatus | null; - } - export interface PetFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** Required */ - name: FormControl, - - /** pet status in the store */ - status: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Update an existing pet - * Update an existing pet by Id - * Put pet - * @param {Pet} requestBody Update an existent pet in the store - * @return {Pet} Successful operation - */ - UpdatePet(requestBody: Pet): Observable { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Add a new pet to the store - * Add a new pet to the store - * Post pet - * @param {Pet} requestBody Create a new pet in the store - * @return {Pet} Successful operation - */ - AddPet(requestBody: Pet): Observable { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: PetStatus | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Updates a pet in the store with form data - * Post pet/{petId} - * @param {string} petId ID of pet that needs to be updated - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @param {string} name Name of pet that needs to be updated - * @param {string} status Status of pet that needs to be updated - * @return {void} - */ - UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Deletes a pet - * delete a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Place a new order in the store - * Post store/order - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - * Get store/order/{orderId} - * @param {string} orderId ID of order that needs to be fetched - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + orderId, { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Creates list of users with given input array - * Post user/createWithList - * @return {User} Successful operation - */ - CreateUsersWithListInput(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string | null | undefined, password: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Update user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Update an existent user in the store - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Address { + city?: string | null; + state?: string | null; + street?: string | null; + zip?: string | null; + } + export interface AddressFormProperties { + city: FormControl, + state: FormControl, + street: FormControl, + zip: FormControl, + } + export function CreateAddressFormGroup() { + return new FormGroup({ + city: new FormControl(undefined), + state: new FormControl(undefined), + street: new FormControl(undefined), + zip: new FormControl(undefined), + }); + + } + + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + message?: string | null; + type?: string | null; + } + export interface ApiResponseFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code: FormControl, + message: FormControl, + type: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + message: new FormControl(undefined), + type: new FormControl(undefined), + }); + + } + + export interface Category { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + export interface CategoryFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + export interface Customer { + address?: Array
; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + } + export interface CustomerFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + username: FormControl, + } + export function CreateCustomerFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined), + }); + + } + + export interface Order { + complete?: boolean | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity?: number | null; + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + } + export interface OrderFormProperties { + complete: FormControl, + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity: FormControl, + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + complete: new FormControl(undefined), + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + category?: Category; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Required */ + name: string; + + /** Required */ + photoUrls: Array; + + /** pet status in the store */ + status?: PetStatus | null; + tags?: Array; + } + export interface PetFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** Required */ + name: FormControl, + + /** pet status in the store */ + status: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface Tag { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + export interface TagFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + export interface User { + email?: string | null; + firstName?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + lastName?: string | null; + password?: string | null; + phone?: string | null; + username?: string | null; + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + export interface UserFormProperties { + email: FormControl, + firstName: FormControl, + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + lastName: FormControl, + password: FormControl, + phone: FormControl, + username: FormControl, + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + email: new FormControl(undefined), + firstName: new FormControl(undefined), + id: new FormControl(undefined), + lastName: new FormControl(undefined), + password: new FormControl(undefined), + phone: new FormControl(undefined), + username: new FormControl(undefined), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add a new pet to the store + * Post pet + * @param {Pet} requestBody Create a new pet in the store + * @return {Pet} Successful operation + */ + AddPet(requestBody: Pet): Observable { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Creates list of users with given input array + * Post user/createWithList + * @return {User} Successful operation + */ + CreateUsersWithListInput(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + orderId, { observe: 'response', responseType: 'text' }); + } + + /** + * Deletes a pet + * delete a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: PetStatus | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + * Get store/order/{orderId} + * @param {string} orderId ID of order that needs to be fetched + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string | null | undefined, password: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + + /** + * Place an order for a pet + * Place a new order in the store + * Post store/order + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update an existing pet + * Update an existing pet by Id + * Put pet + * @param {Pet} requestBody Update an existent pet in the store + * @return {Pet} Successful operation + */ + UpdatePet(requestBody: Pet): Observable { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Updates a pet in the store with form data + * Post pet/{petId} + * @param {string} petId ID of pet that needs to be updated + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} name Name of pet that needs to be updated + * @param {string} status Status of pet that needs to be updated + * @return {void} + */ + UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Update user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Update an existent user in the store + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/PetSuper.txt b/Tests/SwagTsTests/NG2FormGroupResults/PetSuper.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/PetSuper.txt rename to Tests/SwagTsTests/NG2FormGroupResults/PetSuper.ts index b4b53f2c..10eb96c7 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/PetSuper.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/PetSuper.ts @@ -1,675 +1,675 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** - * Category name - * Min length: 1 - */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - }); - - } - - - /** A representation of a dog */ - export interface SuperDog extends Dog { - - /** - * How super - * Minimum: 1 - */ - superIndex?: number | null; - } - - /** A representation of a dog */ - export interface SuperDogFormProperties extends DogFormProperties { - - /** - * How super - * Minimum: 1 - */ - superIndex: FormControl, - } - export function CreateSuperDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - superIndex: new FormControl(undefined, [Validators.min(1)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - export interface OrderFormProperties { - - /** Order ID */ - id: FormControl, - - /** Pet ID */ - petId: FormControl, - - /** Minimum: 1 */ - quantity: FormControl, - - /** Estimated ship date */ - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - - /** Indicates whenever order was completed or not */ - complete: FormControl, - - /** Unique Request Id */ - requestId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined, [Validators.min(1)]), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - requestId: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** - * The name given to a pet - * Required - */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** - * Tag name - * Min length: 1 - */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - export interface UserFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** - * User supplied username - * Min length: 4 - */ - username: FormControl, - - /** - * User first name - * Min length: 1 - */ - firstName: FormControl, - - /** - * User last name - * Min length: 1 - */ - lastName: FormControl, - - /** User email address */ - email: FormControl, - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password: FormControl, - - /** User phone number in international format */ - phone: FormControl, - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined, [Validators.minLength(4)]), - firstName: new FormControl(undefined, [Validators.minLength(1)]), - lastName: new FormControl(undefined, [Validators.minLength(1)]), - email: new FormControl(undefined), - password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), - phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** + * Category name + * Min length: 1 + */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + }); + + } + + + /** A representation of a dog */ + export interface SuperDog extends Dog { + + /** + * How super + * Minimum: 1 + */ + superIndex?: number | null; + } + + /** A representation of a dog */ + export interface SuperDogFormProperties extends DogFormProperties { + + /** + * How super + * Minimum: 1 + */ + superIndex: FormControl, + } + export function CreateSuperDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + superIndex: new FormControl(undefined, [Validators.min(1)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + export interface OrderFormProperties { + + /** Order ID */ + id: FormControl, + + /** Pet ID */ + petId: FormControl, + + /** Minimum: 1 */ + quantity: FormControl, + + /** Estimated ship date */ + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + + /** Indicates whenever order was completed or not */ + complete: FormControl, + + /** Unique Request Id */ + requestId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined, [Validators.min(1)]), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + requestId: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** + * The name given to a pet + * Required + */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** + * Tag name + * Min length: 1 + */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + export interface UserFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** + * User supplied username + * Min length: 4 + */ + username: FormControl, + + /** + * User first name + * Min length: 1 + */ + firstName: FormControl, + + /** + * User last name + * Min length: 1 + */ + lastName: FormControl, + + /** User email address */ + email: FormControl, + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password: FormControl, + + /** User phone number in international format */ + phone: FormControl, + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined, [Validators.minLength(4)]), + firstName: new FormControl(undefined, [Validators.minLength(1)]), + lastName: new FormControl(undefined, [Validators.minLength(1)]), + email: new FormControl(undefined), + password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), + phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/Pet_EnumToString.txt b/Tests/SwagTsTests/NG2FormGroupResults/Pet_EnumToString.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/Pet_EnumToString.txt rename to Tests/SwagTsTests/NG2FormGroupResults/Pet_EnumToString.ts index 5a74d6a7..36f27a2a 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/Pet_EnumToString.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/Pet_EnumToString.ts @@ -1,643 +1,643 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 'clueless', lazy = 'lazy', adventurous = 'adventurous', aggressive = 'aggressive' } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** - * Category name - * Min length: 1 - */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - export interface OrderFormProperties { - - /** Order ID */ - id: FormControl, - - /** Pet ID */ - petId: FormControl, - - /** Minimum: 1 */ - quantity: FormControl, - - /** Estimated ship date */ - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - - /** Indicates whenever order was completed or not */ - complete: FormControl, - - /** Unique Request Id */ - requestId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined, [Validators.min(1)]), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - requestId: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 'placed', approved = 'approved', delivered = 'delivered' } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** - * The name given to a pet - * Required - */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** - * Tag name - * Min length: 1 - */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 'available', pending = 'pending', sold = 'sold' } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - export interface UserFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** - * User supplied username - * Min length: 4 - */ - username: FormControl, - - /** - * User first name - * Min length: 1 - */ - firstName: FormControl, - - /** - * User last name - * Min length: 1 - */ - lastName: FormControl, - - /** User email address */ - email: FormControl, - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password: FormControl, - - /** User phone number in international format */ - phone: FormControl, - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined, [Validators.minLength(4)]), - firstName: new FormControl(undefined, [Validators.minLength(1)]), - lastName: new FormControl(undefined, [Validators.minLength(1)]), - email: new FormControl(undefined), - password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), - phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 'clueless', lazy = 'lazy', adventurous = 'adventurous', aggressive = 'aggressive' } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** + * Category name + * Min length: 1 + */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + export interface OrderFormProperties { + + /** Order ID */ + id: FormControl, + + /** Pet ID */ + petId: FormControl, + + /** Minimum: 1 */ + quantity: FormControl, + + /** Estimated ship date */ + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + + /** Indicates whenever order was completed or not */ + complete: FormControl, + + /** Unique Request Id */ + requestId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined, [Validators.min(1)]), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + requestId: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 'placed', approved = 'approved', delivered = 'delivered' } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** + * The name given to a pet + * Required + */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** + * Tag name + * Min length: 1 + */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 'available', pending = 'pending', sold = 'sold' } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + export interface UserFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** + * User supplied username + * Min length: 4 + */ + username: FormControl, + + /** + * User first name + * Min length: 1 + */ + firstName: FormControl, + + /** + * User last name + * Min length: 1 + */ + lastName: FormControl, + + /** User email address */ + email: FormControl, + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password: FormControl, + + /** User phone number in international format */ + phone: FormControl, + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined, [Validators.minLength(4)]), + firstName: new FormControl(undefined, [Validators.minLength(1)]), + lastName: new FormControl(undefined, [Validators.minLength(1)]), + email: new FormControl(undefined), + password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), + phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/Uspto.txt b/Tests/SwagTsTests/NG2FormGroupResults/Uspto.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/Uspto.txt rename to Tests/SwagTsTests/NG2FormGroupResults/Uspto.ts index 7da2aaf6..fd286c22 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/Uspto.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/Uspto.ts @@ -1,104 +1,104 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface DataSetList { - total?: number | null; - DataSetListApis?: Array; - } - export interface DataSetListFormProperties { - total: FormControl, - } - export function CreateDataSetListFormGroup() { - return new FormGroup({ - total: new FormControl(undefined), - }); - - } - - export interface DataSetListApis { - - /** To be used as a dataset parameter value */ - apiKey?: string | null; - - /** To be used as a version parameter value */ - apiVersionNumber?: string | null; - - /** The URL describing the dataset's fields */ - apiUrl?: string | null; - - /** A URL to the API console for each API */ - apiDocumentationUrl?: string | null; - } - export interface DataSetListApisFormProperties { - - /** To be used as a dataset parameter value */ - apiKey: FormControl, - - /** To be used as a version parameter value */ - apiVersionNumber: FormControl, - - /** The URL describing the dataset's fields */ - apiUrl: FormControl, - - /** A URL to the API console for each API */ - apiDocumentationUrl: FormControl, - } - export function CreateDataSetListApisFormGroup() { - return new FormGroup({ - apiKey: new FormControl(undefined), - apiVersionNumber: new FormControl(undefined), - apiUrl: new FormControl(undefined), - apiDocumentationUrl: new FormControl(undefined), - }); - - } - - @Injectable() - export class MetadataClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * List available data sets - * Get - * @return {DataSetList} Returns a list of data sets - */ - ListDataSets(): Observable { - return this.http.get(this.baseUri + '', {}); - } - - /** - * Provides the general information about the API and the list of fields that can be used to query the dataset. - * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. - * Get {dataset}/{version}/fields - * @param {string} dataset Name of the dataset. - * @param {string} version Version of the dataset. - * @return {string} The dataset API for the given version is found and it is accessible to consume. - */ - ListSearchableFields(dataset: string, version: string): Observable { - return this.http.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { responseType: 'text' }); - } - } - - @Injectable() - export class SearchClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface DataSetList { + total?: number | null; + DataSetListApis?: Array; + } + export interface DataSetListFormProperties { + total: FormControl, + } + export function CreateDataSetListFormGroup() { + return new FormGroup({ + total: new FormControl(undefined), + }); + + } + + export interface DataSetListApis { + + /** To be used as a dataset parameter value */ + apiKey?: string | null; + + /** To be used as a version parameter value */ + apiVersionNumber?: string | null; + + /** The URL describing the dataset's fields */ + apiUrl?: string | null; + + /** A URL to the API console for each API */ + apiDocumentationUrl?: string | null; + } + export interface DataSetListApisFormProperties { + + /** To be used as a dataset parameter value */ + apiKey: FormControl, + + /** To be used as a version parameter value */ + apiVersionNumber: FormControl, + + /** The URL describing the dataset's fields */ + apiUrl: FormControl, + + /** A URL to the API console for each API */ + apiDocumentationUrl: FormControl, + } + export function CreateDataSetListApisFormGroup() { + return new FormGroup({ + apiKey: new FormControl(undefined), + apiVersionNumber: new FormControl(undefined), + apiUrl: new FormControl(undefined), + apiDocumentationUrl: new FormControl(undefined), + }); + + } + + @Injectable() + export class MetadataClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * List available data sets + * Get + * @return {DataSetList} Returns a list of data sets + */ + ListDataSets(): Observable { + return this.http.get(this.baseUri + '', {}); + } + + /** + * Provides the general information about the API and the list of fields that can be used to query the dataset. + * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. + * Get {dataset}/{version}/fields + * @param {string} dataset Name of the dataset. + * @param {string} version Version of the dataset. + * @return {string} The dataset API for the given version is found and it is accessible to consume. + */ + ListSearchableFields(dataset: string, version: string): Observable { + return this.http.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { responseType: 'text' }); + } + } + + @Injectable() + export class SearchClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/ValuesPaths.txt b/Tests/SwagTsTests/NG2FormGroupResults/ValuesPaths.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/ValuesPaths.txt rename to Tests/SwagTsTests/NG2FormGroupResults/ValuesPaths.ts index cc879854..a980b0bc 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/ValuesPaths.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/ValuesPaths.ts @@ -1,68 +1,68 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Get api/Values - * @return {Array} Success - */ - ValuesGet(): Observable> { - return this.http.get>(this.baseUri + 'api/Values', {}); - } - - /** - * Post api/Values - * @return {string} Success - */ - ValuesPost(requestBody: string): Observable { - return this.http.post(this.baseUri + 'api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Get api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {string} Success - */ - ValuesGetById(id: number): Observable { - return this.http.get(this.baseUri + 'api/Values/' + id, { responseType: 'text' }); - } - - /** - * Put api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesPutById(id: number, requestBody: string): Observable> { - return this.http.put(this.baseUri + 'api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesDeleteById(id: number): Observable> { - return this.http.delete(this.baseUri + 'api/Values/' + id, { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Get api/Values + * @return {Array} Success + */ + ValuesGet(): Observable> { + return this.http.get>(this.baseUri + 'api/Values', {}); + } + + /** + * Post api/Values + * @return {string} Success + */ + ValuesPost(requestBody: string): Observable { + return this.http.post(this.baseUri + 'api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Get api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {string} Success + */ + ValuesGetById(id: number): Observable { + return this.http.get(this.baseUri + 'api/Values/' + id, { responseType: 'text' }); + } + + /** + * Put api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesPutById(id: number, requestBody: string): Observable> { + return this.http.put(this.baseUri + 'api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesDeleteById(id: number): Observable> { + return this.http.delete(this.baseUri + 'api/Values/' + id, { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/googleBooksOpenApi.txt b/Tests/SwagTsTests/NG2FormGroupResults/googleBooksOpenApi.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/googleBooksOpenApi.txt rename to Tests/SwagTsTests/NG2FormGroupResults/googleBooksOpenApi.ts index 103258e7..905227c7 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/googleBooksOpenApi.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/googleBooksOpenApi.ts @@ -1,4356 +1,4356 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Annotation { - - /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ - afterSelectedText?: string | null; - - /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ - beforeSelectedText?: string | null; - - /** Selection ranges sent from the client. */ - clientVersionRanges?: AnnotationClientVersionRanges; - - /** Timestamp for the created time of this annotation. */ - created?: Date | null; - - /** Selection ranges for the most recent content version. */ - currentVersionRanges?: AnnotationCurrentVersionRanges; - - /** User-created data for this annotation. */ - data?: string | null; - - /** Indicates that this annotation is deleted. */ - deleted?: boolean | null; - - /** The highlight style for this annotation. */ - highlightStyle?: string | null; - - /** Id of this annotation, in the form of a GUID. */ - id?: string | null; - - /** Resource type. */ - kind?: string | null; - - /** The layer this annotation is for. */ - layerId?: string | null; - layerSummary?: AnnotationLayerSummary; - - /** Pages that this annotation spans. */ - pageIds?: Array; - - /** Excerpt from the volume. */ - selectedText?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Timestamp for the last time this annotation was modified. */ - updated?: Date | null; - - /** The volume that this annotation belongs to. */ - volumeId?: string | null; - } - export interface AnnotationFormProperties { - - /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ - afterSelectedText: FormControl, - - /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ - beforeSelectedText: FormControl, - - /** Timestamp for the created time of this annotation. */ - created: FormControl, - - /** User-created data for this annotation. */ - data: FormControl, - - /** Indicates that this annotation is deleted. */ - deleted: FormControl, - - /** The highlight style for this annotation. */ - highlightStyle: FormControl, - - /** Id of this annotation, in the form of a GUID. */ - id: FormControl, - - /** Resource type. */ - kind: FormControl, - - /** The layer this annotation is for. */ - layerId: FormControl, - - /** Excerpt from the volume. */ - selectedText: FormControl, - - /** URL to this resource. */ - selfLink: FormControl, - - /** Timestamp for the last time this annotation was modified. */ - updated: FormControl, - - /** The volume that this annotation belongs to. */ - volumeId: FormControl, - } - export function CreateAnnotationFormGroup() { - return new FormGroup({ - afterSelectedText: new FormControl(undefined), - beforeSelectedText: new FormControl(undefined), - created: new FormControl(undefined), - data: new FormControl(undefined), - deleted: new FormControl(undefined), - highlightStyle: new FormControl(undefined), - id: new FormControl(undefined), - kind: new FormControl(undefined), - layerId: new FormControl(undefined), - selectedText: new FormControl(undefined), - selfLink: new FormControl(undefined), - updated: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface AnnotationClientVersionRanges { - cfiRange?: BooksAnnotationsRange; - - /** Content version the client sent in. */ - contentVersion?: string | null; - gbImageRange?: BooksAnnotationsRange; - gbTextRange?: BooksAnnotationsRange; - imageCfiRange?: BooksAnnotationsRange; - } - export interface AnnotationClientVersionRangesFormProperties { - - /** Content version the client sent in. */ - contentVersion: FormControl, - } - export function CreateAnnotationClientVersionRangesFormGroup() { - return new FormGroup({ - contentVersion: new FormControl(undefined), - }); - - } - - export interface BooksAnnotationsRange { - - /** The offset from the ending position. */ - endOffset?: string | null; - - /** The ending position for the range. */ - endPosition?: string | null; - - /** The offset from the starting position. */ - startOffset?: string | null; - - /** The starting position for the range. */ - startPosition?: string | null; - } - export interface BooksAnnotationsRangeFormProperties { - - /** The offset from the ending position. */ - endOffset: FormControl, - - /** The ending position for the range. */ - endPosition: FormControl, - - /** The offset from the starting position. */ - startOffset: FormControl, - - /** The starting position for the range. */ - startPosition: FormControl, - } - export function CreateBooksAnnotationsRangeFormGroup() { - return new FormGroup({ - endOffset: new FormControl(undefined), - endPosition: new FormControl(undefined), - startOffset: new FormControl(undefined), - startPosition: new FormControl(undefined), - }); - - } - - export interface AnnotationCurrentVersionRanges { - cfiRange?: BooksAnnotationsRange; - - /** Content version applicable to ranges below. */ - contentVersion?: string | null; - gbImageRange?: BooksAnnotationsRange; - gbTextRange?: BooksAnnotationsRange; - imageCfiRange?: BooksAnnotationsRange; - } - export interface AnnotationCurrentVersionRangesFormProperties { - - /** Content version applicable to ranges below. */ - contentVersion: FormControl, - } - export function CreateAnnotationCurrentVersionRangesFormGroup() { - return new FormGroup({ - contentVersion: new FormControl(undefined), - }); - - } - - export interface AnnotationLayerSummary { - - /** - * Maximum allowed characters on this layer, especially for the "copy" layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - allowedCharacterCount?: number | null; - - /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ - limitType?: string | null; - - /** - * Remaining allowed characters on this layer, especially for the "copy" layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - remainingCharacterCount?: number | null; - } - export interface AnnotationLayerSummaryFormProperties { - - /** - * Maximum allowed characters on this layer, especially for the "copy" layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - allowedCharacterCount: FormControl, - - /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ - limitType: FormControl, - - /** - * Remaining allowed characters on this layer, especially for the "copy" layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - remainingCharacterCount: FormControl, - } - export function CreateAnnotationLayerSummaryFormGroup() { - return new FormGroup({ - allowedCharacterCount: new FormControl(undefined), - limitType: new FormControl(undefined), - remainingCharacterCount: new FormControl(undefined), - }); - - } - - export interface Annotationdata { - - /** The type of annotation this data is for. */ - annotationType?: string | null; - data?: any; - - /** Base64 encoded data for this annotation data. */ - encoded_data?: string | null; - - /** Unique id for this annotation data. */ - id?: string | null; - - /** Resource Type */ - kind?: string | null; - - /** The Layer id for this data. * */ - layerId?: string | null; - - /** URL for this resource. * */ - selfLink?: string | null; - - /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - - /** The volume id for this data. * */ - volumeId?: string | null; - } - export interface AnnotationdataFormProperties { - - /** The type of annotation this data is for. */ - annotationType: FormControl, - data: FormControl, - - /** Base64 encoded data for this annotation data. */ - encoded_data: FormControl, - - /** Unique id for this annotation data. */ - id: FormControl, - - /** Resource Type */ - kind: FormControl, - - /** The Layer id for this data. * */ - layerId: FormControl, - - /** URL for this resource. * */ - selfLink: FormControl, - - /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ - updated: FormControl, - - /** The volume id for this data. * */ - volumeId: FormControl, - } - export function CreateAnnotationdataFormGroup() { - return new FormGroup({ - annotationType: new FormControl(undefined), - data: new FormControl(undefined), - encoded_data: new FormControl(undefined), - id: new FormControl(undefined), - kind: new FormControl(undefined), - layerId: new FormControl(undefined), - selfLink: new FormControl(undefined), - updated: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface Annotations { - - /** A list of annotations. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken?: string | null; - - /** - * Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - export interface AnnotationsFormProperties { - - /** Resource type. */ - kind: FormControl, - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken: FormControl, - - /** - * Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems: FormControl, - } - export function CreateAnnotationsFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - nextPageToken: new FormControl(undefined), - totalItems: new FormControl(undefined), - }); - - } - - export interface AnnotationsSummary { - kind?: string | null; - AnnotationsSummaryLayers?: Array; - } - export interface AnnotationsSummaryFormProperties { - kind: FormControl, - } - export function CreateAnnotationsSummaryFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface AnnotationsSummaryLayers { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - allowedCharacterCount?: number | null; - layerId?: string | null; - limitType?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - remainingCharacterCount?: number | null; - updated?: Date | null; - } - export interface AnnotationsSummaryLayersFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - allowedCharacterCount: FormControl, - layerId: FormControl, - limitType: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - remainingCharacterCount: FormControl, - updated: FormControl, - } - export function CreateAnnotationsSummaryLayersFormGroup() { - return new FormGroup({ - allowedCharacterCount: new FormControl(undefined), - layerId: new FormControl(undefined), - limitType: new FormControl(undefined), - remainingCharacterCount: new FormControl(undefined), - updated: new FormControl(undefined), - }); - - } - - export interface Annotationsdata { - - /** A list of Annotation Data. */ - items?: Array; - - /** Resource type */ - kind?: string | null; - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken?: string | null; - - /** - * The total number of volume annotations found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - export interface AnnotationsdataFormProperties { - - /** Resource type */ - kind: FormControl, - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken: FormControl, - - /** - * The total number of volume annotations found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems: FormControl, - } - export function CreateAnnotationsdataFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - nextPageToken: new FormControl(undefined), - totalItems: new FormControl(undefined), - }); - - } - - export interface BooksCloudloadingResource { - author?: string | null; - processingState?: string | null; - title?: string | null; - volumeId?: string | null; - } - export interface BooksCloudloadingResourceFormProperties { - author: FormControl, - processingState: FormControl, - title: FormControl, - volumeId: FormControl, - } - export function CreateBooksCloudloadingResourceFormGroup() { - return new FormGroup({ - author: new FormControl(undefined), - processingState: new FormControl(undefined), - title: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface BooksSubscriptionReleaseInfo { - - /** Amount in micros of the specified currency code. */ - amountInMicros?: string | null; - - /** Currency code of the amount. */ - currencyCode?: string | null; - - /** The release number of this issue/volume/book. */ - releaseNumber?: string | null; - - /** The release date. */ - releaseTimestampUs?: string | null; - } - export interface BooksSubscriptionReleaseInfoFormProperties { - - /** Amount in micros of the specified currency code. */ - amountInMicros: FormControl, - - /** Currency code of the amount. */ - currencyCode: FormControl, - - /** The release number of this issue/volume/book. */ - releaseNumber: FormControl, - - /** The release date. */ - releaseTimestampUs: FormControl, - } - export function CreateBooksSubscriptionReleaseInfoFormGroup() { - return new FormGroup({ - amountInMicros: new FormControl(undefined), - currencyCode: new FormControl(undefined), - releaseNumber: new FormControl(undefined), - releaseTimestampUs: new FormControl(undefined), - }); - - } - - export interface BooksVolumesRecommendedRateResponse { - consistency_token?: string | null; - } - export interface BooksVolumesRecommendedRateResponseFormProperties { - consistency_token: FormControl, - } - export function CreateBooksVolumesRecommendedRateResponseFormGroup() { - return new FormGroup({ - consistency_token: new FormControl(undefined), - }); - - } - - export interface Bookshelf { - - /** Whether this bookshelf is PUBLIC or PRIVATE. */ - access?: string | null; - - /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ - created?: Date | null; - - /** Description of this bookshelf. */ - description?: string | null; - - /** - * Id of this bookshelf, only unique by user. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - id?: number | null; - - /** Resource type for bookshelf metadata. */ - kind?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Title of this bookshelf. */ - title?: string | null; - - /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ - updated?: Date | null; - - /** - * Number of volumes in this bookshelf. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - volumeCount?: number | null; - - /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ - volumesLastUpdated?: Date | null; - } - export interface BookshelfFormProperties { - - /** Whether this bookshelf is PUBLIC or PRIVATE. */ - access: FormControl, - - /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ - created: FormControl, - - /** Description of this bookshelf. */ - description: FormControl, - - /** - * Id of this bookshelf, only unique by user. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - id: FormControl, - - /** Resource type for bookshelf metadata. */ - kind: FormControl, - - /** URL to this resource. */ - selfLink: FormControl, - - /** Title of this bookshelf. */ - title: FormControl, - - /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ - updated: FormControl, - - /** - * Number of volumes in this bookshelf. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - volumeCount: FormControl, - - /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ - volumesLastUpdated: FormControl, - } - export function CreateBookshelfFormGroup() { - return new FormGroup({ - access: new FormControl(undefined), - created: new FormControl(undefined), - description: new FormControl(undefined), - id: new FormControl(undefined), - kind: new FormControl(undefined), - selfLink: new FormControl(undefined), - title: new FormControl(undefined), - updated: new FormControl(undefined), - volumeCount: new FormControl(undefined), - volumesLastUpdated: new FormControl(undefined), - }); - - } - - export interface Bookshelves { - - /** A list of bookshelves. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - } - export interface BookshelvesFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateBookshelvesFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface Category { - - /** A list of onboarding categories. */ - CategoryItems?: Array; - - /** Resource type. */ - kind?: string | null; - } - export interface CategoryFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface CategoryItems { - badgeUrl?: string | null; - categoryId?: string | null; - name?: string | null; - } - export interface CategoryItemsFormProperties { - badgeUrl: FormControl, - categoryId: FormControl, - name: FormControl, - } - export function CreateCategoryItemsFormGroup() { - return new FormGroup({ - badgeUrl: new FormControl(undefined), - categoryId: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - export interface ConcurrentAccessRestriction { - - /** Whether access is granted for this (user, device, volume). */ - deviceAllowed?: boolean | null; - - /** Resource type. */ - kind?: string | null; - - /** - * The maximum number of concurrent access licenses for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxConcurrentDevices?: number | null; - - /** Error/warning message. */ - message?: string | null; - - /** Client nonce for verification. Download access and client-validation only. */ - nonce?: string | null; - - /** Error/warning reason code. */ - reasonCode?: string | null; - - /** Whether this volume has any concurrent access restrictions. */ - restricted?: boolean | null; - - /** Response signature. */ - signature?: string | null; - - /** Client app identifier for verification. Download access and client-validation only. */ - source?: string | null; - - /** - * Time in seconds for license auto-expiration. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - timeWindowSeconds?: number | null; - - /** Identifies the volume for which this entry applies. */ - volumeId?: string | null; - } - export interface ConcurrentAccessRestrictionFormProperties { - - /** Whether access is granted for this (user, device, volume). */ - deviceAllowed: FormControl, - - /** Resource type. */ - kind: FormControl, - - /** - * The maximum number of concurrent access licenses for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxConcurrentDevices: FormControl, - - /** Error/warning message. */ - message: FormControl, - - /** Client nonce for verification. Download access and client-validation only. */ - nonce: FormControl, - - /** Error/warning reason code. */ - reasonCode: FormControl, - - /** Whether this volume has any concurrent access restrictions. */ - restricted: FormControl, - - /** Response signature. */ - signature: FormControl, - - /** Client app identifier for verification. Download access and client-validation only. */ - source: FormControl, - - /** - * Time in seconds for license auto-expiration. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - timeWindowSeconds: FormControl, - - /** Identifies the volume for which this entry applies. */ - volumeId: FormControl, - } - export function CreateConcurrentAccessRestrictionFormGroup() { - return new FormGroup({ - deviceAllowed: new FormControl(undefined), - kind: new FormControl(undefined), - maxConcurrentDevices: new FormControl(undefined), - message: new FormControl(undefined), - nonce: new FormControl(undefined), - reasonCode: new FormControl(undefined), - restricted: new FormControl(undefined), - signature: new FormControl(undefined), - source: new FormControl(undefined), - timeWindowSeconds: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface Dictlayerdata { - common?: DictlayerdataCommon; - dict?: DictlayerdataDict; - kind?: string | null; - } - export interface DictlayerdataFormProperties { - kind: FormControl, - } - export function CreateDictlayerdataFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface DictlayerdataCommon { - - /** The display title and localized canonical name to use when searching for this entity on Google search. */ - title?: string | null; - } - export interface DictlayerdataCommonFormProperties { - - /** The display title and localized canonical name to use when searching for this entity on Google search. */ - title: FormControl, - } - export function CreateDictlayerdataCommonFormGroup() { - return new FormGroup({ - title: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDict { - - /** The source, url and attribution for this dictionary data. */ - source?: DictlayerdataDictSource; - DictlayerdataDictWords?: Array; - } - export interface DictlayerdataDictFormProperties { - } - export function CreateDictlayerdataDictFormGroup() { - return new FormGroup({ - }); - - } - - export interface DictlayerdataDictSource { - attribution?: string | null; - url?: string | null; - } - export interface DictlayerdataDictSourceFormProperties { - attribution: FormControl, - url: FormControl, - } - export function CreateDictlayerdataDictSourceFormGroup() { - return new FormGroup({ - attribution: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWords { - DictlayerdataDictWordsDerivatives?: Array; - DictlayerdataDictWordsExamples?: Array; - DictlayerdataDictWordsSenses?: Array; - - /** The words with different meanings but not related words, e.g. "go" (game) and "go" (verb). */ - source?: DictlayerdataDictWordsSource; - } - export interface DictlayerdataDictWordsFormProperties { - } - export function CreateDictlayerdataDictWordsFormGroup() { - return new FormGroup({ - }); - - } - - export interface DictlayerdataDictWordsDerivatives { - source?: DictlayerdataDictWordsDerivativesSource; - text?: string | null; - } - export interface DictlayerdataDictWordsDerivativesFormProperties { - text: FormControl, - } - export function CreateDictlayerdataDictWordsDerivativesFormGroup() { - return new FormGroup({ - text: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsDerivativesSource { - attribution?: string | null; - url?: string | null; - } - export interface DictlayerdataDictWordsDerivativesSourceFormProperties { - attribution: FormControl, - url: FormControl, - } - export function CreateDictlayerdataDictWordsDerivativesSourceFormGroup() { - return new FormGroup({ - attribution: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsExamples { - source?: DictlayerdataDictWordsExamplesSource; - text?: string | null; - } - export interface DictlayerdataDictWordsExamplesFormProperties { - text: FormControl, - } - export function CreateDictlayerdataDictWordsExamplesFormGroup() { - return new FormGroup({ - text: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsExamplesSource { - attribution?: string | null; - url?: string | null; - } - export interface DictlayerdataDictWordsExamplesSourceFormProperties { - attribution: FormControl, - url: FormControl, - } - export function CreateDictlayerdataDictWordsExamplesSourceFormGroup() { - return new FormGroup({ - attribution: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSenses { - DictlayerdataDictWordsSensesConjugations?: Array; - DictlayerdataDictWordsSensesDefinitions?: Array; - partOfSpeech?: string | null; - pronunciation?: string | null; - pronunciationUrl?: string | null; - source?: DictlayerdataDictWordsSensesSource; - syllabification?: string | null; - DictlayerdataDictWordsSensesSynonyms?: Array; - } - export interface DictlayerdataDictWordsSensesFormProperties { - partOfSpeech: FormControl, - pronunciation: FormControl, - pronunciationUrl: FormControl, - syllabification: FormControl, - } - export function CreateDictlayerdataDictWordsSensesFormGroup() { - return new FormGroup({ - partOfSpeech: new FormControl(undefined), - pronunciation: new FormControl(undefined), - pronunciationUrl: new FormControl(undefined), - syllabification: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSensesConjugations { - type?: string | null; - value?: string | null; - } - export interface DictlayerdataDictWordsSensesConjugationsFormProperties { - type: FormControl, - value: FormControl, - } - export function CreateDictlayerdataDictWordsSensesConjugationsFormGroup() { - return new FormGroup({ - type: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSensesDefinitions { - definition?: string | null; - DictlayerdataDictWordsSensesDefinitionsExamples?: Array; - } - export interface DictlayerdataDictWordsSensesDefinitionsFormProperties { - definition: FormControl, - } - export function CreateDictlayerdataDictWordsSensesDefinitionsFormGroup() { - return new FormGroup({ - definition: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSensesDefinitionsExamples { - source?: DictlayerdataDictWordsSensesDefinitionsExamplesSource; - text?: string | null; - } - export interface DictlayerdataDictWordsSensesDefinitionsExamplesFormProperties { - text: FormControl, - } - export function CreateDictlayerdataDictWordsSensesDefinitionsExamplesFormGroup() { - return new FormGroup({ - text: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSensesDefinitionsExamplesSource { - attribution?: string | null; - url?: string | null; - } - export interface DictlayerdataDictWordsSensesDefinitionsExamplesSourceFormProperties { - attribution: FormControl, - url: FormControl, - } - export function CreateDictlayerdataDictWordsSensesDefinitionsExamplesSourceFormGroup() { - return new FormGroup({ - attribution: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSensesSource { - attribution?: string | null; - url?: string | null; - } - export interface DictlayerdataDictWordsSensesSourceFormProperties { - attribution: FormControl, - url: FormControl, - } - export function CreateDictlayerdataDictWordsSensesSourceFormGroup() { - return new FormGroup({ - attribution: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSensesSynonyms { - source?: DictlayerdataDictWordsSensesSynonymsSource; - text?: string | null; - } - export interface DictlayerdataDictWordsSensesSynonymsFormProperties { - text: FormControl, - } - export function CreateDictlayerdataDictWordsSensesSynonymsFormGroup() { - return new FormGroup({ - text: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSensesSynonymsSource { - attribution?: string | null; - url?: string | null; - } - export interface DictlayerdataDictWordsSensesSynonymsSourceFormProperties { - attribution: FormControl, - url: FormControl, - } - export function CreateDictlayerdataDictWordsSensesSynonymsSourceFormGroup() { - return new FormGroup({ - attribution: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface DictlayerdataDictWordsSource { - attribution?: string | null; - url?: string | null; - } - export interface DictlayerdataDictWordsSourceFormProperties { - attribution: FormControl, - url: FormControl, - } - export function CreateDictlayerdataDictWordsSourceFormGroup() { - return new FormGroup({ - attribution: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface Discoveryclusters { - DiscoveryclustersClusters?: Array; - - /** Resorce type. */ - kind?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - totalClusters?: number | null; - } - export interface DiscoveryclustersFormProperties { - - /** Resorce type. */ - kind: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - totalClusters: FormControl, - } - export function CreateDiscoveryclustersFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - totalClusters: new FormControl(undefined), - }); - - } - - export interface DiscoveryclustersClusters { - banner_with_content_container?: DiscoveryclustersClustersBanner_with_content_container; - subTitle?: string | null; - title?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - totalVolumes?: number | null; - uid?: string | null; - volumes?: Array; - } - export interface DiscoveryclustersClustersFormProperties { - subTitle: FormControl, - title: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - totalVolumes: FormControl, - uid: FormControl, - } - export function CreateDiscoveryclustersClustersFormGroup() { - return new FormGroup({ - subTitle: new FormControl(undefined), - title: new FormControl(undefined), - totalVolumes: new FormControl(undefined), - uid: new FormControl(undefined), - }); - - } - - export interface DiscoveryclustersClustersBanner_with_content_container { - fillColorArgb?: string | null; - imageUrl?: string | null; - maskColorArgb?: string | null; - moreButtonText?: string | null; - moreButtonUrl?: string | null; - textColorArgb?: string | null; - } - export interface DiscoveryclustersClustersBanner_with_content_containerFormProperties { - fillColorArgb: FormControl, - imageUrl: FormControl, - maskColorArgb: FormControl, - moreButtonText: FormControl, - moreButtonUrl: FormControl, - textColorArgb: FormControl, - } - export function CreateDiscoveryclustersClustersBanner_with_content_containerFormGroup() { - return new FormGroup({ - fillColorArgb: new FormControl(undefined), - imageUrl: new FormControl(undefined), - maskColorArgb: new FormControl(undefined), - moreButtonText: new FormControl(undefined), - moreButtonUrl: new FormControl(undefined), - textColorArgb: new FormControl(undefined), - }); - - } - - export interface Volume { - - /** Any information about a volume related to reading or obtaining that volume text. This information can depend on country (books may be public domain in one country but not in another, e.g.). */ - accessInfo?: VolumeAccessInfo; - - /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ - etag?: string | null; - - /** Unique identifier for a volume. (In LITE projection.) */ - id?: string | null; - - /** Resource type for a volume. (In LITE projection.) */ - kind?: string | null; - - /** What layers exist in this volume and high level information about them. */ - layerInfo?: VolumeLayerInfo; - - /** Recommendation related information for this volume. */ - recommendedInfo?: VolumeRecommendedInfo; - - /** Any information about a volume related to the eBookstore and/or purchaseability. This information can depend on the country where the request originates from (i.e. books may not be for sale in certain countries). */ - saleInfo?: VolumeSaleInfo; - - /** Search result information related to this volume. */ - searchInfo?: VolumeSearchInfo; - - /** URL to this resource. (In LITE projection.) */ - selfLink?: string | null; - - /** User specific information related to this volume. (e.g. page this user last read or whether they purchased this book) */ - userInfo?: VolumeUserInfo; - - /** General volume information. */ - volumeInfo?: VolumeVolumeInfo; - } - export interface VolumeFormProperties { - - /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ - etag: FormControl, - - /** Unique identifier for a volume. (In LITE projection.) */ - id: FormControl, - - /** Resource type for a volume. (In LITE projection.) */ - kind: FormControl, - - /** URL to this resource. (In LITE projection.) */ - selfLink: FormControl, - } - export function CreateVolumeFormGroup() { - return new FormGroup({ - etag: new FormControl(undefined), - id: new FormControl(undefined), - kind: new FormControl(undefined), - selfLink: new FormControl(undefined), - }); - - } - - export interface VolumeAccessInfo { - - /** Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE projection.) */ - accessViewStatus?: string | null; - - /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ - country?: string | null; - downloadAccess?: DownloadAccessRestriction; - - /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ - driveImportedContentLink?: string | null; - - /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ - embeddable?: boolean | null; - - /** Information about epub content. (In LITE projection.) */ - epub?: VolumeAccessInfoEpub; - - /** Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the content, if the client supports it. */ - explicitOfflineLicenseManagement?: boolean | null; - - /** Information about pdf content. (In LITE projection.) */ - pdf?: VolumeAccessInfoPdf; - - /** Whether or not this book is public domain in the country listed above. */ - publicDomain?: boolean | null; - - /** Whether quote sharing is allowed for this volume. */ - quoteSharingAllowed?: boolean | null; - - /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ - textToSpeechPermission?: string | null; - - /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ - viewOrderUrl?: string | null; - - /** The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as non-eBooks. Public domain books will always have a value of ALL_PAGES. */ - viewability?: string | null; - - /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ - webReaderLink?: string | null; - } - export interface VolumeAccessInfoFormProperties { - - /** Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE projection.) */ - accessViewStatus: FormControl, - - /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ - country: FormControl, - - /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ - driveImportedContentLink: FormControl, - - /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ - embeddable: FormControl, - - /** Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the content, if the client supports it. */ - explicitOfflineLicenseManagement: FormControl, - - /** Whether or not this book is public domain in the country listed above. */ - publicDomain: FormControl, - - /** Whether quote sharing is allowed for this volume. */ - quoteSharingAllowed: FormControl, - - /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ - textToSpeechPermission: FormControl, - - /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ - viewOrderUrl: FormControl, - - /** The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as non-eBooks. Public domain books will always have a value of ALL_PAGES. */ - viewability: FormControl, - - /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ - webReaderLink: FormControl, - } - export function CreateVolumeAccessInfoFormGroup() { - return new FormGroup({ - accessViewStatus: new FormControl(undefined), - country: new FormControl(undefined), - driveImportedContentLink: new FormControl(undefined), - embeddable: new FormControl(undefined), - explicitOfflineLicenseManagement: new FormControl(undefined), - publicDomain: new FormControl(undefined), - quoteSharingAllowed: new FormControl(undefined), - textToSpeechPermission: new FormControl(undefined), - viewOrderUrl: new FormControl(undefined), - viewability: new FormControl(undefined), - webReaderLink: new FormControl(undefined), - }); - - } - - export interface DownloadAccessRestriction { - - /** If restricted, whether access is granted for this (user, device, volume). */ - deviceAllowed?: boolean | null; - - /** - * If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - downloadsAcquired?: number | null; - - /** If deviceAllowed, whether access was just acquired with this request. */ - justAcquired?: boolean | null; - - /** Resource type. */ - kind?: string | null; - - /** - * If restricted, the maximum number of content download licenses for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxDownloadDevices?: number | null; - - /** Error/warning message. */ - message?: string | null; - - /** Client nonce for verification. Download access and client-validation only. */ - nonce?: string | null; - - /** Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS */ - reasonCode?: string | null; - - /** Whether this volume has any download access restrictions. */ - restricted?: boolean | null; - - /** Response signature. */ - signature?: string | null; - - /** Client app identifier for verification. Download access and client-validation only. */ - source?: string | null; - - /** Identifies the volume for which this entry applies. */ - volumeId?: string | null; - } - export interface DownloadAccessRestrictionFormProperties { - - /** If restricted, whether access is granted for this (user, device, volume). */ - deviceAllowed: FormControl, - - /** - * If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - downloadsAcquired: FormControl, - - /** If deviceAllowed, whether access was just acquired with this request. */ - justAcquired: FormControl, - - /** Resource type. */ - kind: FormControl, - - /** - * If restricted, the maximum number of content download licenses for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxDownloadDevices: FormControl, - - /** Error/warning message. */ - message: FormControl, - - /** Client nonce for verification. Download access and client-validation only. */ - nonce: FormControl, - - /** Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS */ - reasonCode: FormControl, - - /** Whether this volume has any download access restrictions. */ - restricted: FormControl, - - /** Response signature. */ - signature: FormControl, - - /** Client app identifier for verification. Download access and client-validation only. */ - source: FormControl, - - /** Identifies the volume for which this entry applies. */ - volumeId: FormControl, - } - export function CreateDownloadAccessRestrictionFormGroup() { - return new FormGroup({ - deviceAllowed: new FormControl(undefined), - downloadsAcquired: new FormControl(undefined), - justAcquired: new FormControl(undefined), - kind: new FormControl(undefined), - maxDownloadDevices: new FormControl(undefined), - message: new FormControl(undefined), - nonce: new FormControl(undefined), - reasonCode: new FormControl(undefined), - restricted: new FormControl(undefined), - signature: new FormControl(undefined), - source: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface VolumeAccessInfoEpub { - - /** URL to retrieve ACS token for epub download. (In LITE projection.) */ - acsTokenLink?: string | null; - - /** URL to download epub. (In LITE projection.) */ - downloadLink?: string | null; - - /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ - isAvailable?: boolean | null; - } - export interface VolumeAccessInfoEpubFormProperties { - - /** URL to retrieve ACS token for epub download. (In LITE projection.) */ - acsTokenLink: FormControl, - - /** URL to download epub. (In LITE projection.) */ - downloadLink: FormControl, - - /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ - isAvailable: FormControl, - } - export function CreateVolumeAccessInfoEpubFormGroup() { - return new FormGroup({ - acsTokenLink: new FormControl(undefined), - downloadLink: new FormControl(undefined), - isAvailable: new FormControl(undefined), - }); - - } - - export interface VolumeAccessInfoPdf { - - /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ - acsTokenLink?: string | null; - - /** URL to download pdf. (In LITE projection.) */ - downloadLink?: string | null; - - /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ - isAvailable?: boolean | null; - } - export interface VolumeAccessInfoPdfFormProperties { - - /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ - acsTokenLink: FormControl, - - /** URL to download pdf. (In LITE projection.) */ - downloadLink: FormControl, - - /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ - isAvailable: FormControl, - } - export function CreateVolumeAccessInfoPdfFormGroup() { - return new FormGroup({ - acsTokenLink: new FormControl(undefined), - downloadLink: new FormControl(undefined), - isAvailable: new FormControl(undefined), - }); - - } - - export interface VolumeLayerInfo { - - /** A layer should appear here if and only if the layer exists for this book. */ - VolumeLayerInfoLayers?: Array; - } - export interface VolumeLayerInfoFormProperties { - } - export function CreateVolumeLayerInfoFormGroup() { - return new FormGroup({ - }); - - } - - export interface VolumeLayerInfoLayers { - - /** The layer id of this layer (e.g. "geo"). */ - layerId?: string | null; - - /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ - volumeAnnotationsVersion?: string | null; - } - export interface VolumeLayerInfoLayersFormProperties { - - /** The layer id of this layer (e.g. "geo"). */ - layerId: FormControl, - - /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ - volumeAnnotationsVersion: FormControl, - } - export function CreateVolumeLayerInfoLayersFormGroup() { - return new FormGroup({ - layerId: new FormControl(undefined), - volumeAnnotationsVersion: new FormControl(undefined), - }); - - } - - export interface VolumeRecommendedInfo { - - /** A text explaining why this volume is recommended. */ - explanation?: string | null; - } - export interface VolumeRecommendedInfoFormProperties { - - /** A text explaining why this volume is recommended. */ - explanation: FormControl, - } - export function CreateVolumeRecommendedInfoFormGroup() { - return new FormGroup({ - explanation: new FormControl(undefined), - }); - - } - - export interface VolumeSaleInfo { - - /** URL to purchase this volume on the Google Books site. (In LITE projection) */ - buyLink?: string | null; - - /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ - country?: string | null; - - /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ - isEbook?: boolean | null; - - /** Suggested retail price. (In LITE projection.) */ - listPrice?: VolumeSaleInfoListPrice; - - /** Offers available for this volume (sales and rentals). */ - VolumeSaleInfoOffers?: Array; - - /** The date on which this book is available for sale. */ - onSaleDate?: Date | null; - - /** The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In LITE projection.) */ - retailPrice?: VolumeSaleInfoRetailPrice; - - /** Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. */ - saleability?: string | null; - } - export interface VolumeSaleInfoFormProperties { - - /** URL to purchase this volume on the Google Books site. (In LITE projection) */ - buyLink: FormControl, - - /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ - country: FormControl, - - /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ - isEbook: FormControl, - - /** The date on which this book is available for sale. */ - onSaleDate: FormControl, - - /** Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. */ - saleability: FormControl, - } - export function CreateVolumeSaleInfoFormGroup() { - return new FormGroup({ - buyLink: new FormControl(undefined), - country: new FormControl(undefined), - isEbook: new FormControl(undefined), - onSaleDate: new FormControl(undefined), - saleability: new FormControl(undefined), - }); - - } - - export interface VolumeSaleInfoListPrice { - - /** - * Amount in the currency listed below. (In LITE projection.) - * Type: double - */ - amount?: number | null; - - /** An ISO 4217, three-letter currency code. (In LITE projection.) */ - currencyCode?: string | null; - } - export interface VolumeSaleInfoListPriceFormProperties { - - /** - * Amount in the currency listed below. (In LITE projection.) - * Type: double - */ - amount: FormControl, - - /** An ISO 4217, three-letter currency code. (In LITE projection.) */ - currencyCode: FormControl, - } - export function CreateVolumeSaleInfoListPriceFormGroup() { - return new FormGroup({ - amount: new FormControl(undefined), - currencyCode: new FormControl(undefined), - }); - - } - - export interface VolumeSaleInfoOffers { - - /** - * The finsky offer type (e.g., PURCHASE=0 RENTAL=3) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - finskyOfferType?: number | null; - - /** Indicates whether the offer is giftable. */ - giftable?: boolean | null; - - /** Offer list (=undiscounted) price in Micros. */ - listPrice?: VolumeSaleInfoOffersListPrice; - - /** The rental duration (for rental offers only). */ - rentalDuration?: VolumeSaleInfoOffersRentalDuration; - - /** Offer retail (=discounted) price in Micros */ - retailPrice?: VolumeSaleInfoOffersRetailPrice; - } - export interface VolumeSaleInfoOffersFormProperties { - - /** - * The finsky offer type (e.g., PURCHASE=0 RENTAL=3) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - finskyOfferType: FormControl, - - /** Indicates whether the offer is giftable. */ - giftable: FormControl, - } - export function CreateVolumeSaleInfoOffersFormGroup() { - return new FormGroup({ - finskyOfferType: new FormControl(undefined), - giftable: new FormControl(undefined), - }); - - } - - export interface VolumeSaleInfoOffersListPrice { - - /** Type: double */ - amountInMicros?: number | null; - currencyCode?: string | null; - } - export interface VolumeSaleInfoOffersListPriceFormProperties { - - /** Type: double */ - amountInMicros: FormControl, - currencyCode: FormControl, - } - export function CreateVolumeSaleInfoOffersListPriceFormGroup() { - return new FormGroup({ - amountInMicros: new FormControl(undefined), - currencyCode: new FormControl(undefined), - }); - - } - - export interface VolumeSaleInfoOffersRentalDuration { - - /** Type: double */ - count?: number | null; - unit?: string | null; - } - export interface VolumeSaleInfoOffersRentalDurationFormProperties { - - /** Type: double */ - count: FormControl, - unit: FormControl, - } - export function CreateVolumeSaleInfoOffersRentalDurationFormGroup() { - return new FormGroup({ - count: new FormControl(undefined), - unit: new FormControl(undefined), - }); - - } - - export interface VolumeSaleInfoOffersRetailPrice { - - /** Type: double */ - amountInMicros?: number | null; - currencyCode?: string | null; - } - export interface VolumeSaleInfoOffersRetailPriceFormProperties { - - /** Type: double */ - amountInMicros: FormControl, - currencyCode: FormControl, - } - export function CreateVolumeSaleInfoOffersRetailPriceFormGroup() { - return new FormGroup({ - amountInMicros: new FormControl(undefined), - currencyCode: new FormControl(undefined), - }); - - } - - export interface VolumeSaleInfoRetailPrice { - - /** - * Amount in the currency listed below. (In LITE projection.) - * Type: double - */ - amount?: number | null; - - /** An ISO 4217, three-letter currency code. (In LITE projection.) */ - currencyCode?: string | null; - } - export interface VolumeSaleInfoRetailPriceFormProperties { - - /** - * Amount in the currency listed below. (In LITE projection.) - * Type: double - */ - amount: FormControl, - - /** An ISO 4217, three-letter currency code. (In LITE projection.) */ - currencyCode: FormControl, - } - export function CreateVolumeSaleInfoRetailPriceFormGroup() { - return new FormGroup({ - amount: new FormControl(undefined), - currencyCode: new FormControl(undefined), - }); - - } - - export interface VolumeSearchInfo { - - /** A text snippet containing the search query. */ - textSnippet?: string | null; - } - export interface VolumeSearchInfoFormProperties { - - /** A text snippet containing the search query. */ - textSnippet: FormControl, - } - export function CreateVolumeSearchInfoFormGroup() { - return new FormGroup({ - textSnippet: new FormControl(undefined), - }); - - } - - export interface VolumeUserInfo { - - /** Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family sharing, etc. */ - acquiredTime?: Date | null; - - /** - * How this volume was acquired. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - acquisitionType?: number | null; - - /** Copy/Paste accounting information. */ - copy?: VolumeUserInfoCopy; - - /** - * Whether this volume is purchased, sample, pd download etc. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - entitlementType?: number | null; - - /** Information on the ability to share with the family. */ - familySharing?: VolumeUserInfoFamilySharing; - - /** Whether or not the user shared this volume with the family. */ - isFamilySharedFromUser?: boolean | null; - - /** Whether or not the user received this volume through family sharing. */ - isFamilySharedToUser?: boolean | null; - - /** Deprecated: Replaced by familySharing. */ - isFamilySharingAllowed?: boolean | null; - - /** Deprecated: Replaced by familySharing. */ - isFamilySharingDisabledByFop?: boolean | null; - - /** Whether or not this volume is currently in "my books." */ - isInMyBooks?: boolean | null; - - /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ - isPreordered?: boolean | null; - - /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ - isPurchased?: boolean | null; - - /** Whether or not this volume was user uploaded. */ - isUploaded?: boolean | null; - readingPosition?: ReadingPosition; - - /** Period during this book is/was a valid rental. */ - rentalPeriod?: VolumeUserInfoRentalPeriod; - - /** Whether this book is an active or an expired rental. */ - rentalState?: string | null; - review?: Review; - - /** Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - userUploadedVolumeInfo?: VolumeUserInfoUserUploadedVolumeInfo; - } - export interface VolumeUserInfoFormProperties { - - /** Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family sharing, etc. */ - acquiredTime: FormControl, - - /** - * How this volume was acquired. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - acquisitionType: FormControl, - - /** - * Whether this volume is purchased, sample, pd download etc. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - entitlementType: FormControl, - - /** Whether or not the user shared this volume with the family. */ - isFamilySharedFromUser: FormControl, - - /** Whether or not the user received this volume through family sharing. */ - isFamilySharedToUser: FormControl, - - /** Deprecated: Replaced by familySharing. */ - isFamilySharingAllowed: FormControl, - - /** Deprecated: Replaced by familySharing. */ - isFamilySharingDisabledByFop: FormControl, - - /** Whether or not this volume is currently in "my books." */ - isInMyBooks: FormControl, - - /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ - isPreordered: FormControl, - - /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ - isPurchased: FormControl, - - /** Whether or not this volume was user uploaded. */ - isUploaded: FormControl, - - /** Whether this book is an active or an expired rental. */ - rentalState: FormControl, - - /** Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC date-time format). */ - updated: FormControl, - } - export function CreateVolumeUserInfoFormGroup() { - return new FormGroup({ - acquiredTime: new FormControl(undefined), - acquisitionType: new FormControl(undefined), - entitlementType: new FormControl(undefined), - isFamilySharedFromUser: new FormControl(undefined), - isFamilySharedToUser: new FormControl(undefined), - isFamilySharingAllowed: new FormControl(undefined), - isFamilySharingDisabledByFop: new FormControl(undefined), - isInMyBooks: new FormControl(undefined), - isPreordered: new FormControl(undefined), - isPurchased: new FormControl(undefined), - isUploaded: new FormControl(undefined), - rentalState: new FormControl(undefined), - updated: new FormControl(undefined), - }); - - } - - export interface VolumeUserInfoCopy { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - allowedCharacterCount?: number | null; - limitType?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - remainingCharacterCount?: number | null; - updated?: Date | null; - } - export interface VolumeUserInfoCopyFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - allowedCharacterCount: FormControl, - limitType: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - remainingCharacterCount: FormControl, - updated: FormControl, - } - export function CreateVolumeUserInfoCopyFormGroup() { - return new FormGroup({ - allowedCharacterCount: new FormControl(undefined), - limitType: new FormControl(undefined), - remainingCharacterCount: new FormControl(undefined), - updated: new FormControl(undefined), - }); - - } - - export interface VolumeUserInfoFamilySharing { - - /** The role of the user in the family. */ - familyRole?: string | null; - - /** Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value is true, the user can initiate a family sharing action. */ - isSharingAllowed?: boolean | null; - - /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ - isSharingDisabledByFop?: boolean | null; - } - export interface VolumeUserInfoFamilySharingFormProperties { - - /** The role of the user in the family. */ - familyRole: FormControl, - - /** Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value is true, the user can initiate a family sharing action. */ - isSharingAllowed: FormControl, - - /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ - isSharingDisabledByFop: FormControl, - } - export function CreateVolumeUserInfoFamilySharingFormGroup() { - return new FormGroup({ - familyRole: new FormControl(undefined), - isSharingAllowed: new FormControl(undefined), - isSharingDisabledByFop: new FormControl(undefined), - }); - - } - - export interface ReadingPosition { - - /** Position in an EPUB as a CFI. */ - epubCfiPosition?: string | null; - - /** Position in a volume for image-based content. */ - gbImagePosition?: string | null; - - /** Position in a volume for text-based content. */ - gbTextPosition?: string | null; - - /** Resource type for a reading position. */ - kind?: string | null; - - /** Position in a PDF file. */ - pdfPosition?: string | null; - - /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ - updated?: Date | null; - - /** Volume id associated with this reading position. */ - volumeId?: string | null; - } - export interface ReadingPositionFormProperties { - - /** Position in an EPUB as a CFI. */ - epubCfiPosition: FormControl, - - /** Position in a volume for image-based content. */ - gbImagePosition: FormControl, - - /** Position in a volume for text-based content. */ - gbTextPosition: FormControl, - - /** Resource type for a reading position. */ - kind: FormControl, - - /** Position in a PDF file. */ - pdfPosition: FormControl, - - /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ - updated: FormControl, - - /** Volume id associated with this reading position. */ - volumeId: FormControl, - } - export function CreateReadingPositionFormGroup() { - return new FormGroup({ - epubCfiPosition: new FormControl(undefined), - gbImagePosition: new FormControl(undefined), - gbTextPosition: new FormControl(undefined), - kind: new FormControl(undefined), - pdfPosition: new FormControl(undefined), - updated: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface VolumeUserInfoRentalPeriod { - endUtcSec?: string | null; - startUtcSec?: string | null; - } - export interface VolumeUserInfoRentalPeriodFormProperties { - endUtcSec: FormControl, - startUtcSec: FormControl, - } - export function CreateVolumeUserInfoRentalPeriodFormGroup() { - return new FormGroup({ - endUtcSec: new FormControl(undefined), - startUtcSec: new FormControl(undefined), - }); - - } - - export interface Review { - - /** Author of this review. */ - author?: ReviewAuthor; - - /** Review text. */ - content?: string | null; - - /** Date of this review. */ - date?: string | null; - - /** URL for the full review text, for reviews gathered from the web. */ - fullTextUrl?: string | null; - - /** Resource type for a review. */ - kind?: string | null; - - /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ - rating?: string | null; - - /** Information regarding the source of this review, when the review is not from a Google Books user. */ - source?: ReviewSource; - - /** Title for this review. */ - title?: string | null; - - /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ - type?: string | null; - - /** Volume that this review is for. */ - volumeId?: string | null; - } - export interface ReviewFormProperties { - - /** Review text. */ - content: FormControl, - - /** Date of this review. */ - date: FormControl, - - /** URL for the full review text, for reviews gathered from the web. */ - fullTextUrl: FormControl, - - /** Resource type for a review. */ - kind: FormControl, - - /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ - rating: FormControl, - - /** Title for this review. */ - title: FormControl, - - /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ - type: FormControl, - - /** Volume that this review is for. */ - volumeId: FormControl, - } - export function CreateReviewFormGroup() { - return new FormGroup({ - content: new FormControl(undefined), - date: new FormControl(undefined), - fullTextUrl: new FormControl(undefined), - kind: new FormControl(undefined), - rating: new FormControl(undefined), - title: new FormControl(undefined), - type: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface ReviewAuthor { - - /** Name of this person. */ - displayName?: string | null; - } - export interface ReviewAuthorFormProperties { - - /** Name of this person. */ - displayName: FormControl, - } - export function CreateReviewAuthorFormGroup() { - return new FormGroup({ - displayName: new FormControl(undefined), - }); - - } - - export interface ReviewSource { - - /** Name of the source. */ - description?: string | null; - - /** Extra text about the source of the review. */ - extraDescription?: string | null; - - /** URL of the source of the review. */ - url?: string | null; - } - export interface ReviewSourceFormProperties { - - /** Name of the source. */ - description: FormControl, - - /** Extra text about the source of the review. */ - extraDescription: FormControl, - - /** URL of the source of the review. */ - url: FormControl, - } - export function CreateReviewSourceFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - extraDescription: new FormControl(undefined), - url: new FormControl(undefined), - }); - - } - - export interface VolumeUserInfoUserUploadedVolumeInfo { - processingState?: string | null; - } - export interface VolumeUserInfoUserUploadedVolumeInfoFormProperties { - processingState: FormControl, - } - export function CreateVolumeUserInfoUserUploadedVolumeInfoFormGroup() { - return new FormGroup({ - processingState: new FormControl(undefined), - }); - - } - - export interface VolumeVolumeInfo { - - /** Whether anonymous logging should be allowed. */ - allowAnonLogging?: boolean | null; - - /** The names of the authors and/or editors for this volume. (In LITE projection) */ - authors?: Array; - - /** - * The mean review rating for this volume. (min = 1.0, max = 5.0) - * Type: double - */ - averageRating?: number | null; - - /** Canonical URL for a volume. (In LITE projection.) */ - canonicalVolumeLink?: string | null; - - /** A list of subject categories, such as "Fiction", "Suspense", etc. */ - categories?: Array; - - /** Whether the volume has comics content. */ - comicsContent?: boolean | null; - - /** An identifier for the version of the volume content (text & images). (In LITE projection) */ - contentVersion?: string | null; - - /** A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE projection.) */ - description?: string | null; - - /** Physical dimensions of this volume. */ - dimensions?: VolumeVolumeInfoDimensions; - - /** A list of image links for all the sizes that are available. (In LITE projection.) */ - imageLinks?: VolumeVolumeInfoImageLinks; - - /** Industry standard identifiers for this volume. */ - VolumeVolumeInfoIndustryIdentifiers?: Array; - - /** URL to view information about this volume on the Google Books site. (In LITE projection) */ - infoLink?: string | null; - - /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ - language?: string | null; - - /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ - mainCategory?: string | null; - maturityRating?: string | null; - - /** - * Total number of pages as per publisher metadata. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageCount?: number | null; - - /** A top-level summary of the panelization info in this volume. */ - panelizationSummary?: VolumeVolumeInfoPanelizationSummary; - - /** URL to preview this volume on the Google Books site. */ - previewLink?: string | null; - - /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ - printType?: string | null; - - /** - * Total number of printed pages in generated pdf representation. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - printedPageCount?: number | null; - - /** Date of publication. (In LITE projection.) */ - publishedDate?: string | null; - - /** Publisher of this volume. (In LITE projection.) */ - publisher?: string | null; - - /** - * The number of review ratings for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ratingsCount?: number | null; - - /** The reading modes available for this volume. */ - readingModes?: any; - - /** - * Total number of sample pages as per publisher metadata. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - samplePageCount?: number | null; - seriesInfo?: Volumeseriesinfo; - - /** Volume subtitle. (In LITE projection.) */ - subtitle?: string | null; - - /** Volume title. (In LITE projection.) */ - title?: string | null; - } - export interface VolumeVolumeInfoFormProperties { - - /** Whether anonymous logging should be allowed. */ - allowAnonLogging: FormControl, - - /** - * The mean review rating for this volume. (min = 1.0, max = 5.0) - * Type: double - */ - averageRating: FormControl, - - /** Canonical URL for a volume. (In LITE projection.) */ - canonicalVolumeLink: FormControl, - - /** Whether the volume has comics content. */ - comicsContent: FormControl, - - /** An identifier for the version of the volume content (text & images). (In LITE projection) */ - contentVersion: FormControl, - - /** A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE projection.) */ - description: FormControl, - - /** URL to view information about this volume on the Google Books site. (In LITE projection) */ - infoLink: FormControl, - - /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ - language: FormControl, - - /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ - mainCategory: FormControl, - maturityRating: FormControl, - - /** - * Total number of pages as per publisher metadata. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageCount: FormControl, - - /** URL to preview this volume on the Google Books site. */ - previewLink: FormControl, - - /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ - printType: FormControl, - - /** - * Total number of printed pages in generated pdf representation. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - printedPageCount: FormControl, - - /** Date of publication. (In LITE projection.) */ - publishedDate: FormControl, - - /** Publisher of this volume. (In LITE projection.) */ - publisher: FormControl, - - /** - * The number of review ratings for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ratingsCount: FormControl, - - /** The reading modes available for this volume. */ - readingModes: FormControl, - - /** - * Total number of sample pages as per publisher metadata. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - samplePageCount: FormControl, - - /** Volume subtitle. (In LITE projection.) */ - subtitle: FormControl, - - /** Volume title. (In LITE projection.) */ - title: FormControl, - } - export function CreateVolumeVolumeInfoFormGroup() { - return new FormGroup({ - allowAnonLogging: new FormControl(undefined), - averageRating: new FormControl(undefined), - canonicalVolumeLink: new FormControl(undefined), - comicsContent: new FormControl(undefined), - contentVersion: new FormControl(undefined), - description: new FormControl(undefined), - infoLink: new FormControl(undefined), - language: new FormControl(undefined), - mainCategory: new FormControl(undefined), - maturityRating: new FormControl(undefined), - pageCount: new FormControl(undefined), - previewLink: new FormControl(undefined), - printType: new FormControl(undefined), - printedPageCount: new FormControl(undefined), - publishedDate: new FormControl(undefined), - publisher: new FormControl(undefined), - ratingsCount: new FormControl(undefined), - readingModes: new FormControl(undefined), - samplePageCount: new FormControl(undefined), - subtitle: new FormControl(undefined), - title: new FormControl(undefined), - }); - - } - - export interface VolumeVolumeInfoDimensions { - - /** Height or length of this volume (in cm). */ - height?: string | null; - - /** Thickness of this volume (in cm). */ - thickness?: string | null; - - /** Width of this volume (in cm). */ - width?: string | null; - } - export interface VolumeVolumeInfoDimensionsFormProperties { - - /** Height or length of this volume (in cm). */ - height: FormControl, - - /** Thickness of this volume (in cm). */ - thickness: FormControl, - - /** Width of this volume (in cm). */ - width: FormControl, - } - export function CreateVolumeVolumeInfoDimensionsFormGroup() { - return new FormGroup({ - height: new FormControl(undefined), - thickness: new FormControl(undefined), - width: new FormControl(undefined), - }); - - } - - export interface VolumeVolumeInfoImageLinks { - - /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ - extraLarge?: string | null; - - /** Image link for large size (width of ~800 pixels). (In LITE projection) */ - large?: string | null; - - /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ - medium?: string | null; - - /** Image link for small size (width of ~300 pixels). (In LITE projection) */ - small?: string | null; - - /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ - smallThumbnail?: string | null; - - /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ - thumbnail?: string | null; - } - export interface VolumeVolumeInfoImageLinksFormProperties { - - /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ - extraLarge: FormControl, - - /** Image link for large size (width of ~800 pixels). (In LITE projection) */ - large: FormControl, - - /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ - medium: FormControl, - - /** Image link for small size (width of ~300 pixels). (In LITE projection) */ - small: FormControl, - - /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ - smallThumbnail: FormControl, - - /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ - thumbnail: FormControl, - } - export function CreateVolumeVolumeInfoImageLinksFormGroup() { - return new FormGroup({ - extraLarge: new FormControl(undefined), - large: new FormControl(undefined), - medium: new FormControl(undefined), - small: new FormControl(undefined), - smallThumbnail: new FormControl(undefined), - thumbnail: new FormControl(undefined), - }); - - } - - export interface VolumeVolumeInfoIndustryIdentifiers { - - /** Industry specific volume identifier. */ - identifier?: string | null; - - /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ - type?: string | null; - } - export interface VolumeVolumeInfoIndustryIdentifiersFormProperties { - - /** Industry specific volume identifier. */ - identifier: FormControl, - - /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ - type: FormControl, - } - export function CreateVolumeVolumeInfoIndustryIdentifiersFormGroup() { - return new FormGroup({ - identifier: new FormControl(undefined), - type: new FormControl(undefined), - }); - - } - - export interface VolumeVolumeInfoPanelizationSummary { - containsEpubBubbles?: boolean | null; - containsImageBubbles?: boolean | null; - epubBubbleVersion?: string | null; - imageBubbleVersion?: string | null; - } - export interface VolumeVolumeInfoPanelizationSummaryFormProperties { - containsEpubBubbles: FormControl, - containsImageBubbles: FormControl, - epubBubbleVersion: FormControl, - imageBubbleVersion: FormControl, - } - export function CreateVolumeVolumeInfoPanelizationSummaryFormGroup() { - return new FormGroup({ - containsEpubBubbles: new FormControl(undefined), - containsImageBubbles: new FormControl(undefined), - epubBubbleVersion: new FormControl(undefined), - imageBubbleVersion: new FormControl(undefined), - }); - - } - - export interface Volumeseriesinfo { - - /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ - bookDisplayNumber?: string | null; - - /** Resource type. */ - kind?: string | null; - - /** Short book title in the context of the series. */ - shortSeriesBookTitle?: string | null; - VolumeseriesinfoVolumeSeries?: Array; - } - export interface VolumeseriesinfoFormProperties { - - /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ - bookDisplayNumber: FormControl, - - /** Resource type. */ - kind: FormControl, - - /** Short book title in the context of the series. */ - shortSeriesBookTitle: FormControl, - } - export function CreateVolumeseriesinfoFormGroup() { - return new FormGroup({ - bookDisplayNumber: new FormControl(undefined), - kind: new FormControl(undefined), - shortSeriesBookTitle: new FormControl(undefined), - }); - - } - - export interface VolumeseriesinfoVolumeSeries { - - /** List of issues. Applicable only for Collection Edition and Omnibus. */ - VolumeseriesinfoVolumeSeriesIssue?: Array; - - /** - * The book order number in the series. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - orderNumber?: number | null; - - /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ - seriesBookType?: string | null; - - /** The series id. */ - seriesId?: string | null; - } - export interface VolumeseriesinfoVolumeSeriesFormProperties { - - /** - * The book order number in the series. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - orderNumber: FormControl, - - /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ - seriesBookType: FormControl, - - /** The series id. */ - seriesId: FormControl, - } - export function CreateVolumeseriesinfoVolumeSeriesFormGroup() { - return new FormGroup({ - orderNumber: new FormControl(undefined), - seriesBookType: new FormControl(undefined), - seriesId: new FormControl(undefined), - }); - - } - - export interface VolumeseriesinfoVolumeSeriesIssue { - issueDisplayNumber?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - issueOrderNumber?: number | null; - } - export interface VolumeseriesinfoVolumeSeriesIssueFormProperties { - issueDisplayNumber: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - issueOrderNumber: FormControl, - } - export function CreateVolumeseriesinfoVolumeSeriesIssueFormGroup() { - return new FormGroup({ - issueDisplayNumber: new FormControl(undefined), - issueOrderNumber: new FormControl(undefined), - }); - - } - - export interface DownloadAccesses { - - /** A list of download access responses. */ - downloadAccessList?: Array; - - /** Resource type. */ - kind?: string | null; - } - export interface DownloadAccessesFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateDownloadAccessesFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface FamilyInfo { - - /** Resource type. */ - kind?: string | null; - - /** Family membership info of the user that made the request. */ - membership?: FamilyInfoMembership; - } - export interface FamilyInfoFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateFamilyInfoFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface FamilyInfoMembership { - - /** Restrictions on user buying and acquiring content. */ - acquirePermission?: string | null; - - /** The age group of the user. */ - ageGroup?: string | null; - - /** The maximum allowed maturity rating for the user. */ - allowedMaturityRating?: string | null; - isInFamily?: boolean | null; - - /** The role of the user in the family. */ - role?: string | null; - } - export interface FamilyInfoMembershipFormProperties { - - /** Restrictions on user buying and acquiring content. */ - acquirePermission: FormControl, - - /** The age group of the user. */ - ageGroup: FormControl, - - /** The maximum allowed maturity rating for the user. */ - allowedMaturityRating: FormControl, - isInFamily: FormControl, - - /** The role of the user in the family. */ - role: FormControl, - } - export function CreateFamilyInfoMembershipFormGroup() { - return new FormGroup({ - acquirePermission: new FormControl(undefined), - ageGroup: new FormControl(undefined), - allowedMaturityRating: new FormControl(undefined), - isInFamily: new FormControl(undefined), - role: new FormControl(undefined), - }); - - } - - export interface Geolayerdata { - common?: GeolayerdataCommon; - geo?: GeolayerdataGeo; - kind?: string | null; - } - export interface GeolayerdataFormProperties { - kind: FormControl, - } - export function CreateGeolayerdataFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface GeolayerdataCommon { - - /** The language of the information url and description. */ - lang?: string | null; - - /** The URL for the preview image information. */ - previewImageUrl?: string | null; - - /** The description for this location. */ - snippet?: string | null; - - /** The URL for information for this location. Ex: wikipedia link. */ - snippetUrl?: string | null; - - /** The display title and localized canonical name to use when searching for this entity on Google search. */ - title?: string | null; - } - export interface GeolayerdataCommonFormProperties { - - /** The language of the information url and description. */ - lang: FormControl, - - /** The URL for the preview image information. */ - previewImageUrl: FormControl, - - /** The description for this location. */ - snippet: FormControl, - - /** The URL for information for this location. Ex: wikipedia link. */ - snippetUrl: FormControl, - - /** The display title and localized canonical name to use when searching for this entity on Google search. */ - title: FormControl, - } - export function CreateGeolayerdataCommonFormGroup() { - return new FormGroup({ - lang: new FormControl(undefined), - previewImageUrl: new FormControl(undefined), - snippet: new FormControl(undefined), - snippetUrl: new FormControl(undefined), - title: new FormControl(undefined), - }); - - } - - export interface GeolayerdataGeo { - - /** The boundary of the location as a set of loops containing pairs of latitude, longitude coordinates. */ - boundary?: Array; - - /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ - cachePolicy?: string | null; - - /** The country code of the location. */ - countryCode?: string | null; - - /** - * The latitude of the location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude of the location. - * Type: double - */ - longitude?: number | null; - - /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ - mapType?: string | null; - - /** The viewport for showing this location. This is a latitude, longitude rectangle. */ - viewport?: GeolayerdataGeoViewport; - - /** - * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - zoom?: number | null; - } - export interface GeolayerdataGeoFormProperties { - - /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ - cachePolicy: FormControl, - - /** The country code of the location. */ - countryCode: FormControl, - - /** - * The latitude of the location. - * Type: double - */ - latitude: FormControl, - - /** - * The longitude of the location. - * Type: double - */ - longitude: FormControl, - - /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ - mapType: FormControl, - - /** - * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - zoom: FormControl, - } - export function CreateGeolayerdataGeoFormGroup() { - return new FormGroup({ - cachePolicy: new FormControl(undefined), - countryCode: new FormControl(undefined), - latitude: new FormControl(undefined), - longitude: new FormControl(undefined), - mapType: new FormControl(undefined), - zoom: new FormControl(undefined), - }); - - } - - export interface GeolayerdataGeoViewport { - hi?: GeolayerdataGeoViewportHi; - lo?: GeolayerdataGeoViewportLo; - } - export interface GeolayerdataGeoViewportFormProperties { - } - export function CreateGeolayerdataGeoViewportFormGroup() { - return new FormGroup({ - }); - - } - - export interface GeolayerdataGeoViewportHi { - - /** Type: double */ - latitude?: number | null; - - /** Type: double */ - longitude?: number | null; - } - export interface GeolayerdataGeoViewportHiFormProperties { - - /** Type: double */ - latitude: FormControl, - - /** Type: double */ - longitude: FormControl, - } - export function CreateGeolayerdataGeoViewportHiFormGroup() { - return new FormGroup({ - latitude: new FormControl(undefined), - longitude: new FormControl(undefined), - }); - - } - - export interface GeolayerdataGeoViewportLo { - - /** Type: double */ - latitude?: number | null; - - /** Type: double */ - longitude?: number | null; - } - export interface GeolayerdataGeoViewportLoFormProperties { - - /** Type: double */ - latitude: FormControl, - - /** Type: double */ - longitude: FormControl, - } - export function CreateGeolayerdataGeoViewportLoFormGroup() { - return new FormGroup({ - latitude: new FormControl(undefined), - longitude: new FormControl(undefined), - }); - - } - - export interface Layersummaries { - - /** A list of layer summary items. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - - /** - * The total number of layer summaries found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - export interface LayersummariesFormProperties { - - /** Resource type. */ - kind: FormControl, - - /** - * The total number of layer summaries found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems: FormControl, - } - export function CreateLayersummariesFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - totalItems: new FormControl(undefined), - }); - - } - - export interface Layersummary { - - /** - * The number of annotations for this layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - annotationCount?: number | null; - - /** The list of annotation types contained for this layer. */ - annotationTypes?: Array; - - /** Link to get data for this annotation. */ - annotationsDataLink?: string | null; - - /** The link to get the annotations for this layer. */ - annotationsLink?: string | null; - - /** The content version this resource is for. */ - contentVersion?: string | null; - - /** - * The number of data items for this layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - dataCount?: number | null; - - /** Unique id of this layer summary. */ - id?: string | null; - - /** Resource Type */ - kind?: string | null; - - /** The layer id for this summary. */ - layerId?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - - /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ - volumeAnnotationsVersion?: string | null; - - /** The volume id this resource is for. */ - volumeId?: string | null; - } - export interface LayersummaryFormProperties { - - /** - * The number of annotations for this layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - annotationCount: FormControl, - - /** Link to get data for this annotation. */ - annotationsDataLink: FormControl, - - /** The link to get the annotations for this layer. */ - annotationsLink: FormControl, - - /** The content version this resource is for. */ - contentVersion: FormControl, - - /** - * The number of data items for this layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - dataCount: FormControl, - - /** Unique id of this layer summary. */ - id: FormControl, - - /** Resource Type */ - kind: FormControl, - - /** The layer id for this summary. */ - layerId: FormControl, - - /** URL to this resource. */ - selfLink: FormControl, - - /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ - updated: FormControl, - - /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ - volumeAnnotationsVersion: FormControl, - - /** The volume id this resource is for. */ - volumeId: FormControl, - } - export function CreateLayersummaryFormGroup() { - return new FormGroup({ - annotationCount: new FormControl(undefined), - annotationsDataLink: new FormControl(undefined), - annotationsLink: new FormControl(undefined), - contentVersion: new FormControl(undefined), - dataCount: new FormControl(undefined), - id: new FormControl(undefined), - kind: new FormControl(undefined), - layerId: new FormControl(undefined), - selfLink: new FormControl(undefined), - updated: new FormControl(undefined), - volumeAnnotationsVersion: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface Metadata { - - /** A list of offline dictionary metadata. */ - MetadataItems?: Array; - - /** Resource type. */ - kind?: string | null; - } - export interface MetadataFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateMetadataFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface MetadataItems { - download_url?: string | null; - encrypted_key?: string | null; - language?: string | null; - size?: string | null; - version?: string | null; - } - export interface MetadataItemsFormProperties { - download_url: FormControl, - encrypted_key: FormControl, - language: FormControl, - size: FormControl, - version: FormControl, - } - export function CreateMetadataItemsFormGroup() { - return new FormGroup({ - download_url: new FormControl(undefined), - encrypted_key: new FormControl(undefined), - language: new FormControl(undefined), - size: new FormControl(undefined), - version: new FormControl(undefined), - }); - - } - - export interface Notification { - body?: string | null; - - /** The list of crm experiment ids. */ - crmExperimentIds?: Array; - doc_id?: string | null; - doc_type?: string | null; - dont_show_notification?: boolean | null; - iconUrl?: string | null; - is_document_mature?: boolean | null; - - /** Resource type. */ - kind?: string | null; - notificationGroup?: string | null; - notification_type?: string | null; - pcampaign_id?: string | null; - reason?: string | null; - show_notification_settings_action?: boolean | null; - targetUrl?: string | null; - timeToExpireMs?: string | null; - title?: string | null; - } - export interface NotificationFormProperties { - body: FormControl, - doc_id: FormControl, - doc_type: FormControl, - dont_show_notification: FormControl, - iconUrl: FormControl, - is_document_mature: FormControl, - - /** Resource type. */ - kind: FormControl, - notificationGroup: FormControl, - notification_type: FormControl, - pcampaign_id: FormControl, - reason: FormControl, - show_notification_settings_action: FormControl, - targetUrl: FormControl, - timeToExpireMs: FormControl, - title: FormControl, - } - export function CreateNotificationFormGroup() { - return new FormGroup({ - body: new FormControl(undefined), - doc_id: new FormControl(undefined), - doc_type: new FormControl(undefined), - dont_show_notification: new FormControl(undefined), - iconUrl: new FormControl(undefined), - is_document_mature: new FormControl(undefined), - kind: new FormControl(undefined), - notificationGroup: new FormControl(undefined), - notification_type: new FormControl(undefined), - pcampaign_id: new FormControl(undefined), - reason: new FormControl(undefined), - show_notification_settings_action: new FormControl(undefined), - targetUrl: new FormControl(undefined), - timeToExpireMs: new FormControl(undefined), - title: new FormControl(undefined), - }); - - } - - export interface Offers { - - /** A list of offers. */ - OffersItems?: Array; - - /** Resource type. */ - kind?: string | null; - } - export interface OffersFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateOffersFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface OffersItems { - artUrl?: string | null; - gservicesKey?: string | null; - id?: string | null; - OffersItemsItems?: Array; - } - export interface OffersItemsFormProperties { - artUrl: FormControl, - gservicesKey: FormControl, - id: FormControl, - } - export function CreateOffersItemsFormGroup() { - return new FormGroup({ - artUrl: new FormControl(undefined), - gservicesKey: new FormControl(undefined), - id: new FormControl(undefined), - }); - - } - - export interface OffersItemsItems { - author?: string | null; - canonicalVolumeLink?: string | null; - coverUrl?: string | null; - description?: string | null; - title?: string | null; - volumeId?: string | null; - } - export interface OffersItemsItemsFormProperties { - author: FormControl, - canonicalVolumeLink: FormControl, - coverUrl: FormControl, - description: FormControl, - title: FormControl, - volumeId: FormControl, - } - export function CreateOffersItemsItemsFormGroup() { - return new FormGroup({ - author: new FormControl(undefined), - canonicalVolumeLink: new FormControl(undefined), - coverUrl: new FormControl(undefined), - description: new FormControl(undefined), - title: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface RequestAccess { - concurrentAccess?: ConcurrentAccessRestriction; - downloadAccess?: DownloadAccessRestriction; - - /** Resource type. */ - kind?: string | null; - } - export interface RequestAccessFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateRequestAccessFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface Series { - - /** Resource type. */ - kind?: string | null; - SeriesSeries?: Array; - } - export interface SeriesFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateSeriesFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface SeriesSeries { - bannerImageUrl?: string | null; - eligibleForSubscription?: boolean | null; - imageUrl?: string | null; - isComplete?: boolean | null; - seriesFormatType?: string | null; - seriesId?: string | null; - seriesSubscriptionReleaseInfo?: SeriesSeriesSeriesSubscriptionReleaseInfo; - seriesType?: string | null; - subscriptionId?: string | null; - title?: string | null; - } - export interface SeriesSeriesFormProperties { - bannerImageUrl: FormControl, - eligibleForSubscription: FormControl, - imageUrl: FormControl, - isComplete: FormControl, - seriesFormatType: FormControl, - seriesId: FormControl, - seriesType: FormControl, - subscriptionId: FormControl, - title: FormControl, - } - export function CreateSeriesSeriesFormGroup() { - return new FormGroup({ - bannerImageUrl: new FormControl(undefined), - eligibleForSubscription: new FormControl(undefined), - imageUrl: new FormControl(undefined), - isComplete: new FormControl(undefined), - seriesFormatType: new FormControl(undefined), - seriesId: new FormControl(undefined), - seriesType: new FormControl(undefined), - subscriptionId: new FormControl(undefined), - title: new FormControl(undefined), - }); - - } - - export interface SeriesSeriesSeriesSubscriptionReleaseInfo { - - /** Cancellation date of the series subscription (or when it ends). */ - cancellationTimestampUs?: string | null; - currentReleaseInfo?: BooksSubscriptionReleaseInfo; - nextReleaseInfo?: BooksSubscriptionReleaseInfo; - - /** series subscription type. */ - seriesSubscriptionType?: string | null; - } - export interface SeriesSeriesSeriesSubscriptionReleaseInfoFormProperties { - - /** Cancellation date of the series subscription (or when it ends). */ - cancellationTimestampUs: FormControl, - - /** series subscription type. */ - seriesSubscriptionType: FormControl, - } - export function CreateSeriesSeriesSeriesSubscriptionReleaseInfoFormGroup() { - return new FormGroup({ - cancellationTimestampUs: new FormControl(undefined), - seriesSubscriptionType: new FormControl(undefined), - }); - - } - - export interface Seriesmembership { - - /** Resorce type. */ - kind?: string | null; - member?: Array; - nextPageToken?: string | null; - } - export interface SeriesmembershipFormProperties { - - /** Resorce type. */ - kind: FormControl, - nextPageToken: FormControl, - } - export function CreateSeriesmembershipFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - nextPageToken: new FormControl(undefined), - }); - - } - - export interface Usersettings { - - /** Resource type. */ - kind?: string | null; - - /** User settings in sub-objects, each for different purposes. */ - notesExport?: UsersettingsNotesExport; - notification?: UsersettingsNotification; - } - export interface UsersettingsFormProperties { - - /** Resource type. */ - kind: FormControl, - } - export function CreateUsersettingsFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - }); - - } - - export interface UsersettingsNotesExport { - folderName?: string | null; - isEnabled?: boolean | null; - } - export interface UsersettingsNotesExportFormProperties { - folderName: FormControl, - isEnabled: FormControl, - } - export function CreateUsersettingsNotesExportFormGroup() { - return new FormGroup({ - folderName: new FormControl(undefined), - isEnabled: new FormControl(undefined), - }); - - } - - export interface UsersettingsNotification { - matchMyInterests?: UsersettingsNotificationMatchMyInterests; - moreFromAuthors?: UsersettingsNotificationMoreFromAuthors; - moreFromSeries?: UsersettingsNotificationMoreFromSeries; - priceDrop?: UsersettingsNotificationPriceDrop; - rewardExpirations?: UsersettingsNotificationRewardExpirations; - } - export interface UsersettingsNotificationFormProperties { - } - export function CreateUsersettingsNotificationFormGroup() { - return new FormGroup({ - }); - - } - - export interface UsersettingsNotificationMatchMyInterests { - opted_state?: string | null; - } - export interface UsersettingsNotificationMatchMyInterestsFormProperties { - opted_state: FormControl, - } - export function CreateUsersettingsNotificationMatchMyInterestsFormGroup() { - return new FormGroup({ - opted_state: new FormControl(undefined), - }); - - } - - export interface UsersettingsNotificationMoreFromAuthors { - opted_state?: string | null; - } - export interface UsersettingsNotificationMoreFromAuthorsFormProperties { - opted_state: FormControl, - } - export function CreateUsersettingsNotificationMoreFromAuthorsFormGroup() { - return new FormGroup({ - opted_state: new FormControl(undefined), - }); - - } - - export interface UsersettingsNotificationMoreFromSeries { - opted_state?: string | null; - } - export interface UsersettingsNotificationMoreFromSeriesFormProperties { - opted_state: FormControl, - } - export function CreateUsersettingsNotificationMoreFromSeriesFormGroup() { - return new FormGroup({ - opted_state: new FormControl(undefined), - }); - - } - - export interface UsersettingsNotificationPriceDrop { - opted_state?: string | null; - } - export interface UsersettingsNotificationPriceDropFormProperties { - opted_state: FormControl, - } - export function CreateUsersettingsNotificationPriceDropFormGroup() { - return new FormGroup({ - opted_state: new FormControl(undefined), - }); - - } - - export interface UsersettingsNotificationRewardExpirations { - opted_state?: string | null; - } - export interface UsersettingsNotificationRewardExpirationsFormProperties { - opted_state: FormControl, - } - export function CreateUsersettingsNotificationRewardExpirationsFormGroup() { - return new FormGroup({ - opted_state: new FormControl(undefined), - }); - - } - - export interface Volume2 { - - /** A list of volumes. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - nextPageToken?: string | null; - } - export interface Volume2FormProperties { - - /** Resource type. */ - kind: FormControl, - nextPageToken: FormControl, - } - export function CreateVolume2FormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - nextPageToken: new FormControl(undefined), - }); - - } - - export interface Volumeannotation { - - /** The annotation data id for this volume annotation. */ - annotationDataId?: string | null; - - /** Link to get data for this annotation. */ - annotationDataLink?: string | null; - - /** The type of annotation this is. */ - annotationType?: string | null; - - /** The content ranges to identify the selected text. */ - contentRanges?: VolumeannotationContentRanges; - - /** Data for this annotation. */ - data?: string | null; - - /** Indicates that this annotation is deleted. */ - deleted?: boolean | null; - - /** Unique id of this volume annotation. */ - id?: string | null; - - /** Resource Type */ - kind?: string | null; - - /** The Layer this annotation is for. */ - layerId?: string | null; - - /** Pages the annotation spans. */ - pageIds?: Array; - - /** Excerpt from the volume. */ - selectedText?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - - /** The Volume this annotation is for. */ - volumeId?: string | null; - } - export interface VolumeannotationFormProperties { - - /** The annotation data id for this volume annotation. */ - annotationDataId: FormControl, - - /** Link to get data for this annotation. */ - annotationDataLink: FormControl, - - /** The type of annotation this is. */ - annotationType: FormControl, - - /** Data for this annotation. */ - data: FormControl, - - /** Indicates that this annotation is deleted. */ - deleted: FormControl, - - /** Unique id of this volume annotation. */ - id: FormControl, - - /** Resource Type */ - kind: FormControl, - - /** The Layer this annotation is for. */ - layerId: FormControl, - - /** Excerpt from the volume. */ - selectedText: FormControl, - - /** URL to this resource. */ - selfLink: FormControl, - - /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ - updated: FormControl, - - /** The Volume this annotation is for. */ - volumeId: FormControl, - } - export function CreateVolumeannotationFormGroup() { - return new FormGroup({ - annotationDataId: new FormControl(undefined), - annotationDataLink: new FormControl(undefined), - annotationType: new FormControl(undefined), - data: new FormControl(undefined), - deleted: new FormControl(undefined), - id: new FormControl(undefined), - kind: new FormControl(undefined), - layerId: new FormControl(undefined), - selectedText: new FormControl(undefined), - selfLink: new FormControl(undefined), - updated: new FormControl(undefined), - volumeId: new FormControl(undefined), - }); - - } - - export interface VolumeannotationContentRanges { - cfiRange?: BooksAnnotationsRange; - - /** Content version applicable to ranges below. */ - contentVersion?: string | null; - gbImageRange?: BooksAnnotationsRange; - gbTextRange?: BooksAnnotationsRange; - } - export interface VolumeannotationContentRangesFormProperties { - - /** Content version applicable to ranges below. */ - contentVersion: FormControl, - } - export function CreateVolumeannotationContentRangesFormGroup() { - return new FormGroup({ - contentVersion: new FormControl(undefined), - }); - - } - - export interface Volumeannotations { - - /** A list of volume annotations. */ - items?: Array; - - /** Resource type */ - kind?: string | null; - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken?: string | null; - - /** - * The total number of volume annotations found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - - /** The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the annotation data, just the information in this response (e.g. the location of annotations in the book). */ - version?: string | null; - } - export interface VolumeannotationsFormProperties { - - /** Resource type */ - kind: FormControl, - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken: FormControl, - - /** - * The total number of volume annotations found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems: FormControl, - - /** The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the annotation data, just the information in this response (e.g. the location of annotations in the book). */ - version: FormControl, - } - export function CreateVolumeannotationsFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - nextPageToken: new FormControl(undefined), - totalItems: new FormControl(undefined), - version: new FormControl(undefined), - }); - - } - - export interface Volumes { - - /** A list of volumes. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - - /** - * Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - export interface VolumesFormProperties { - - /** Resource type. */ - kind: FormControl, - - /** - * Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems: FormControl, - } - export function CreateVolumesFormGroup() { - return new FormGroup({ - kind: new FormControl(undefined), - totalItems: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Post cloudloading/addBook - * @param {string} drive_document_id A drive document id. The upload_client_token must not be set. - * @param {string} mime_type The document MIME type. It can be set only if the drive_document_id is set. - * @param {string} name The document name. It can be set only if the drive_document_id is set. - * @return {void} Successful response - */ - Books_cloudloading_addBook(drive_document_id: string | null | undefined, mime_type: string | null | undefined, name: string | null | undefined, upload_client_token: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'cloudloading/addBook?drive_document_id=' + (drive_document_id == null ? '' : encodeURIComponent(drive_document_id)) + '&mime_type=' + (mime_type == null ? '' : encodeURIComponent(mime_type)) + '&name=' + (name == null ? '' : encodeURIComponent(name)) + '&upload_client_token=' + (upload_client_token == null ? '' : encodeURIComponent(upload_client_token)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Remove the book and its contents - * Post cloudloading/deleteBook - * @param {string} volumeId The id of the book to be removed. - * @return {void} Successful response - */ - Books_cloudloading_deleteBook(volumeId: string): Observable> { - return this.http.post(this.baseUri + 'cloudloading/deleteBook?volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Post cloudloading/updateBook - * @return {void} Successful response - */ - Books_cloudloading_updateBook(requestBody: BooksCloudloadingResource): Observable> { - return this.http.post(this.baseUri + 'cloudloading/updateBook', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Returns a list of offline dictionary metadata available - * Get dictionary/listOfflineMetadata - * @param {string} cpksver The device/version ID from which to request the data. - * @return {void} Successful response - */ - Books_dictionary_listOfflineMetadata(cpksver: string): Observable> { - return this.http.get(this.baseUri + 'dictionary/listOfflineMetadata?cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets information regarding the family that the user is part of. - * Get familysharing/getFamilyInfo - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_familysharing_getFamilyInfo(source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'familysharing/getFamilyInfo?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Initiates sharing of the content with the user's family. Empty response indicates success. - * Post familysharing/share - * @param {string} docId The docid to share. - * @param {string} source String to identify the originator of this request. - * @param {string} volumeId The volume to share. - * @return {void} Successful response - */ - Books_familysharing_share(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'familysharing/share?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Initiates revoking content that has already been shared with the user's family. Empty response indicates success. - * Post familysharing/unshare - * @param {string} docId The docid to unshare. - * @param {string} source String to identify the originator of this request. - * @param {string} volumeId The volume to unshare. - * @return {void} Successful response - */ - Books_familysharing_unshare(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'familysharing/unshare?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the current settings for the user. - * Get myconfig/getUserSettings - * @return {void} Successful response - */ - Books_myconfig_getUserSettings(): Observable> { - return this.http.get(this.baseUri + 'myconfig/getUserSettings', { observe: 'response', responseType: 'text' }); - } - - /** - * Release downloaded content access restriction. - * Post myconfig/releaseDownloadAccess - * @param {Array} volumeIds The volume(s) to release restrictions for. - * @param {string} cpksver The device/version ID from which to release the restriction. - * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_myconfig_releaseDownloadAccess(volumeIds: Array, cpksver: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'myconfig/releaseDownloadAccess?' + volumeIds.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&') + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Request concurrent and download access restrictions. - * Post myconfig/requestAccess - * @param {string} source String to identify the originator of this request. - * @param {string} volumeId The volume to request concurrent/download restrictions for. - * @param {string} nonce The client nonce value. - * @param {string} cpksver The device/version ID from which to request the restrictions. - * @param {Books_myconfig_requestAccessLicenseTypes} licenseTypes The type of access license to request. If not specified, the default is BOTH. - * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @return {void} Successful response - */ - Books_myconfig_requestAccess(source: string, volumeId: string, nonce: string, cpksver: string, licenseTypes: Books_myconfig_requestAccessLicenseTypes | null | undefined, locale: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'myconfig/requestAccess?source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&licenseTypes=' + licenseTypes + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Request downloaded content access for specified volumes on the My eBooks shelf. - * Post myconfig/syncVolumeLicenses - * @param {string} source String to identify the originator of this request. - * @param {string} nonce The client nonce value. - * @param {string} cpksver The device/version ID from which to release the restriction. - * @param {Array} features List of features supported by the client, i.e., 'RENTALS' - * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. - * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {Array} volumeIds The volume(s) to request download restrictions for. - * @return {void} Successful response - */ - Books_myconfig_syncVolumeLicenses(source: string, nonce: string, cpksver: string, features: Array | null | undefined, includeNonComicsSeries: boolean | null | undefined, locale: string | null | undefined, showPreorders: boolean | null | undefined, volumeIds: Array | null | undefined): Observable> { - return this.http.post(this.baseUri + 'myconfig/syncVolumeLicenses?source=' + (source == null ? '' : encodeURIComponent(source)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&' + features?.map(z => `features=${encodeURIComponent(z)}`).join('&') + '&includeNonComicsSeries=' + includeNonComicsSeries + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&showPreorders=' + showPreorders + '&' + volumeIds?.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&'), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value. - * Post myconfig/updateUserSettings - * @return {void} Successful response - */ - Books_myconfig_updateUserSettings(requestBody: Usersettings): Observable> { - return this.http.post(this.baseUri + 'myconfig/updateUserSettings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves a list of annotations, possibly filtered. - * Get mylibrary/annotations - * @param {string} contentVersion The content version for the requested volume. - * @param {string} layerId The layer ID to limit annotation by. - * @param {Array} layerIds The layer ID(s) to limit annotation by. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 40 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {string} volumeId The volume to restrict annotations to. - * @return {void} Successful response - */ - Books_mylibrary_annotations_list(contentVersion: string | null | undefined, layerId: string | null | undefined, layerIds: Array | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/annotations?contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&layerId=' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&' + layerIds?.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Inserts a new annotation. - * Post mylibrary/annotations - * @param {string} annotationId The ID for the annotation to insert. - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {boolean} showOnlySummaryInResponse Requests that only the summary of the specified layer be provided in the response. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_annotations_insert(annotationId: string | null | undefined, country: string | null | undefined, showOnlySummaryInResponse: boolean | null | undefined, source: string | null | undefined, requestBody: Annotation): Observable> { - return this.http.post(this.baseUri + 'mylibrary/annotations?annotationId=' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&showOnlySummaryInResponse=' + showOnlySummaryInResponse + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Gets the summary of specified layers. - * Post mylibrary/annotations/summary - * @param {Array} layerIds Array of layer IDs to get the summary for. - * @param {string} volumeId Volume id to get the summary for. - * @return {void} Successful response - */ - Books_mylibrary_annotations_summary(layerIds: Array, volumeId: string): Observable> { - return this.http.post(this.baseUri + 'mylibrary/annotations/summary?' + layerIds.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Deletes an annotation. - * Delete mylibrary/annotations/{annotationId} - * @param {string} annotationId The ID for the annotation to delete. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_annotations_delete(annotationId: string, source: string | null | undefined): Observable> { - return this.http.delete(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Updates an existing annotation. - * Put mylibrary/annotations/{annotationId} - * @param {string} annotationId The ID for the annotation to update. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_annotations_update(annotationId: string, source: string | null | undefined, requestBody: Annotation): Observable> { - return this.http.put(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves a list of bookshelves belonging to the authenticated user. - * Get mylibrary/bookshelves - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_list(source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/bookshelves?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves metadata for a specific bookshelf belonging to the authenticated user. - * Get mylibrary/bookshelves/{shelf} - * @param {string} shelf ID of bookshelf to retrieve. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_get(shelf: string, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Adds a volume to a bookshelf. - * Post mylibrary/bookshelves/{shelf}/addVolume - * @param {string} shelf ID of bookshelf to which to add a volume. - * @param {string} volumeId ID of volume to add. - * @param {Books_mylibrary_bookshelves_addVolumeReason} reason The reason for which the book is added to the library. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_addVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_addVolumeReason | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/addVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Clears all volumes from a bookshelf. - * Post mylibrary/bookshelves/{shelf}/clearVolumes - * @param {string} shelf ID of bookshelf from which to remove a volume. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_clearVolumes(shelf: string, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/clearVolumes&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Moves a volume within a bookshelf. - * Post mylibrary/bookshelves/{shelf}/moveVolume - * @param {string} shelf ID of bookshelf with the volume. - * @param {string} volumeId ID of volume to move. - * @param {number} volumePosition Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_moveVolume(shelf: string, volumeId: string, volumePosition: number, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/moveVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&volumePosition=' + volumePosition + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Removes a volume from a bookshelf. - * Post mylibrary/bookshelves/{shelf}/removeVolume - * @param {string} shelf ID of bookshelf from which to remove a volume. - * @param {string} volumeId ID of volume to remove. - * @param {Books_mylibrary_bookshelves_removeVolumeReason} reason The reason for which the book is removed from the library. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_removeVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_removeVolumeReason | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/removeVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Gets volume information for volumes on a bookshelf. - * Get mylibrary/bookshelves/{shelf}/volumes - * @param {string} shelf The bookshelf ID or name retrieve volumes for. - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 - * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. - * @param {string} q Full-text search query string in this bookshelf. - * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first element to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_volumes_list(shelf: string, country: string | null | undefined, maxResults: number | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, q: string | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&country=' + (country == null ? '' : encodeURIComponent(country)) + '&maxResults=' + maxResults + '&projection=' + projection + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves my reading position information for a volume. - * Get mylibrary/readingpositions/{volumeId} - * @param {string} volumeId ID of volume for which to retrieve a reading position. - * @param {string} contentVersion Volume content version for which this reading position is requested. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_readingpositions_get(volumeId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Sets my reading position information for a volume. - * Post mylibrary/readingpositions/{volumeId}/setPosition - * @param {string} volumeId ID of volume for which to update the reading position. - * @param {string} timestamp RFC 3339 UTC format timestamp associated with this reading position. - * @param {string} position Position string for the new volume reading position. - * @param {Books_mylibrary_readingpositions_setPositionAction} action Action that caused this reading position to be set. - * @param {string} contentVersion Volume content version for which this reading position applies. - * @param {string} deviceCookie Random persistent device cookie optional on set position. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_readingpositions_setPosition(volumeId: string, timestamp: string, position: string, action: Books_mylibrary_readingpositions_setPositionAction | null | undefined, contentVersion: string | null | undefined, deviceCookie: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/setPosition×tamp=' + (timestamp == null ? '' : encodeURIComponent(timestamp)) + '&position=' + (position == null ? '' : encodeURIComponent(position)) + '&action=' + action + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&deviceCookie=' + (deviceCookie == null ? '' : encodeURIComponent(deviceCookie)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Returns notification details for a given notification id. - * Get notification/get - * @param {string} notification_id String to identify the notification. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_notification_get(notification_id: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'notification/get?notification_id=' + (notification_id == null ? '' : encodeURIComponent(notification_id)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * List categories for onboarding experience. - * Get onboarding/listCategories - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. - * @return {void} Successful response - */ - Books_onboarding_listCategories(locale: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'onboarding/listCategories?locale=' + (locale == null ? '' : encodeURIComponent(locale)), { observe: 'response', responseType: 'text' }); - } - - /** - * List available volumes under categories for onboarding experience. - * Get onboarding/listCategoryVolumes - * @param {Array} categoryId List of category ids requested. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. - * @param {number} pageSize Number of maximum results per page to be included in the response. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} pageToken The value of the nextToken from the previous page. - * @return {void} Successful response - */ - Books_onboarding_listCategoryVolumes(categoryId: Array | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, pageSize: number | null | undefined, pageToken: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'onboarding/listCategoryVolumes?' + categoryId?.map(z => `categoryId=${encodeURIComponent(z)}`).join('&') + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&pageSize=' + pageSize + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)), { observe: 'response', responseType: 'text' }); - } - - /** - * Returns a stream of personalized book clusters - * Get personalizedstream/get - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_personalizedstream_get(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'personalizedstream/get?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Post promooffer/accept - * @param {string} androidId device android_id - * @param {string} device device device - * @param {string} manufacturer device manufacturer - * @param {string} model device model - * @param {string} product device product - * @param {string} serial device serial - * @param {string} volumeId Volume id to exercise the offer - * @return {void} Successful response - */ - Books_promooffer_accept(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'promooffer/accept?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Post promooffer/dismiss - * @param {string} androidId device android_id - * @param {string} device device device - * @param {string} manufacturer device manufacturer - * @param {string} model device model - * @param {string} offerId Offer to dimiss - * @param {string} product device product - * @param {string} serial device serial - * @return {void} Successful response - */ - Books_promooffer_dismiss(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'promooffer/dismiss?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Returns a list of promo offers available to the user - * Get promooffer/get - * @param {string} androidId device android_id - * @param {string} device device device - * @param {string} manufacturer device manufacturer - * @param {string} model device model - * @param {string} product device product - * @param {string} serial device serial - * @return {void} Successful response - */ - Books_promooffer_get(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'promooffer/get?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), { observe: 'response', responseType: 'text' }); - } - - /** - * Returns Series metadata for the given series ids. - * Get series/get - * @param {Array} series_id String that identifies the series - * @return {void} Successful response - */ - Books_series_get(series_id: Array): Observable> { - return this.http.get(this.baseUri + 'series/get?' + series_id.map(z => `series_id=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); - } - - /** - * Returns Series membership data given the series id. - * Get series/membership/get - * @param {string} series_id String that identifies the series - * @param {number} page_size Number of maximum results per page to be included in the response. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} page_token The value of the nextToken from the previous page. - * @return {void} Successful response - */ - Books_series_membership_get(series_id: string, page_size: number | null | undefined, page_token: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'series/membership/get?series_id=' + (series_id == null ? '' : encodeURIComponent(series_id)) + '&page_size=' + page_size + '&page_token=' + (page_token == null ? '' : encodeURIComponent(page_token)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves a list of public bookshelves for the specified user. - * Get users/{userId}/bookshelves - * @param {string} userId ID of user for whom to retrieve bookshelves. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_bookshelves_list(userId: string, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves metadata for a specific bookshelf for the specified user. - * Get users/{userId}/bookshelves/{shelf} - * @param {string} userId ID of user for whom to retrieve bookshelves. - * @param {string} shelf ID of bookshelf to retrieve. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_bookshelves_get(userId: string, shelf: string, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves volumes in a specific bookshelf for the specified user. - * Get users/{userId}/bookshelves/{shelf}/volumes - * @param {string} userId ID of user for whom to retrieve bookshelf volumes. - * @param {string} shelf ID of bookshelf to retrieve volumes. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 - * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first element to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_bookshelves_volumes_list(userId: string, shelf: string, maxResults: number | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&maxResults=' + maxResults + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Performs a book search. - * Get volumes - * @param {string} q Full-text search query string. - * @param {Books_volumes_listDownload} download Restrict to volumes by download availability. - * @param {Books_volumes_listFilter} filter Filter search results. - * @param {string} langRestrict Restrict results to books with this language code. - * @param {Books_volumes_listLibraryRestrict} libraryRestrict Restrict search to this user's library. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {number} maxResults Maximum number of results to return. - * Minimum: 0 Maximum: 40 - * @param {Books_volumes_listOrderBy} orderBy Sort search results. - * @param {string} partner Restrict and brand results for partner ID. - * @param {Books_volumes_listPrintType} printType Restrict to books or magazines. - * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. - * @param {boolean} showPreorders Set to true to show books available for preorder. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first result to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_volumes_list(q: string, download: Books_volumes_listDownload | null | undefined, filter: Books_volumes_listFilter | null | undefined, langRestrict: string | null | undefined, libraryRestrict: Books_volumes_listLibraryRestrict | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, maxResults: number | null | undefined, orderBy: Books_volumes_listOrderBy | null | undefined, partner: string | null | undefined, printType: Books_volumes_listPrintType | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes?q=' + (q == null ? '' : encodeURIComponent(q)) + '&download=' + download + '&filter=' + filter + '&langRestrict=' + (langRestrict == null ? '' : encodeURIComponent(langRestrict)) + '&libraryRestrict=' + libraryRestrict + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&maxResults=' + maxResults + '&orderBy=' + orderBy + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&printType=' + printType + '&projection=' + projection + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of books in My Library. - * Get volumes/mybooks - * @param {Array} acquireMethod How the book was acquired - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. - * @param {number} maxResults Maximum number of results to return. - * Minimum: 0 Maximum: 100 - * @param {Array} processingState The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first result to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_volumes_mybooks_list(acquireMethod: Array | null | undefined, country: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/mybooks?' + acquireMethod?.map(z => `acquireMethod=${encodeURIComponent(z)}`).join('&') + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of recommended books for the current user. - * Get volumes/recommended - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_recommended_list(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/recommended?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Rate a recommended book for the current user. - * Post volumes/recommended/rate - * @param {Books_volumes_recommended_rateRating} rating Rating to be given to the volume. - * @param {string} volumeId ID of the source volume. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_recommended_rate(rating: Books_volumes_recommended_rateRating, volumeId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'volumes/recommended/rate?rating=' + rating + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of books uploaded by the current user. - * Get volumes/useruploaded - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {number} maxResults Maximum number of results to return. - * Minimum: 0 Maximum: 40 - * @param {Array} processingState The processing state of the user uploaded volumes to be returned. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first result to return (starts at 0) - * Minimum: 0 - * @param {Array} volumeId The ids of the volumes to be returned. If not specified all that match the processingState are returned. - * @return {void} Successful response - */ - Books_volumes_useruploaded_list(locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined, volumeId: Array | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/useruploaded?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex + '&' + volumeId?.map(z => `volumeId=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets volume information for a single volume. - * Get volumes/{volumeId} - * @param {string} volumeId ID of volume to retrieve. - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. - * @param {string} partner Brand results for partner ID. - * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_get(volumeId: string, country: string | null | undefined, includeNonComicsSeries: boolean | null | undefined, partner: string | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, source: string | null | undefined, user_library_consistent_read: boolean | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&includeNonComicsSeries=' + includeNonComicsSeries + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&projection=' + projection + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&user_library_consistent_read=' + user_library_consistent_read, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of associated books. - * Get volumes/{volumeId}/associated - * @param {string} volumeId ID of the source volume. - * @param {Books_volumes_associated_listAssociation} association Association type. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_associated_list(volumeId: string, association: Books_volumes_associated_listAssociation | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/associated&association=' + association + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the volume annotations for a volume and layer. - * Get volumes/{volumeId}/layers/{layerId} - * @param {string} volumeId The volume to retrieve annotations for. - * @param {string} layerId The ID for the layer to get the annotations. - * @param {string} contentVersion The content version for the requested volume. - * @param {string} endOffset The end offset to end retrieving data from. - * @param {string} endPosition The end position to end retrieving data from. - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 200 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {string} startOffset The start offset to start retrieving data from. - * @param {string} startPosition The start position to start retrieving data from. - * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {string} volumeAnnotationsVersion The version of the volume annotations that you are requesting. - * @return {void} Successful response - */ - Books_layers_volumeAnnotations_list(volumeId: string, layerId: string, contentVersion: string, endOffset: string | null | undefined, endPosition: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, startOffset: string | null | undefined, startPosition: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeAnnotationsVersion: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&endOffset=' + (endOffset == null ? '' : encodeURIComponent(endOffset)) + '&endPosition=' + (endPosition == null ? '' : encodeURIComponent(endPosition)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startOffset=' + (startOffset == null ? '' : encodeURIComponent(startOffset)) + '&startPosition=' + (startPosition == null ? '' : encodeURIComponent(startPosition)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeAnnotationsVersion=' + (volumeAnnotationsVersion == null ? '' : encodeURIComponent(volumeAnnotationsVersion)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the volume annotation. - * Get volumes/{volumeId}/layers/{layerId}/annotations/{annotationId} - * @param {string} volumeId The volume to retrieve annotations for. - * @param {string} layerId The ID for the layer to get the annotations. - * @param {string} annotationId The ID of the volume annotation to retrieve. - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_layers_volumeAnnotations_get(volumeId: string, layerId: string, annotationId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the annotation data for a volume and layer. - * Get volumes/{volumeId}/layers/{layerId}/data - * @param {string} volumeId The volume to retrieve annotation data for. - * @param {string} layerId The ID for the layer to get the annotation data. - * @param {string} contentVersion The content version for the requested volume. - * @param {Array} annotationDataId The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. - * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 200 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {number} scale The requested scale for the image. - * Minimum: 0 - * @param {string} source String to identify the originator of this request. - * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Successful response - */ - Books_layers_annotationData_list(volumeId: string, layerId: string, contentVersion: string, annotationDataId: Array | null | undefined, h: number | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, w: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&' + annotationDataId?.map(z => `annotationDataId=${encodeURIComponent(z)}`).join('&') + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&w=' + w, { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the annotation data. - * Get volumes/{volumeId}/layers/{layerId}/data/{annotationDataId} - * @param {string} volumeId The volume to retrieve annotations for. - * @param {string} layerId The ID for the layer to get the annotations. - * @param {string} annotationDataId The ID of the annotation data to retrieve. - * @param {string} contentVersion The content version for the volume you are trying to retrieve. - * @param {boolean} allowWebDefinitions For the dictionary layer. Whether or not to allow web definitions. - * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {number} scale The requested scale for the image. - * Minimum: 0 - * @param {string} source String to identify the originator of this request. - * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Successful response - */ - Books_layers_annotationData_get(volumeId: string, layerId: string, annotationDataId: string, contentVersion: string, allowWebDefinitions: boolean | null | undefined, h: number | null | undefined, locale: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, w: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data/' + (annotationDataId == null ? '' : encodeURIComponent(annotationDataId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&allowWebDefinitions=' + allowWebDefinitions + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&w=' + w, { observe: 'response', responseType: 'text' }); - } - - /** - * List the layer summaries for a volume. - * Get volumes/{volumeId}/layersummary - * @param {string} volumeId The volume to retrieve layers for. - * @param {string} contentVersion The content version for the requested volume. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 200 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_layers_list(volumeId: string, contentVersion: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the layer summary for a volume. - * Get volumes/{volumeId}/layersummary/{summaryId} - * @param {string} volumeId The volume to retrieve layers for. - * @param {string} summaryId The ID for the layer to get the summary for. - * @param {string} contentVersion The content version for the requested volume. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_layers_get(volumeId: string, summaryId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary/' + (summaryId == null ? '' : encodeURIComponent(summaryId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - } - - export enum Books_myconfig_requestAccessLicenseTypes { BOTH = 0, CONCURRENT = 1, DOWNLOAD = 2 } - - export enum Books_mylibrary_bookshelves_addVolumeReason { IOS_PREX = 0, IOS_SEARCH = 1, ONBOARDING = 2 } - - export enum Books_mylibrary_bookshelves_removeVolumeReason { ONBOARDING = 0 } - - export enum Books_mylibrary_bookshelves_volumes_listProjection { full = 0, lite = 1 } - - export enum Books_mylibrary_readingpositions_setPositionAction { bookmark = 0, chapter = 1, 'next-page' = 2, 'prev-page' = 3, scroll = 4, search = 5 } - - export enum Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating { mature = 0, 'not-mature' = 1 } - - export enum Books_volumes_listDownload { epub = 0 } - - export enum Books_volumes_listFilter { ebooks = 0, 'free-ebooks' = 1, full = 2, 'paid-ebooks' = 3, partial = 4 } - - export enum Books_volumes_listLibraryRestrict { 'my-library' = 0, 'no-restrict' = 1 } - - export enum Books_volumes_listOrderBy { newest = 0, relevance = 1 } - - export enum Books_volumes_listPrintType { all = 0, books = 1, magazines = 2 } - - export enum Books_volumes_recommended_rateRating { HAVE_IT = 0, NOT_INTERESTED = 1 } - - export enum Books_volumes_associated_listAssociation { 'end-of-sample' = 0, 'end-of-volume' = 1, 'related-for-play' = 2 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Annotation { + + /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + afterSelectedText?: string | null; + + /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + beforeSelectedText?: string | null; + + /** Selection ranges sent from the client. */ + clientVersionRanges?: AnnotationClientVersionRanges; + + /** Timestamp for the created time of this annotation. */ + created?: Date | null; + + /** Selection ranges for the most recent content version. */ + currentVersionRanges?: AnnotationCurrentVersionRanges; + + /** User-created data for this annotation. */ + data?: string | null; + + /** Indicates that this annotation is deleted. */ + deleted?: boolean | null; + + /** The highlight style for this annotation. */ + highlightStyle?: string | null; + + /** Id of this annotation, in the form of a GUID. */ + id?: string | null; + + /** Resource type. */ + kind?: string | null; + + /** The layer this annotation is for. */ + layerId?: string | null; + layerSummary?: AnnotationLayerSummary; + + /** Pages that this annotation spans. */ + pageIds?: Array; + + /** Excerpt from the volume. */ + selectedText?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Timestamp for the last time this annotation was modified. */ + updated?: Date | null; + + /** The volume that this annotation belongs to. */ + volumeId?: string | null; + } + export interface AnnotationFormProperties { + + /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + afterSelectedText: FormControl, + + /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + beforeSelectedText: FormControl, + + /** Timestamp for the created time of this annotation. */ + created: FormControl, + + /** User-created data for this annotation. */ + data: FormControl, + + /** Indicates that this annotation is deleted. */ + deleted: FormControl, + + /** The highlight style for this annotation. */ + highlightStyle: FormControl, + + /** Id of this annotation, in the form of a GUID. */ + id: FormControl, + + /** Resource type. */ + kind: FormControl, + + /** The layer this annotation is for. */ + layerId: FormControl, + + /** Excerpt from the volume. */ + selectedText: FormControl, + + /** URL to this resource. */ + selfLink: FormControl, + + /** Timestamp for the last time this annotation was modified. */ + updated: FormControl, + + /** The volume that this annotation belongs to. */ + volumeId: FormControl, + } + export function CreateAnnotationFormGroup() { + return new FormGroup({ + afterSelectedText: new FormControl(undefined), + beforeSelectedText: new FormControl(undefined), + created: new FormControl(undefined), + data: new FormControl(undefined), + deleted: new FormControl(undefined), + highlightStyle: new FormControl(undefined), + id: new FormControl(undefined), + kind: new FormControl(undefined), + layerId: new FormControl(undefined), + selectedText: new FormControl(undefined), + selfLink: new FormControl(undefined), + updated: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface AnnotationClientVersionRanges { + cfiRange?: BooksAnnotationsRange; + + /** Content version the client sent in. */ + contentVersion?: string | null; + gbImageRange?: BooksAnnotationsRange; + gbTextRange?: BooksAnnotationsRange; + imageCfiRange?: BooksAnnotationsRange; + } + export interface AnnotationClientVersionRangesFormProperties { + + /** Content version the client sent in. */ + contentVersion: FormControl, + } + export function CreateAnnotationClientVersionRangesFormGroup() { + return new FormGroup({ + contentVersion: new FormControl(undefined), + }); + + } + + export interface BooksAnnotationsRange { + + /** The offset from the ending position. */ + endOffset?: string | null; + + /** The ending position for the range. */ + endPosition?: string | null; + + /** The offset from the starting position. */ + startOffset?: string | null; + + /** The starting position for the range. */ + startPosition?: string | null; + } + export interface BooksAnnotationsRangeFormProperties { + + /** The offset from the ending position. */ + endOffset: FormControl, + + /** The ending position for the range. */ + endPosition: FormControl, + + /** The offset from the starting position. */ + startOffset: FormControl, + + /** The starting position for the range. */ + startPosition: FormControl, + } + export function CreateBooksAnnotationsRangeFormGroup() { + return new FormGroup({ + endOffset: new FormControl(undefined), + endPosition: new FormControl(undefined), + startOffset: new FormControl(undefined), + startPosition: new FormControl(undefined), + }); + + } + + export interface AnnotationCurrentVersionRanges { + cfiRange?: BooksAnnotationsRange; + + /** Content version applicable to ranges below. */ + contentVersion?: string | null; + gbImageRange?: BooksAnnotationsRange; + gbTextRange?: BooksAnnotationsRange; + imageCfiRange?: BooksAnnotationsRange; + } + export interface AnnotationCurrentVersionRangesFormProperties { + + /** Content version applicable to ranges below. */ + contentVersion: FormControl, + } + export function CreateAnnotationCurrentVersionRangesFormGroup() { + return new FormGroup({ + contentVersion: new FormControl(undefined), + }); + + } + + export interface AnnotationLayerSummary { + + /** + * Maximum allowed characters on this layer, especially for the "copy" layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + allowedCharacterCount?: number | null; + + /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ + limitType?: string | null; + + /** + * Remaining allowed characters on this layer, especially for the "copy" layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + remainingCharacterCount?: number | null; + } + export interface AnnotationLayerSummaryFormProperties { + + /** + * Maximum allowed characters on this layer, especially for the "copy" layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + allowedCharacterCount: FormControl, + + /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ + limitType: FormControl, + + /** + * Remaining allowed characters on this layer, especially for the "copy" layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + remainingCharacterCount: FormControl, + } + export function CreateAnnotationLayerSummaryFormGroup() { + return new FormGroup({ + allowedCharacterCount: new FormControl(undefined), + limitType: new FormControl(undefined), + remainingCharacterCount: new FormControl(undefined), + }); + + } + + export interface Annotationdata { + + /** The type of annotation this data is for. */ + annotationType?: string | null; + data?: any; + + /** Base64 encoded data for this annotation data. */ + encoded_data?: string | null; + + /** Unique id for this annotation data. */ + id?: string | null; + + /** Resource Type */ + kind?: string | null; + + /** The Layer id for this data. * */ + layerId?: string | null; + + /** URL for this resource. * */ + selfLink?: string | null; + + /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + + /** The volume id for this data. * */ + volumeId?: string | null; + } + export interface AnnotationdataFormProperties { + + /** The type of annotation this data is for. */ + annotationType: FormControl, + data: FormControl, + + /** Base64 encoded data for this annotation data. */ + encoded_data: FormControl, + + /** Unique id for this annotation data. */ + id: FormControl, + + /** Resource Type */ + kind: FormControl, + + /** The Layer id for this data. * */ + layerId: FormControl, + + /** URL for this resource. * */ + selfLink: FormControl, + + /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ + updated: FormControl, + + /** The volume id for this data. * */ + volumeId: FormControl, + } + export function CreateAnnotationdataFormGroup() { + return new FormGroup({ + annotationType: new FormControl(undefined), + data: new FormControl(undefined), + encoded_data: new FormControl(undefined), + id: new FormControl(undefined), + kind: new FormControl(undefined), + layerId: new FormControl(undefined), + selfLink: new FormControl(undefined), + updated: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface Annotations { + + /** A list of annotations. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string | null; + + /** + * Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + export interface AnnotationsFormProperties { + + /** Resource type. */ + kind: FormControl, + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken: FormControl, + + /** + * Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems: FormControl, + } + export function CreateAnnotationsFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + nextPageToken: new FormControl(undefined), + totalItems: new FormControl(undefined), + }); + + } + + export interface AnnotationsSummary { + kind?: string | null; + AnnotationsSummaryLayers?: Array; + } + export interface AnnotationsSummaryFormProperties { + kind: FormControl, + } + export function CreateAnnotationsSummaryFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface AnnotationsSummaryLayers { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + allowedCharacterCount?: number | null; + layerId?: string | null; + limitType?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + remainingCharacterCount?: number | null; + updated?: Date | null; + } + export interface AnnotationsSummaryLayersFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + allowedCharacterCount: FormControl, + layerId: FormControl, + limitType: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + remainingCharacterCount: FormControl, + updated: FormControl, + } + export function CreateAnnotationsSummaryLayersFormGroup() { + return new FormGroup({ + allowedCharacterCount: new FormControl(undefined), + layerId: new FormControl(undefined), + limitType: new FormControl(undefined), + remainingCharacterCount: new FormControl(undefined), + updated: new FormControl(undefined), + }); + + } + + export interface Annotationsdata { + + /** A list of Annotation Data. */ + items?: Array; + + /** Resource type */ + kind?: string | null; + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string | null; + + /** + * The total number of volume annotations found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + export interface AnnotationsdataFormProperties { + + /** Resource type */ + kind: FormControl, + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken: FormControl, + + /** + * The total number of volume annotations found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems: FormControl, + } + export function CreateAnnotationsdataFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + nextPageToken: new FormControl(undefined), + totalItems: new FormControl(undefined), + }); + + } + + export interface BooksCloudloadingResource { + author?: string | null; + processingState?: string | null; + title?: string | null; + volumeId?: string | null; + } + export interface BooksCloudloadingResourceFormProperties { + author: FormControl, + processingState: FormControl, + title: FormControl, + volumeId: FormControl, + } + export function CreateBooksCloudloadingResourceFormGroup() { + return new FormGroup({ + author: new FormControl(undefined), + processingState: new FormControl(undefined), + title: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface BooksSubscriptionReleaseInfo { + + /** Amount in micros of the specified currency code. */ + amountInMicros?: string | null; + + /** Currency code of the amount. */ + currencyCode?: string | null; + + /** The release number of this issue/volume/book. */ + releaseNumber?: string | null; + + /** The release date. */ + releaseTimestampUs?: string | null; + } + export interface BooksSubscriptionReleaseInfoFormProperties { + + /** Amount in micros of the specified currency code. */ + amountInMicros: FormControl, + + /** Currency code of the amount. */ + currencyCode: FormControl, + + /** The release number of this issue/volume/book. */ + releaseNumber: FormControl, + + /** The release date. */ + releaseTimestampUs: FormControl, + } + export function CreateBooksSubscriptionReleaseInfoFormGroup() { + return new FormGroup({ + amountInMicros: new FormControl(undefined), + currencyCode: new FormControl(undefined), + releaseNumber: new FormControl(undefined), + releaseTimestampUs: new FormControl(undefined), + }); + + } + + export interface BooksVolumesRecommendedRateResponse { + consistency_token?: string | null; + } + export interface BooksVolumesRecommendedRateResponseFormProperties { + consistency_token: FormControl, + } + export function CreateBooksVolumesRecommendedRateResponseFormGroup() { + return new FormGroup({ + consistency_token: new FormControl(undefined), + }); + + } + + export interface Bookshelf { + + /** Whether this bookshelf is PUBLIC or PRIVATE. */ + access?: string | null; + + /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ + created?: Date | null; + + /** Description of this bookshelf. */ + description?: string | null; + + /** + * Id of this bookshelf, only unique by user. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + id?: number | null; + + /** Resource type for bookshelf metadata. */ + kind?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Title of this bookshelf. */ + title?: string | null; + + /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ + updated?: Date | null; + + /** + * Number of volumes in this bookshelf. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + volumeCount?: number | null; + + /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ + volumesLastUpdated?: Date | null; + } + export interface BookshelfFormProperties { + + /** Whether this bookshelf is PUBLIC or PRIVATE. */ + access: FormControl, + + /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ + created: FormControl, + + /** Description of this bookshelf. */ + description: FormControl, + + /** + * Id of this bookshelf, only unique by user. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + id: FormControl, + + /** Resource type for bookshelf metadata. */ + kind: FormControl, + + /** URL to this resource. */ + selfLink: FormControl, + + /** Title of this bookshelf. */ + title: FormControl, + + /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ + updated: FormControl, + + /** + * Number of volumes in this bookshelf. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + volumeCount: FormControl, + + /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ + volumesLastUpdated: FormControl, + } + export function CreateBookshelfFormGroup() { + return new FormGroup({ + access: new FormControl(undefined), + created: new FormControl(undefined), + description: new FormControl(undefined), + id: new FormControl(undefined), + kind: new FormControl(undefined), + selfLink: new FormControl(undefined), + title: new FormControl(undefined), + updated: new FormControl(undefined), + volumeCount: new FormControl(undefined), + volumesLastUpdated: new FormControl(undefined), + }); + + } + + export interface Bookshelves { + + /** A list of bookshelves. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + } + export interface BookshelvesFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateBookshelvesFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface Category { + + /** A list of onboarding categories. */ + CategoryItems?: Array; + + /** Resource type. */ + kind?: string | null; + } + export interface CategoryFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface CategoryItems { + badgeUrl?: string | null; + categoryId?: string | null; + name?: string | null; + } + export interface CategoryItemsFormProperties { + badgeUrl: FormControl, + categoryId: FormControl, + name: FormControl, + } + export function CreateCategoryItemsFormGroup() { + return new FormGroup({ + badgeUrl: new FormControl(undefined), + categoryId: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + export interface ConcurrentAccessRestriction { + + /** Whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean | null; + + /** Resource type. */ + kind?: string | null; + + /** + * The maximum number of concurrent access licenses for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxConcurrentDevices?: number | null; + + /** Error/warning message. */ + message?: string | null; + + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string | null; + + /** Error/warning reason code. */ + reasonCode?: string | null; + + /** Whether this volume has any concurrent access restrictions. */ + restricted?: boolean | null; + + /** Response signature. */ + signature?: string | null; + + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string | null; + + /** + * Time in seconds for license auto-expiration. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + timeWindowSeconds?: number | null; + + /** Identifies the volume for which this entry applies. */ + volumeId?: string | null; + } + export interface ConcurrentAccessRestrictionFormProperties { + + /** Whether access is granted for this (user, device, volume). */ + deviceAllowed: FormControl, + + /** Resource type. */ + kind: FormControl, + + /** + * The maximum number of concurrent access licenses for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxConcurrentDevices: FormControl, + + /** Error/warning message. */ + message: FormControl, + + /** Client nonce for verification. Download access and client-validation only. */ + nonce: FormControl, + + /** Error/warning reason code. */ + reasonCode: FormControl, + + /** Whether this volume has any concurrent access restrictions. */ + restricted: FormControl, + + /** Response signature. */ + signature: FormControl, + + /** Client app identifier for verification. Download access and client-validation only. */ + source: FormControl, + + /** + * Time in seconds for license auto-expiration. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + timeWindowSeconds: FormControl, + + /** Identifies the volume for which this entry applies. */ + volumeId: FormControl, + } + export function CreateConcurrentAccessRestrictionFormGroup() { + return new FormGroup({ + deviceAllowed: new FormControl(undefined), + kind: new FormControl(undefined), + maxConcurrentDevices: new FormControl(undefined), + message: new FormControl(undefined), + nonce: new FormControl(undefined), + reasonCode: new FormControl(undefined), + restricted: new FormControl(undefined), + signature: new FormControl(undefined), + source: new FormControl(undefined), + timeWindowSeconds: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface Dictlayerdata { + common?: DictlayerdataCommon; + dict?: DictlayerdataDict; + kind?: string | null; + } + export interface DictlayerdataFormProperties { + kind: FormControl, + } + export function CreateDictlayerdataFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface DictlayerdataCommon { + + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string | null; + } + export interface DictlayerdataCommonFormProperties { + + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title: FormControl, + } + export function CreateDictlayerdataCommonFormGroup() { + return new FormGroup({ + title: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDict { + + /** The source, url and attribution for this dictionary data. */ + source?: DictlayerdataDictSource; + DictlayerdataDictWords?: Array; + } + export interface DictlayerdataDictFormProperties { + } + export function CreateDictlayerdataDictFormGroup() { + return new FormGroup({ + }); + + } + + export interface DictlayerdataDictSource { + attribution?: string | null; + url?: string | null; + } + export interface DictlayerdataDictSourceFormProperties { + attribution: FormControl, + url: FormControl, + } + export function CreateDictlayerdataDictSourceFormGroup() { + return new FormGroup({ + attribution: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWords { + DictlayerdataDictWordsDerivatives?: Array; + DictlayerdataDictWordsExamples?: Array; + DictlayerdataDictWordsSenses?: Array; + + /** The words with different meanings but not related words, e.g. "go" (game) and "go" (verb). */ + source?: DictlayerdataDictWordsSource; + } + export interface DictlayerdataDictWordsFormProperties { + } + export function CreateDictlayerdataDictWordsFormGroup() { + return new FormGroup({ + }); + + } + + export interface DictlayerdataDictWordsDerivatives { + source?: DictlayerdataDictWordsDerivativesSource; + text?: string | null; + } + export interface DictlayerdataDictWordsDerivativesFormProperties { + text: FormControl, + } + export function CreateDictlayerdataDictWordsDerivativesFormGroup() { + return new FormGroup({ + text: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsDerivativesSource { + attribution?: string | null; + url?: string | null; + } + export interface DictlayerdataDictWordsDerivativesSourceFormProperties { + attribution: FormControl, + url: FormControl, + } + export function CreateDictlayerdataDictWordsDerivativesSourceFormGroup() { + return new FormGroup({ + attribution: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsExamples { + source?: DictlayerdataDictWordsExamplesSource; + text?: string | null; + } + export interface DictlayerdataDictWordsExamplesFormProperties { + text: FormControl, + } + export function CreateDictlayerdataDictWordsExamplesFormGroup() { + return new FormGroup({ + text: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsExamplesSource { + attribution?: string | null; + url?: string | null; + } + export interface DictlayerdataDictWordsExamplesSourceFormProperties { + attribution: FormControl, + url: FormControl, + } + export function CreateDictlayerdataDictWordsExamplesSourceFormGroup() { + return new FormGroup({ + attribution: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSenses { + DictlayerdataDictWordsSensesConjugations?: Array; + DictlayerdataDictWordsSensesDefinitions?: Array; + partOfSpeech?: string | null; + pronunciation?: string | null; + pronunciationUrl?: string | null; + source?: DictlayerdataDictWordsSensesSource; + syllabification?: string | null; + DictlayerdataDictWordsSensesSynonyms?: Array; + } + export interface DictlayerdataDictWordsSensesFormProperties { + partOfSpeech: FormControl, + pronunciation: FormControl, + pronunciationUrl: FormControl, + syllabification: FormControl, + } + export function CreateDictlayerdataDictWordsSensesFormGroup() { + return new FormGroup({ + partOfSpeech: new FormControl(undefined), + pronunciation: new FormControl(undefined), + pronunciationUrl: new FormControl(undefined), + syllabification: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSensesConjugations { + type?: string | null; + value?: string | null; + } + export interface DictlayerdataDictWordsSensesConjugationsFormProperties { + type: FormControl, + value: FormControl, + } + export function CreateDictlayerdataDictWordsSensesConjugationsFormGroup() { + return new FormGroup({ + type: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSensesDefinitions { + definition?: string | null; + DictlayerdataDictWordsSensesDefinitionsExamples?: Array; + } + export interface DictlayerdataDictWordsSensesDefinitionsFormProperties { + definition: FormControl, + } + export function CreateDictlayerdataDictWordsSensesDefinitionsFormGroup() { + return new FormGroup({ + definition: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSensesDefinitionsExamples { + source?: DictlayerdataDictWordsSensesDefinitionsExamplesSource; + text?: string | null; + } + export interface DictlayerdataDictWordsSensesDefinitionsExamplesFormProperties { + text: FormControl, + } + export function CreateDictlayerdataDictWordsSensesDefinitionsExamplesFormGroup() { + return new FormGroup({ + text: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSensesDefinitionsExamplesSource { + attribution?: string | null; + url?: string | null; + } + export interface DictlayerdataDictWordsSensesDefinitionsExamplesSourceFormProperties { + attribution: FormControl, + url: FormControl, + } + export function CreateDictlayerdataDictWordsSensesDefinitionsExamplesSourceFormGroup() { + return new FormGroup({ + attribution: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSensesSource { + attribution?: string | null; + url?: string | null; + } + export interface DictlayerdataDictWordsSensesSourceFormProperties { + attribution: FormControl, + url: FormControl, + } + export function CreateDictlayerdataDictWordsSensesSourceFormGroup() { + return new FormGroup({ + attribution: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSensesSynonyms { + source?: DictlayerdataDictWordsSensesSynonymsSource; + text?: string | null; + } + export interface DictlayerdataDictWordsSensesSynonymsFormProperties { + text: FormControl, + } + export function CreateDictlayerdataDictWordsSensesSynonymsFormGroup() { + return new FormGroup({ + text: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSensesSynonymsSource { + attribution?: string | null; + url?: string | null; + } + export interface DictlayerdataDictWordsSensesSynonymsSourceFormProperties { + attribution: FormControl, + url: FormControl, + } + export function CreateDictlayerdataDictWordsSensesSynonymsSourceFormGroup() { + return new FormGroup({ + attribution: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface DictlayerdataDictWordsSource { + attribution?: string | null; + url?: string | null; + } + export interface DictlayerdataDictWordsSourceFormProperties { + attribution: FormControl, + url: FormControl, + } + export function CreateDictlayerdataDictWordsSourceFormGroup() { + return new FormGroup({ + attribution: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface Discoveryclusters { + DiscoveryclustersClusters?: Array; + + /** Resorce type. */ + kind?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + totalClusters?: number | null; + } + export interface DiscoveryclustersFormProperties { + + /** Resorce type. */ + kind: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + totalClusters: FormControl, + } + export function CreateDiscoveryclustersFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + totalClusters: new FormControl(undefined), + }); + + } + + export interface DiscoveryclustersClusters { + banner_with_content_container?: DiscoveryclustersClustersBanner_with_content_container; + subTitle?: string | null; + title?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + totalVolumes?: number | null; + uid?: string | null; + volumes?: Array; + } + export interface DiscoveryclustersClustersFormProperties { + subTitle: FormControl, + title: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + totalVolumes: FormControl, + uid: FormControl, + } + export function CreateDiscoveryclustersClustersFormGroup() { + return new FormGroup({ + subTitle: new FormControl(undefined), + title: new FormControl(undefined), + totalVolumes: new FormControl(undefined), + uid: new FormControl(undefined), + }); + + } + + export interface DiscoveryclustersClustersBanner_with_content_container { + fillColorArgb?: string | null; + imageUrl?: string | null; + maskColorArgb?: string | null; + moreButtonText?: string | null; + moreButtonUrl?: string | null; + textColorArgb?: string | null; + } + export interface DiscoveryclustersClustersBanner_with_content_containerFormProperties { + fillColorArgb: FormControl, + imageUrl: FormControl, + maskColorArgb: FormControl, + moreButtonText: FormControl, + moreButtonUrl: FormControl, + textColorArgb: FormControl, + } + export function CreateDiscoveryclustersClustersBanner_with_content_containerFormGroup() { + return new FormGroup({ + fillColorArgb: new FormControl(undefined), + imageUrl: new FormControl(undefined), + maskColorArgb: new FormControl(undefined), + moreButtonText: new FormControl(undefined), + moreButtonUrl: new FormControl(undefined), + textColorArgb: new FormControl(undefined), + }); + + } + + export interface Volume { + + /** Any information about a volume related to reading or obtaining that volume text. This information can depend on country (books may be public domain in one country but not in another, e.g.). */ + accessInfo?: VolumeAccessInfo; + + /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ + etag?: string | null; + + /** Unique identifier for a volume. (In LITE projection.) */ + id?: string | null; + + /** Resource type for a volume. (In LITE projection.) */ + kind?: string | null; + + /** What layers exist in this volume and high level information about them. */ + layerInfo?: VolumeLayerInfo; + + /** Recommendation related information for this volume. */ + recommendedInfo?: VolumeRecommendedInfo; + + /** Any information about a volume related to the eBookstore and/or purchaseability. This information can depend on the country where the request originates from (i.e. books may not be for sale in certain countries). */ + saleInfo?: VolumeSaleInfo; + + /** Search result information related to this volume. */ + searchInfo?: VolumeSearchInfo; + + /** URL to this resource. (In LITE projection.) */ + selfLink?: string | null; + + /** User specific information related to this volume. (e.g. page this user last read or whether they purchased this book) */ + userInfo?: VolumeUserInfo; + + /** General volume information. */ + volumeInfo?: VolumeVolumeInfo; + } + export interface VolumeFormProperties { + + /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ + etag: FormControl, + + /** Unique identifier for a volume. (In LITE projection.) */ + id: FormControl, + + /** Resource type for a volume. (In LITE projection.) */ + kind: FormControl, + + /** URL to this resource. (In LITE projection.) */ + selfLink: FormControl, + } + export function CreateVolumeFormGroup() { + return new FormGroup({ + etag: new FormControl(undefined), + id: new FormControl(undefined), + kind: new FormControl(undefined), + selfLink: new FormControl(undefined), + }); + + } + + export interface VolumeAccessInfo { + + /** Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE projection.) */ + accessViewStatus?: string | null; + + /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ + country?: string | null; + downloadAccess?: DownloadAccessRestriction; + + /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ + driveImportedContentLink?: string | null; + + /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ + embeddable?: boolean | null; + + /** Information about epub content. (In LITE projection.) */ + epub?: VolumeAccessInfoEpub; + + /** Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the content, if the client supports it. */ + explicitOfflineLicenseManagement?: boolean | null; + + /** Information about pdf content. (In LITE projection.) */ + pdf?: VolumeAccessInfoPdf; + + /** Whether or not this book is public domain in the country listed above. */ + publicDomain?: boolean | null; + + /** Whether quote sharing is allowed for this volume. */ + quoteSharingAllowed?: boolean | null; + + /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ + textToSpeechPermission?: string | null; + + /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ + viewOrderUrl?: string | null; + + /** The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as non-eBooks. Public domain books will always have a value of ALL_PAGES. */ + viewability?: string | null; + + /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ + webReaderLink?: string | null; + } + export interface VolumeAccessInfoFormProperties { + + /** Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE projection.) */ + accessViewStatus: FormControl, + + /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ + country: FormControl, + + /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ + driveImportedContentLink: FormControl, + + /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ + embeddable: FormControl, + + /** Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the content, if the client supports it. */ + explicitOfflineLicenseManagement: FormControl, + + /** Whether or not this book is public domain in the country listed above. */ + publicDomain: FormControl, + + /** Whether quote sharing is allowed for this volume. */ + quoteSharingAllowed: FormControl, + + /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ + textToSpeechPermission: FormControl, + + /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ + viewOrderUrl: FormControl, + + /** The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as non-eBooks. Public domain books will always have a value of ALL_PAGES. */ + viewability: FormControl, + + /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ + webReaderLink: FormControl, + } + export function CreateVolumeAccessInfoFormGroup() { + return new FormGroup({ + accessViewStatus: new FormControl(undefined), + country: new FormControl(undefined), + driveImportedContentLink: new FormControl(undefined), + embeddable: new FormControl(undefined), + explicitOfflineLicenseManagement: new FormControl(undefined), + publicDomain: new FormControl(undefined), + quoteSharingAllowed: new FormControl(undefined), + textToSpeechPermission: new FormControl(undefined), + viewOrderUrl: new FormControl(undefined), + viewability: new FormControl(undefined), + webReaderLink: new FormControl(undefined), + }); + + } + + export interface DownloadAccessRestriction { + + /** If restricted, whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean | null; + + /** + * If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + downloadsAcquired?: number | null; + + /** If deviceAllowed, whether access was just acquired with this request. */ + justAcquired?: boolean | null; + + /** Resource type. */ + kind?: string | null; + + /** + * If restricted, the maximum number of content download licenses for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxDownloadDevices?: number | null; + + /** Error/warning message. */ + message?: string | null; + + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string | null; + + /** Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS */ + reasonCode?: string | null; + + /** Whether this volume has any download access restrictions. */ + restricted?: boolean | null; + + /** Response signature. */ + signature?: string | null; + + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string | null; + + /** Identifies the volume for which this entry applies. */ + volumeId?: string | null; + } + export interface DownloadAccessRestrictionFormProperties { + + /** If restricted, whether access is granted for this (user, device, volume). */ + deviceAllowed: FormControl, + + /** + * If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + downloadsAcquired: FormControl, + + /** If deviceAllowed, whether access was just acquired with this request. */ + justAcquired: FormControl, + + /** Resource type. */ + kind: FormControl, + + /** + * If restricted, the maximum number of content download licenses for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxDownloadDevices: FormControl, + + /** Error/warning message. */ + message: FormControl, + + /** Client nonce for verification. Download access and client-validation only. */ + nonce: FormControl, + + /** Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS */ + reasonCode: FormControl, + + /** Whether this volume has any download access restrictions. */ + restricted: FormControl, + + /** Response signature. */ + signature: FormControl, + + /** Client app identifier for verification. Download access and client-validation only. */ + source: FormControl, + + /** Identifies the volume for which this entry applies. */ + volumeId: FormControl, + } + export function CreateDownloadAccessRestrictionFormGroup() { + return new FormGroup({ + deviceAllowed: new FormControl(undefined), + downloadsAcquired: new FormControl(undefined), + justAcquired: new FormControl(undefined), + kind: new FormControl(undefined), + maxDownloadDevices: new FormControl(undefined), + message: new FormControl(undefined), + nonce: new FormControl(undefined), + reasonCode: new FormControl(undefined), + restricted: new FormControl(undefined), + signature: new FormControl(undefined), + source: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface VolumeAccessInfoEpub { + + /** URL to retrieve ACS token for epub download. (In LITE projection.) */ + acsTokenLink?: string | null; + + /** URL to download epub. (In LITE projection.) */ + downloadLink?: string | null; + + /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean | null; + } + export interface VolumeAccessInfoEpubFormProperties { + + /** URL to retrieve ACS token for epub download. (In LITE projection.) */ + acsTokenLink: FormControl, + + /** URL to download epub. (In LITE projection.) */ + downloadLink: FormControl, + + /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ + isAvailable: FormControl, + } + export function CreateVolumeAccessInfoEpubFormGroup() { + return new FormGroup({ + acsTokenLink: new FormControl(undefined), + downloadLink: new FormControl(undefined), + isAvailable: new FormControl(undefined), + }); + + } + + export interface VolumeAccessInfoPdf { + + /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ + acsTokenLink?: string | null; + + /** URL to download pdf. (In LITE projection.) */ + downloadLink?: string | null; + + /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean | null; + } + export interface VolumeAccessInfoPdfFormProperties { + + /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ + acsTokenLink: FormControl, + + /** URL to download pdf. (In LITE projection.) */ + downloadLink: FormControl, + + /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ + isAvailable: FormControl, + } + export function CreateVolumeAccessInfoPdfFormGroup() { + return new FormGroup({ + acsTokenLink: new FormControl(undefined), + downloadLink: new FormControl(undefined), + isAvailable: new FormControl(undefined), + }); + + } + + export interface VolumeLayerInfo { + + /** A layer should appear here if and only if the layer exists for this book. */ + VolumeLayerInfoLayers?: Array; + } + export interface VolumeLayerInfoFormProperties { + } + export function CreateVolumeLayerInfoFormGroup() { + return new FormGroup({ + }); + + } + + export interface VolumeLayerInfoLayers { + + /** The layer id of this layer (e.g. "geo"). */ + layerId?: string | null; + + /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ + volumeAnnotationsVersion?: string | null; + } + export interface VolumeLayerInfoLayersFormProperties { + + /** The layer id of this layer (e.g. "geo"). */ + layerId: FormControl, + + /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ + volumeAnnotationsVersion: FormControl, + } + export function CreateVolumeLayerInfoLayersFormGroup() { + return new FormGroup({ + layerId: new FormControl(undefined), + volumeAnnotationsVersion: new FormControl(undefined), + }); + + } + + export interface VolumeRecommendedInfo { + + /** A text explaining why this volume is recommended. */ + explanation?: string | null; + } + export interface VolumeRecommendedInfoFormProperties { + + /** A text explaining why this volume is recommended. */ + explanation: FormControl, + } + export function CreateVolumeRecommendedInfoFormGroup() { + return new FormGroup({ + explanation: new FormControl(undefined), + }); + + } + + export interface VolumeSaleInfo { + + /** URL to purchase this volume on the Google Books site. (In LITE projection) */ + buyLink?: string | null; + + /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ + country?: string | null; + + /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ + isEbook?: boolean | null; + + /** Suggested retail price. (In LITE projection.) */ + listPrice?: VolumeSaleInfoListPrice; + + /** Offers available for this volume (sales and rentals). */ + VolumeSaleInfoOffers?: Array; + + /** The date on which this book is available for sale. */ + onSaleDate?: Date | null; + + /** The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In LITE projection.) */ + retailPrice?: VolumeSaleInfoRetailPrice; + + /** Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. */ + saleability?: string | null; + } + export interface VolumeSaleInfoFormProperties { + + /** URL to purchase this volume on the Google Books site. (In LITE projection) */ + buyLink: FormControl, + + /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ + country: FormControl, + + /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ + isEbook: FormControl, + + /** The date on which this book is available for sale. */ + onSaleDate: FormControl, + + /** Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. */ + saleability: FormControl, + } + export function CreateVolumeSaleInfoFormGroup() { + return new FormGroup({ + buyLink: new FormControl(undefined), + country: new FormControl(undefined), + isEbook: new FormControl(undefined), + onSaleDate: new FormControl(undefined), + saleability: new FormControl(undefined), + }); + + } + + export interface VolumeSaleInfoListPrice { + + /** + * Amount in the currency listed below. (In LITE projection.) + * Type: double + */ + amount?: number | null; + + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string | null; + } + export interface VolumeSaleInfoListPriceFormProperties { + + /** + * Amount in the currency listed below. (In LITE projection.) + * Type: double + */ + amount: FormControl, + + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode: FormControl, + } + export function CreateVolumeSaleInfoListPriceFormGroup() { + return new FormGroup({ + amount: new FormControl(undefined), + currencyCode: new FormControl(undefined), + }); + + } + + export interface VolumeSaleInfoOffers { + + /** + * The finsky offer type (e.g., PURCHASE=0 RENTAL=3) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + finskyOfferType?: number | null; + + /** Indicates whether the offer is giftable. */ + giftable?: boolean | null; + + /** Offer list (=undiscounted) price in Micros. */ + listPrice?: VolumeSaleInfoOffersListPrice; + + /** The rental duration (for rental offers only). */ + rentalDuration?: VolumeSaleInfoOffersRentalDuration; + + /** Offer retail (=discounted) price in Micros */ + retailPrice?: VolumeSaleInfoOffersRetailPrice; + } + export interface VolumeSaleInfoOffersFormProperties { + + /** + * The finsky offer type (e.g., PURCHASE=0 RENTAL=3) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + finskyOfferType: FormControl, + + /** Indicates whether the offer is giftable. */ + giftable: FormControl, + } + export function CreateVolumeSaleInfoOffersFormGroup() { + return new FormGroup({ + finskyOfferType: new FormControl(undefined), + giftable: new FormControl(undefined), + }); + + } + + export interface VolumeSaleInfoOffersListPrice { + + /** Type: double */ + amountInMicros?: number | null; + currencyCode?: string | null; + } + export interface VolumeSaleInfoOffersListPriceFormProperties { + + /** Type: double */ + amountInMicros: FormControl, + currencyCode: FormControl, + } + export function CreateVolumeSaleInfoOffersListPriceFormGroup() { + return new FormGroup({ + amountInMicros: new FormControl(undefined), + currencyCode: new FormControl(undefined), + }); + + } + + export interface VolumeSaleInfoOffersRentalDuration { + + /** Type: double */ + count?: number | null; + unit?: string | null; + } + export interface VolumeSaleInfoOffersRentalDurationFormProperties { + + /** Type: double */ + count: FormControl, + unit: FormControl, + } + export function CreateVolumeSaleInfoOffersRentalDurationFormGroup() { + return new FormGroup({ + count: new FormControl(undefined), + unit: new FormControl(undefined), + }); + + } + + export interface VolumeSaleInfoOffersRetailPrice { + + /** Type: double */ + amountInMicros?: number | null; + currencyCode?: string | null; + } + export interface VolumeSaleInfoOffersRetailPriceFormProperties { + + /** Type: double */ + amountInMicros: FormControl, + currencyCode: FormControl, + } + export function CreateVolumeSaleInfoOffersRetailPriceFormGroup() { + return new FormGroup({ + amountInMicros: new FormControl(undefined), + currencyCode: new FormControl(undefined), + }); + + } + + export interface VolumeSaleInfoRetailPrice { + + /** + * Amount in the currency listed below. (In LITE projection.) + * Type: double + */ + amount?: number | null; + + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string | null; + } + export interface VolumeSaleInfoRetailPriceFormProperties { + + /** + * Amount in the currency listed below. (In LITE projection.) + * Type: double + */ + amount: FormControl, + + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode: FormControl, + } + export function CreateVolumeSaleInfoRetailPriceFormGroup() { + return new FormGroup({ + amount: new FormControl(undefined), + currencyCode: new FormControl(undefined), + }); + + } + + export interface VolumeSearchInfo { + + /** A text snippet containing the search query. */ + textSnippet?: string | null; + } + export interface VolumeSearchInfoFormProperties { + + /** A text snippet containing the search query. */ + textSnippet: FormControl, + } + export function CreateVolumeSearchInfoFormGroup() { + return new FormGroup({ + textSnippet: new FormControl(undefined), + }); + + } + + export interface VolumeUserInfo { + + /** Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family sharing, etc. */ + acquiredTime?: Date | null; + + /** + * How this volume was acquired. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + acquisitionType?: number | null; + + /** Copy/Paste accounting information. */ + copy?: VolumeUserInfoCopy; + + /** + * Whether this volume is purchased, sample, pd download etc. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + entitlementType?: number | null; + + /** Information on the ability to share with the family. */ + familySharing?: VolumeUserInfoFamilySharing; + + /** Whether or not the user shared this volume with the family. */ + isFamilySharedFromUser?: boolean | null; + + /** Whether or not the user received this volume through family sharing. */ + isFamilySharedToUser?: boolean | null; + + /** Deprecated: Replaced by familySharing. */ + isFamilySharingAllowed?: boolean | null; + + /** Deprecated: Replaced by familySharing. */ + isFamilySharingDisabledByFop?: boolean | null; + + /** Whether or not this volume is currently in "my books." */ + isInMyBooks?: boolean | null; + + /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ + isPreordered?: boolean | null; + + /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ + isPurchased?: boolean | null; + + /** Whether or not this volume was user uploaded. */ + isUploaded?: boolean | null; + readingPosition?: ReadingPosition; + + /** Period during this book is/was a valid rental. */ + rentalPeriod?: VolumeUserInfoRentalPeriod; + + /** Whether this book is an active or an expired rental. */ + rentalState?: string | null; + review?: Review; + + /** Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + userUploadedVolumeInfo?: VolumeUserInfoUserUploadedVolumeInfo; + } + export interface VolumeUserInfoFormProperties { + + /** Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family sharing, etc. */ + acquiredTime: FormControl, + + /** + * How this volume was acquired. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + acquisitionType: FormControl, + + /** + * Whether this volume is purchased, sample, pd download etc. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + entitlementType: FormControl, + + /** Whether or not the user shared this volume with the family. */ + isFamilySharedFromUser: FormControl, + + /** Whether or not the user received this volume through family sharing. */ + isFamilySharedToUser: FormControl, + + /** Deprecated: Replaced by familySharing. */ + isFamilySharingAllowed: FormControl, + + /** Deprecated: Replaced by familySharing. */ + isFamilySharingDisabledByFop: FormControl, + + /** Whether or not this volume is currently in "my books." */ + isInMyBooks: FormControl, + + /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ + isPreordered: FormControl, + + /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ + isPurchased: FormControl, + + /** Whether or not this volume was user uploaded. */ + isUploaded: FormControl, + + /** Whether this book is an active or an expired rental. */ + rentalState: FormControl, + + /** Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC date-time format). */ + updated: FormControl, + } + export function CreateVolumeUserInfoFormGroup() { + return new FormGroup({ + acquiredTime: new FormControl(undefined), + acquisitionType: new FormControl(undefined), + entitlementType: new FormControl(undefined), + isFamilySharedFromUser: new FormControl(undefined), + isFamilySharedToUser: new FormControl(undefined), + isFamilySharingAllowed: new FormControl(undefined), + isFamilySharingDisabledByFop: new FormControl(undefined), + isInMyBooks: new FormControl(undefined), + isPreordered: new FormControl(undefined), + isPurchased: new FormControl(undefined), + isUploaded: new FormControl(undefined), + rentalState: new FormControl(undefined), + updated: new FormControl(undefined), + }); + + } + + export interface VolumeUserInfoCopy { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + allowedCharacterCount?: number | null; + limitType?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + remainingCharacterCount?: number | null; + updated?: Date | null; + } + export interface VolumeUserInfoCopyFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + allowedCharacterCount: FormControl, + limitType: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + remainingCharacterCount: FormControl, + updated: FormControl, + } + export function CreateVolumeUserInfoCopyFormGroup() { + return new FormGroup({ + allowedCharacterCount: new FormControl(undefined), + limitType: new FormControl(undefined), + remainingCharacterCount: new FormControl(undefined), + updated: new FormControl(undefined), + }); + + } + + export interface VolumeUserInfoFamilySharing { + + /** The role of the user in the family. */ + familyRole?: string | null; + + /** Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value is true, the user can initiate a family sharing action. */ + isSharingAllowed?: boolean | null; + + /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ + isSharingDisabledByFop?: boolean | null; + } + export interface VolumeUserInfoFamilySharingFormProperties { + + /** The role of the user in the family. */ + familyRole: FormControl, + + /** Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value is true, the user can initiate a family sharing action. */ + isSharingAllowed: FormControl, + + /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ + isSharingDisabledByFop: FormControl, + } + export function CreateVolumeUserInfoFamilySharingFormGroup() { + return new FormGroup({ + familyRole: new FormControl(undefined), + isSharingAllowed: new FormControl(undefined), + isSharingDisabledByFop: new FormControl(undefined), + }); + + } + + export interface ReadingPosition { + + /** Position in an EPUB as a CFI. */ + epubCfiPosition?: string | null; + + /** Position in a volume for image-based content. */ + gbImagePosition?: string | null; + + /** Position in a volume for text-based content. */ + gbTextPosition?: string | null; + + /** Resource type for a reading position. */ + kind?: string | null; + + /** Position in a PDF file. */ + pdfPosition?: string | null; + + /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ + updated?: Date | null; + + /** Volume id associated with this reading position. */ + volumeId?: string | null; + } + export interface ReadingPositionFormProperties { + + /** Position in an EPUB as a CFI. */ + epubCfiPosition: FormControl, + + /** Position in a volume for image-based content. */ + gbImagePosition: FormControl, + + /** Position in a volume for text-based content. */ + gbTextPosition: FormControl, + + /** Resource type for a reading position. */ + kind: FormControl, + + /** Position in a PDF file. */ + pdfPosition: FormControl, + + /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ + updated: FormControl, + + /** Volume id associated with this reading position. */ + volumeId: FormControl, + } + export function CreateReadingPositionFormGroup() { + return new FormGroup({ + epubCfiPosition: new FormControl(undefined), + gbImagePosition: new FormControl(undefined), + gbTextPosition: new FormControl(undefined), + kind: new FormControl(undefined), + pdfPosition: new FormControl(undefined), + updated: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface VolumeUserInfoRentalPeriod { + endUtcSec?: string | null; + startUtcSec?: string | null; + } + export interface VolumeUserInfoRentalPeriodFormProperties { + endUtcSec: FormControl, + startUtcSec: FormControl, + } + export function CreateVolumeUserInfoRentalPeriodFormGroup() { + return new FormGroup({ + endUtcSec: new FormControl(undefined), + startUtcSec: new FormControl(undefined), + }); + + } + + export interface Review { + + /** Author of this review. */ + author?: ReviewAuthor; + + /** Review text. */ + content?: string | null; + + /** Date of this review. */ + date?: string | null; + + /** URL for the full review text, for reviews gathered from the web. */ + fullTextUrl?: string | null; + + /** Resource type for a review. */ + kind?: string | null; + + /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ + rating?: string | null; + + /** Information regarding the source of this review, when the review is not from a Google Books user. */ + source?: ReviewSource; + + /** Title for this review. */ + title?: string | null; + + /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ + type?: string | null; + + /** Volume that this review is for. */ + volumeId?: string | null; + } + export interface ReviewFormProperties { + + /** Review text. */ + content: FormControl, + + /** Date of this review. */ + date: FormControl, + + /** URL for the full review text, for reviews gathered from the web. */ + fullTextUrl: FormControl, + + /** Resource type for a review. */ + kind: FormControl, + + /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ + rating: FormControl, + + /** Title for this review. */ + title: FormControl, + + /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ + type: FormControl, + + /** Volume that this review is for. */ + volumeId: FormControl, + } + export function CreateReviewFormGroup() { + return new FormGroup({ + content: new FormControl(undefined), + date: new FormControl(undefined), + fullTextUrl: new FormControl(undefined), + kind: new FormControl(undefined), + rating: new FormControl(undefined), + title: new FormControl(undefined), + type: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface ReviewAuthor { + + /** Name of this person. */ + displayName?: string | null; + } + export interface ReviewAuthorFormProperties { + + /** Name of this person. */ + displayName: FormControl, + } + export function CreateReviewAuthorFormGroup() { + return new FormGroup({ + displayName: new FormControl(undefined), + }); + + } + + export interface ReviewSource { + + /** Name of the source. */ + description?: string | null; + + /** Extra text about the source of the review. */ + extraDescription?: string | null; + + /** URL of the source of the review. */ + url?: string | null; + } + export interface ReviewSourceFormProperties { + + /** Name of the source. */ + description: FormControl, + + /** Extra text about the source of the review. */ + extraDescription: FormControl, + + /** URL of the source of the review. */ + url: FormControl, + } + export function CreateReviewSourceFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + extraDescription: new FormControl(undefined), + url: new FormControl(undefined), + }); + + } + + export interface VolumeUserInfoUserUploadedVolumeInfo { + processingState?: string | null; + } + export interface VolumeUserInfoUserUploadedVolumeInfoFormProperties { + processingState: FormControl, + } + export function CreateVolumeUserInfoUserUploadedVolumeInfoFormGroup() { + return new FormGroup({ + processingState: new FormControl(undefined), + }); + + } + + export interface VolumeVolumeInfo { + + /** Whether anonymous logging should be allowed. */ + allowAnonLogging?: boolean | null; + + /** The names of the authors and/or editors for this volume. (In LITE projection) */ + authors?: Array; + + /** + * The mean review rating for this volume. (min = 1.0, max = 5.0) + * Type: double + */ + averageRating?: number | null; + + /** Canonical URL for a volume. (In LITE projection.) */ + canonicalVolumeLink?: string | null; + + /** A list of subject categories, such as "Fiction", "Suspense", etc. */ + categories?: Array; + + /** Whether the volume has comics content. */ + comicsContent?: boolean | null; + + /** An identifier for the version of the volume content (text & images). (In LITE projection) */ + contentVersion?: string | null; + + /** A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE projection.) */ + description?: string | null; + + /** Physical dimensions of this volume. */ + dimensions?: VolumeVolumeInfoDimensions; + + /** A list of image links for all the sizes that are available. (In LITE projection.) */ + imageLinks?: VolumeVolumeInfoImageLinks; + + /** Industry standard identifiers for this volume. */ + VolumeVolumeInfoIndustryIdentifiers?: Array; + + /** URL to view information about this volume on the Google Books site. (In LITE projection) */ + infoLink?: string | null; + + /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ + language?: string | null; + + /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ + mainCategory?: string | null; + maturityRating?: string | null; + + /** + * Total number of pages as per publisher metadata. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageCount?: number | null; + + /** A top-level summary of the panelization info in this volume. */ + panelizationSummary?: VolumeVolumeInfoPanelizationSummary; + + /** URL to preview this volume on the Google Books site. */ + previewLink?: string | null; + + /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ + printType?: string | null; + + /** + * Total number of printed pages in generated pdf representation. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + printedPageCount?: number | null; + + /** Date of publication. (In LITE projection.) */ + publishedDate?: string | null; + + /** Publisher of this volume. (In LITE projection.) */ + publisher?: string | null; + + /** + * The number of review ratings for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ratingsCount?: number | null; + + /** The reading modes available for this volume. */ + readingModes?: any; + + /** + * Total number of sample pages as per publisher metadata. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + samplePageCount?: number | null; + seriesInfo?: Volumeseriesinfo; + + /** Volume subtitle. (In LITE projection.) */ + subtitle?: string | null; + + /** Volume title. (In LITE projection.) */ + title?: string | null; + } + export interface VolumeVolumeInfoFormProperties { + + /** Whether anonymous logging should be allowed. */ + allowAnonLogging: FormControl, + + /** + * The mean review rating for this volume. (min = 1.0, max = 5.0) + * Type: double + */ + averageRating: FormControl, + + /** Canonical URL for a volume. (In LITE projection.) */ + canonicalVolumeLink: FormControl, + + /** Whether the volume has comics content. */ + comicsContent: FormControl, + + /** An identifier for the version of the volume content (text & images). (In LITE projection) */ + contentVersion: FormControl, + + /** A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE projection.) */ + description: FormControl, + + /** URL to view information about this volume on the Google Books site. (In LITE projection) */ + infoLink: FormControl, + + /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ + language: FormControl, + + /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ + mainCategory: FormControl, + maturityRating: FormControl, + + /** + * Total number of pages as per publisher metadata. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageCount: FormControl, + + /** URL to preview this volume on the Google Books site. */ + previewLink: FormControl, + + /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ + printType: FormControl, + + /** + * Total number of printed pages in generated pdf representation. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + printedPageCount: FormControl, + + /** Date of publication. (In LITE projection.) */ + publishedDate: FormControl, + + /** Publisher of this volume. (In LITE projection.) */ + publisher: FormControl, + + /** + * The number of review ratings for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ratingsCount: FormControl, + + /** The reading modes available for this volume. */ + readingModes: FormControl, + + /** + * Total number of sample pages as per publisher metadata. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + samplePageCount: FormControl, + + /** Volume subtitle. (In LITE projection.) */ + subtitle: FormControl, + + /** Volume title. (In LITE projection.) */ + title: FormControl, + } + export function CreateVolumeVolumeInfoFormGroup() { + return new FormGroup({ + allowAnonLogging: new FormControl(undefined), + averageRating: new FormControl(undefined), + canonicalVolumeLink: new FormControl(undefined), + comicsContent: new FormControl(undefined), + contentVersion: new FormControl(undefined), + description: new FormControl(undefined), + infoLink: new FormControl(undefined), + language: new FormControl(undefined), + mainCategory: new FormControl(undefined), + maturityRating: new FormControl(undefined), + pageCount: new FormControl(undefined), + previewLink: new FormControl(undefined), + printType: new FormControl(undefined), + printedPageCount: new FormControl(undefined), + publishedDate: new FormControl(undefined), + publisher: new FormControl(undefined), + ratingsCount: new FormControl(undefined), + readingModes: new FormControl(undefined), + samplePageCount: new FormControl(undefined), + subtitle: new FormControl(undefined), + title: new FormControl(undefined), + }); + + } + + export interface VolumeVolumeInfoDimensions { + + /** Height or length of this volume (in cm). */ + height?: string | null; + + /** Thickness of this volume (in cm). */ + thickness?: string | null; + + /** Width of this volume (in cm). */ + width?: string | null; + } + export interface VolumeVolumeInfoDimensionsFormProperties { + + /** Height or length of this volume (in cm). */ + height: FormControl, + + /** Thickness of this volume (in cm). */ + thickness: FormControl, + + /** Width of this volume (in cm). */ + width: FormControl, + } + export function CreateVolumeVolumeInfoDimensionsFormGroup() { + return new FormGroup({ + height: new FormControl(undefined), + thickness: new FormControl(undefined), + width: new FormControl(undefined), + }); + + } + + export interface VolumeVolumeInfoImageLinks { + + /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ + extraLarge?: string | null; + + /** Image link for large size (width of ~800 pixels). (In LITE projection) */ + large?: string | null; + + /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ + medium?: string | null; + + /** Image link for small size (width of ~300 pixels). (In LITE projection) */ + small?: string | null; + + /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ + smallThumbnail?: string | null; + + /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ + thumbnail?: string | null; + } + export interface VolumeVolumeInfoImageLinksFormProperties { + + /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ + extraLarge: FormControl, + + /** Image link for large size (width of ~800 pixels). (In LITE projection) */ + large: FormControl, + + /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ + medium: FormControl, + + /** Image link for small size (width of ~300 pixels). (In LITE projection) */ + small: FormControl, + + /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ + smallThumbnail: FormControl, + + /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ + thumbnail: FormControl, + } + export function CreateVolumeVolumeInfoImageLinksFormGroup() { + return new FormGroup({ + extraLarge: new FormControl(undefined), + large: new FormControl(undefined), + medium: new FormControl(undefined), + small: new FormControl(undefined), + smallThumbnail: new FormControl(undefined), + thumbnail: new FormControl(undefined), + }); + + } + + export interface VolumeVolumeInfoIndustryIdentifiers { + + /** Industry specific volume identifier. */ + identifier?: string | null; + + /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ + type?: string | null; + } + export interface VolumeVolumeInfoIndustryIdentifiersFormProperties { + + /** Industry specific volume identifier. */ + identifier: FormControl, + + /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ + type: FormControl, + } + export function CreateVolumeVolumeInfoIndustryIdentifiersFormGroup() { + return new FormGroup({ + identifier: new FormControl(undefined), + type: new FormControl(undefined), + }); + + } + + export interface VolumeVolumeInfoPanelizationSummary { + containsEpubBubbles?: boolean | null; + containsImageBubbles?: boolean | null; + epubBubbleVersion?: string | null; + imageBubbleVersion?: string | null; + } + export interface VolumeVolumeInfoPanelizationSummaryFormProperties { + containsEpubBubbles: FormControl, + containsImageBubbles: FormControl, + epubBubbleVersion: FormControl, + imageBubbleVersion: FormControl, + } + export function CreateVolumeVolumeInfoPanelizationSummaryFormGroup() { + return new FormGroup({ + containsEpubBubbles: new FormControl(undefined), + containsImageBubbles: new FormControl(undefined), + epubBubbleVersion: new FormControl(undefined), + imageBubbleVersion: new FormControl(undefined), + }); + + } + + export interface Volumeseriesinfo { + + /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ + bookDisplayNumber?: string | null; + + /** Resource type. */ + kind?: string | null; + + /** Short book title in the context of the series. */ + shortSeriesBookTitle?: string | null; + VolumeseriesinfoVolumeSeries?: Array; + } + export interface VolumeseriesinfoFormProperties { + + /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ + bookDisplayNumber: FormControl, + + /** Resource type. */ + kind: FormControl, + + /** Short book title in the context of the series. */ + shortSeriesBookTitle: FormControl, + } + export function CreateVolumeseriesinfoFormGroup() { + return new FormGroup({ + bookDisplayNumber: new FormControl(undefined), + kind: new FormControl(undefined), + shortSeriesBookTitle: new FormControl(undefined), + }); + + } + + export interface VolumeseriesinfoVolumeSeries { + + /** List of issues. Applicable only for Collection Edition and Omnibus. */ + VolumeseriesinfoVolumeSeriesIssue?: Array; + + /** + * The book order number in the series. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + orderNumber?: number | null; + + /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ + seriesBookType?: string | null; + + /** The series id. */ + seriesId?: string | null; + } + export interface VolumeseriesinfoVolumeSeriesFormProperties { + + /** + * The book order number in the series. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + orderNumber: FormControl, + + /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ + seriesBookType: FormControl, + + /** The series id. */ + seriesId: FormControl, + } + export function CreateVolumeseriesinfoVolumeSeriesFormGroup() { + return new FormGroup({ + orderNumber: new FormControl(undefined), + seriesBookType: new FormControl(undefined), + seriesId: new FormControl(undefined), + }); + + } + + export interface VolumeseriesinfoVolumeSeriesIssue { + issueDisplayNumber?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + issueOrderNumber?: number | null; + } + export interface VolumeseriesinfoVolumeSeriesIssueFormProperties { + issueDisplayNumber: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + issueOrderNumber: FormControl, + } + export function CreateVolumeseriesinfoVolumeSeriesIssueFormGroup() { + return new FormGroup({ + issueDisplayNumber: new FormControl(undefined), + issueOrderNumber: new FormControl(undefined), + }); + + } + + export interface DownloadAccesses { + + /** A list of download access responses. */ + downloadAccessList?: Array; + + /** Resource type. */ + kind?: string | null; + } + export interface DownloadAccessesFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateDownloadAccessesFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface FamilyInfo { + + /** Resource type. */ + kind?: string | null; + + /** Family membership info of the user that made the request. */ + membership?: FamilyInfoMembership; + } + export interface FamilyInfoFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateFamilyInfoFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface FamilyInfoMembership { + + /** Restrictions on user buying and acquiring content. */ + acquirePermission?: string | null; + + /** The age group of the user. */ + ageGroup?: string | null; + + /** The maximum allowed maturity rating for the user. */ + allowedMaturityRating?: string | null; + isInFamily?: boolean | null; + + /** The role of the user in the family. */ + role?: string | null; + } + export interface FamilyInfoMembershipFormProperties { + + /** Restrictions on user buying and acquiring content. */ + acquirePermission: FormControl, + + /** The age group of the user. */ + ageGroup: FormControl, + + /** The maximum allowed maturity rating for the user. */ + allowedMaturityRating: FormControl, + isInFamily: FormControl, + + /** The role of the user in the family. */ + role: FormControl, + } + export function CreateFamilyInfoMembershipFormGroup() { + return new FormGroup({ + acquirePermission: new FormControl(undefined), + ageGroup: new FormControl(undefined), + allowedMaturityRating: new FormControl(undefined), + isInFamily: new FormControl(undefined), + role: new FormControl(undefined), + }); + + } + + export interface Geolayerdata { + common?: GeolayerdataCommon; + geo?: GeolayerdataGeo; + kind?: string | null; + } + export interface GeolayerdataFormProperties { + kind: FormControl, + } + export function CreateGeolayerdataFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface GeolayerdataCommon { + + /** The language of the information url and description. */ + lang?: string | null; + + /** The URL for the preview image information. */ + previewImageUrl?: string | null; + + /** The description for this location. */ + snippet?: string | null; + + /** The URL for information for this location. Ex: wikipedia link. */ + snippetUrl?: string | null; + + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string | null; + } + export interface GeolayerdataCommonFormProperties { + + /** The language of the information url and description. */ + lang: FormControl, + + /** The URL for the preview image information. */ + previewImageUrl: FormControl, + + /** The description for this location. */ + snippet: FormControl, + + /** The URL for information for this location. Ex: wikipedia link. */ + snippetUrl: FormControl, + + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title: FormControl, + } + export function CreateGeolayerdataCommonFormGroup() { + return new FormGroup({ + lang: new FormControl(undefined), + previewImageUrl: new FormControl(undefined), + snippet: new FormControl(undefined), + snippetUrl: new FormControl(undefined), + title: new FormControl(undefined), + }); + + } + + export interface GeolayerdataGeo { + + /** The boundary of the location as a set of loops containing pairs of latitude, longitude coordinates. */ + boundary?: Array; + + /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ + cachePolicy?: string | null; + + /** The country code of the location. */ + countryCode?: string | null; + + /** + * The latitude of the location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude of the location. + * Type: double + */ + longitude?: number | null; + + /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ + mapType?: string | null; + + /** The viewport for showing this location. This is a latitude, longitude rectangle. */ + viewport?: GeolayerdataGeoViewport; + + /** + * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + zoom?: number | null; + } + export interface GeolayerdataGeoFormProperties { + + /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ + cachePolicy: FormControl, + + /** The country code of the location. */ + countryCode: FormControl, + + /** + * The latitude of the location. + * Type: double + */ + latitude: FormControl, + + /** + * The longitude of the location. + * Type: double + */ + longitude: FormControl, + + /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ + mapType: FormControl, + + /** + * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + zoom: FormControl, + } + export function CreateGeolayerdataGeoFormGroup() { + return new FormGroup({ + cachePolicy: new FormControl(undefined), + countryCode: new FormControl(undefined), + latitude: new FormControl(undefined), + longitude: new FormControl(undefined), + mapType: new FormControl(undefined), + zoom: new FormControl(undefined), + }); + + } + + export interface GeolayerdataGeoViewport { + hi?: GeolayerdataGeoViewportHi; + lo?: GeolayerdataGeoViewportLo; + } + export interface GeolayerdataGeoViewportFormProperties { + } + export function CreateGeolayerdataGeoViewportFormGroup() { + return new FormGroup({ + }); + + } + + export interface GeolayerdataGeoViewportHi { + + /** Type: double */ + latitude?: number | null; + + /** Type: double */ + longitude?: number | null; + } + export interface GeolayerdataGeoViewportHiFormProperties { + + /** Type: double */ + latitude: FormControl, + + /** Type: double */ + longitude: FormControl, + } + export function CreateGeolayerdataGeoViewportHiFormGroup() { + return new FormGroup({ + latitude: new FormControl(undefined), + longitude: new FormControl(undefined), + }); + + } + + export interface GeolayerdataGeoViewportLo { + + /** Type: double */ + latitude?: number | null; + + /** Type: double */ + longitude?: number | null; + } + export interface GeolayerdataGeoViewportLoFormProperties { + + /** Type: double */ + latitude: FormControl, + + /** Type: double */ + longitude: FormControl, + } + export function CreateGeolayerdataGeoViewportLoFormGroup() { + return new FormGroup({ + latitude: new FormControl(undefined), + longitude: new FormControl(undefined), + }); + + } + + export interface Layersummaries { + + /** A list of layer summary items. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + + /** + * The total number of layer summaries found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + export interface LayersummariesFormProperties { + + /** Resource type. */ + kind: FormControl, + + /** + * The total number of layer summaries found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems: FormControl, + } + export function CreateLayersummariesFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + totalItems: new FormControl(undefined), + }); + + } + + export interface Layersummary { + + /** + * The number of annotations for this layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + annotationCount?: number | null; + + /** The list of annotation types contained for this layer. */ + annotationTypes?: Array; + + /** Link to get data for this annotation. */ + annotationsDataLink?: string | null; + + /** The link to get the annotations for this layer. */ + annotationsLink?: string | null; + + /** The content version this resource is for. */ + contentVersion?: string | null; + + /** + * The number of data items for this layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + dataCount?: number | null; + + /** Unique id of this layer summary. */ + id?: string | null; + + /** Resource Type */ + kind?: string | null; + + /** The layer id for this summary. */ + layerId?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + + /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ + volumeAnnotationsVersion?: string | null; + + /** The volume id this resource is for. */ + volumeId?: string | null; + } + export interface LayersummaryFormProperties { + + /** + * The number of annotations for this layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + annotationCount: FormControl, + + /** Link to get data for this annotation. */ + annotationsDataLink: FormControl, + + /** The link to get the annotations for this layer. */ + annotationsLink: FormControl, + + /** The content version this resource is for. */ + contentVersion: FormControl, + + /** + * The number of data items for this layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + dataCount: FormControl, + + /** Unique id of this layer summary. */ + id: FormControl, + + /** Resource Type */ + kind: FormControl, + + /** The layer id for this summary. */ + layerId: FormControl, + + /** URL to this resource. */ + selfLink: FormControl, + + /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ + updated: FormControl, + + /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ + volumeAnnotationsVersion: FormControl, + + /** The volume id this resource is for. */ + volumeId: FormControl, + } + export function CreateLayersummaryFormGroup() { + return new FormGroup({ + annotationCount: new FormControl(undefined), + annotationsDataLink: new FormControl(undefined), + annotationsLink: new FormControl(undefined), + contentVersion: new FormControl(undefined), + dataCount: new FormControl(undefined), + id: new FormControl(undefined), + kind: new FormControl(undefined), + layerId: new FormControl(undefined), + selfLink: new FormControl(undefined), + updated: new FormControl(undefined), + volumeAnnotationsVersion: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface Metadata { + + /** A list of offline dictionary metadata. */ + MetadataItems?: Array; + + /** Resource type. */ + kind?: string | null; + } + export interface MetadataFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateMetadataFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface MetadataItems { + download_url?: string | null; + encrypted_key?: string | null; + language?: string | null; + size?: string | null; + version?: string | null; + } + export interface MetadataItemsFormProperties { + download_url: FormControl, + encrypted_key: FormControl, + language: FormControl, + size: FormControl, + version: FormControl, + } + export function CreateMetadataItemsFormGroup() { + return new FormGroup({ + download_url: new FormControl(undefined), + encrypted_key: new FormControl(undefined), + language: new FormControl(undefined), + size: new FormControl(undefined), + version: new FormControl(undefined), + }); + + } + + export interface Notification { + body?: string | null; + + /** The list of crm experiment ids. */ + crmExperimentIds?: Array; + doc_id?: string | null; + doc_type?: string | null; + dont_show_notification?: boolean | null; + iconUrl?: string | null; + is_document_mature?: boolean | null; + + /** Resource type. */ + kind?: string | null; + notificationGroup?: string | null; + notification_type?: string | null; + pcampaign_id?: string | null; + reason?: string | null; + show_notification_settings_action?: boolean | null; + targetUrl?: string | null; + timeToExpireMs?: string | null; + title?: string | null; + } + export interface NotificationFormProperties { + body: FormControl, + doc_id: FormControl, + doc_type: FormControl, + dont_show_notification: FormControl, + iconUrl: FormControl, + is_document_mature: FormControl, + + /** Resource type. */ + kind: FormControl, + notificationGroup: FormControl, + notification_type: FormControl, + pcampaign_id: FormControl, + reason: FormControl, + show_notification_settings_action: FormControl, + targetUrl: FormControl, + timeToExpireMs: FormControl, + title: FormControl, + } + export function CreateNotificationFormGroup() { + return new FormGroup({ + body: new FormControl(undefined), + doc_id: new FormControl(undefined), + doc_type: new FormControl(undefined), + dont_show_notification: new FormControl(undefined), + iconUrl: new FormControl(undefined), + is_document_mature: new FormControl(undefined), + kind: new FormControl(undefined), + notificationGroup: new FormControl(undefined), + notification_type: new FormControl(undefined), + pcampaign_id: new FormControl(undefined), + reason: new FormControl(undefined), + show_notification_settings_action: new FormControl(undefined), + targetUrl: new FormControl(undefined), + timeToExpireMs: new FormControl(undefined), + title: new FormControl(undefined), + }); + + } + + export interface Offers { + + /** A list of offers. */ + OffersItems?: Array; + + /** Resource type. */ + kind?: string | null; + } + export interface OffersFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateOffersFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface OffersItems { + artUrl?: string | null; + gservicesKey?: string | null; + id?: string | null; + OffersItemsItems?: Array; + } + export interface OffersItemsFormProperties { + artUrl: FormControl, + gservicesKey: FormControl, + id: FormControl, + } + export function CreateOffersItemsFormGroup() { + return new FormGroup({ + artUrl: new FormControl(undefined), + gservicesKey: new FormControl(undefined), + id: new FormControl(undefined), + }); + + } + + export interface OffersItemsItems { + author?: string | null; + canonicalVolumeLink?: string | null; + coverUrl?: string | null; + description?: string | null; + title?: string | null; + volumeId?: string | null; + } + export interface OffersItemsItemsFormProperties { + author: FormControl, + canonicalVolumeLink: FormControl, + coverUrl: FormControl, + description: FormControl, + title: FormControl, + volumeId: FormControl, + } + export function CreateOffersItemsItemsFormGroup() { + return new FormGroup({ + author: new FormControl(undefined), + canonicalVolumeLink: new FormControl(undefined), + coverUrl: new FormControl(undefined), + description: new FormControl(undefined), + title: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface RequestAccess { + concurrentAccess?: ConcurrentAccessRestriction; + downloadAccess?: DownloadAccessRestriction; + + /** Resource type. */ + kind?: string | null; + } + export interface RequestAccessFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateRequestAccessFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface Series { + + /** Resource type. */ + kind?: string | null; + SeriesSeries?: Array; + } + export interface SeriesFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateSeriesFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface SeriesSeries { + bannerImageUrl?: string | null; + eligibleForSubscription?: boolean | null; + imageUrl?: string | null; + isComplete?: boolean | null; + seriesFormatType?: string | null; + seriesId?: string | null; + seriesSubscriptionReleaseInfo?: SeriesSeriesSeriesSubscriptionReleaseInfo; + seriesType?: string | null; + subscriptionId?: string | null; + title?: string | null; + } + export interface SeriesSeriesFormProperties { + bannerImageUrl: FormControl, + eligibleForSubscription: FormControl, + imageUrl: FormControl, + isComplete: FormControl, + seriesFormatType: FormControl, + seriesId: FormControl, + seriesType: FormControl, + subscriptionId: FormControl, + title: FormControl, + } + export function CreateSeriesSeriesFormGroup() { + return new FormGroup({ + bannerImageUrl: new FormControl(undefined), + eligibleForSubscription: new FormControl(undefined), + imageUrl: new FormControl(undefined), + isComplete: new FormControl(undefined), + seriesFormatType: new FormControl(undefined), + seriesId: new FormControl(undefined), + seriesType: new FormControl(undefined), + subscriptionId: new FormControl(undefined), + title: new FormControl(undefined), + }); + + } + + export interface SeriesSeriesSeriesSubscriptionReleaseInfo { + + /** Cancellation date of the series subscription (or when it ends). */ + cancellationTimestampUs?: string | null; + currentReleaseInfo?: BooksSubscriptionReleaseInfo; + nextReleaseInfo?: BooksSubscriptionReleaseInfo; + + /** series subscription type. */ + seriesSubscriptionType?: string | null; + } + export interface SeriesSeriesSeriesSubscriptionReleaseInfoFormProperties { + + /** Cancellation date of the series subscription (or when it ends). */ + cancellationTimestampUs: FormControl, + + /** series subscription type. */ + seriesSubscriptionType: FormControl, + } + export function CreateSeriesSeriesSeriesSubscriptionReleaseInfoFormGroup() { + return new FormGroup({ + cancellationTimestampUs: new FormControl(undefined), + seriesSubscriptionType: new FormControl(undefined), + }); + + } + + export interface Seriesmembership { + + /** Resorce type. */ + kind?: string | null; + member?: Array; + nextPageToken?: string | null; + } + export interface SeriesmembershipFormProperties { + + /** Resorce type. */ + kind: FormControl, + nextPageToken: FormControl, + } + export function CreateSeriesmembershipFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + nextPageToken: new FormControl(undefined), + }); + + } + + export interface Usersettings { + + /** Resource type. */ + kind?: string | null; + + /** User settings in sub-objects, each for different purposes. */ + notesExport?: UsersettingsNotesExport; + notification?: UsersettingsNotification; + } + export interface UsersettingsFormProperties { + + /** Resource type. */ + kind: FormControl, + } + export function CreateUsersettingsFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + }); + + } + + export interface UsersettingsNotesExport { + folderName?: string | null; + isEnabled?: boolean | null; + } + export interface UsersettingsNotesExportFormProperties { + folderName: FormControl, + isEnabled: FormControl, + } + export function CreateUsersettingsNotesExportFormGroup() { + return new FormGroup({ + folderName: new FormControl(undefined), + isEnabled: new FormControl(undefined), + }); + + } + + export interface UsersettingsNotification { + matchMyInterests?: UsersettingsNotificationMatchMyInterests; + moreFromAuthors?: UsersettingsNotificationMoreFromAuthors; + moreFromSeries?: UsersettingsNotificationMoreFromSeries; + priceDrop?: UsersettingsNotificationPriceDrop; + rewardExpirations?: UsersettingsNotificationRewardExpirations; + } + export interface UsersettingsNotificationFormProperties { + } + export function CreateUsersettingsNotificationFormGroup() { + return new FormGroup({ + }); + + } + + export interface UsersettingsNotificationMatchMyInterests { + opted_state?: string | null; + } + export interface UsersettingsNotificationMatchMyInterestsFormProperties { + opted_state: FormControl, + } + export function CreateUsersettingsNotificationMatchMyInterestsFormGroup() { + return new FormGroup({ + opted_state: new FormControl(undefined), + }); + + } + + export interface UsersettingsNotificationMoreFromAuthors { + opted_state?: string | null; + } + export interface UsersettingsNotificationMoreFromAuthorsFormProperties { + opted_state: FormControl, + } + export function CreateUsersettingsNotificationMoreFromAuthorsFormGroup() { + return new FormGroup({ + opted_state: new FormControl(undefined), + }); + + } + + export interface UsersettingsNotificationMoreFromSeries { + opted_state?: string | null; + } + export interface UsersettingsNotificationMoreFromSeriesFormProperties { + opted_state: FormControl, + } + export function CreateUsersettingsNotificationMoreFromSeriesFormGroup() { + return new FormGroup({ + opted_state: new FormControl(undefined), + }); + + } + + export interface UsersettingsNotificationPriceDrop { + opted_state?: string | null; + } + export interface UsersettingsNotificationPriceDropFormProperties { + opted_state: FormControl, + } + export function CreateUsersettingsNotificationPriceDropFormGroup() { + return new FormGroup({ + opted_state: new FormControl(undefined), + }); + + } + + export interface UsersettingsNotificationRewardExpirations { + opted_state?: string | null; + } + export interface UsersettingsNotificationRewardExpirationsFormProperties { + opted_state: FormControl, + } + export function CreateUsersettingsNotificationRewardExpirationsFormGroup() { + return new FormGroup({ + opted_state: new FormControl(undefined), + }); + + } + + export interface Volume2 { + + /** A list of volumes. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + nextPageToken?: string | null; + } + export interface Volume2FormProperties { + + /** Resource type. */ + kind: FormControl, + nextPageToken: FormControl, + } + export function CreateVolume2FormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + nextPageToken: new FormControl(undefined), + }); + + } + + export interface Volumeannotation { + + /** The annotation data id for this volume annotation. */ + annotationDataId?: string | null; + + /** Link to get data for this annotation. */ + annotationDataLink?: string | null; + + /** The type of annotation this is. */ + annotationType?: string | null; + + /** The content ranges to identify the selected text. */ + contentRanges?: VolumeannotationContentRanges; + + /** Data for this annotation. */ + data?: string | null; + + /** Indicates that this annotation is deleted. */ + deleted?: boolean | null; + + /** Unique id of this volume annotation. */ + id?: string | null; + + /** Resource Type */ + kind?: string | null; + + /** The Layer this annotation is for. */ + layerId?: string | null; + + /** Pages the annotation spans. */ + pageIds?: Array; + + /** Excerpt from the volume. */ + selectedText?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + + /** The Volume this annotation is for. */ + volumeId?: string | null; + } + export interface VolumeannotationFormProperties { + + /** The annotation data id for this volume annotation. */ + annotationDataId: FormControl, + + /** Link to get data for this annotation. */ + annotationDataLink: FormControl, + + /** The type of annotation this is. */ + annotationType: FormControl, + + /** Data for this annotation. */ + data: FormControl, + + /** Indicates that this annotation is deleted. */ + deleted: FormControl, + + /** Unique id of this volume annotation. */ + id: FormControl, + + /** Resource Type */ + kind: FormControl, + + /** The Layer this annotation is for. */ + layerId: FormControl, + + /** Excerpt from the volume. */ + selectedText: FormControl, + + /** URL to this resource. */ + selfLink: FormControl, + + /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ + updated: FormControl, + + /** The Volume this annotation is for. */ + volumeId: FormControl, + } + export function CreateVolumeannotationFormGroup() { + return new FormGroup({ + annotationDataId: new FormControl(undefined), + annotationDataLink: new FormControl(undefined), + annotationType: new FormControl(undefined), + data: new FormControl(undefined), + deleted: new FormControl(undefined), + id: new FormControl(undefined), + kind: new FormControl(undefined), + layerId: new FormControl(undefined), + selectedText: new FormControl(undefined), + selfLink: new FormControl(undefined), + updated: new FormControl(undefined), + volumeId: new FormControl(undefined), + }); + + } + + export interface VolumeannotationContentRanges { + cfiRange?: BooksAnnotationsRange; + + /** Content version applicable to ranges below. */ + contentVersion?: string | null; + gbImageRange?: BooksAnnotationsRange; + gbTextRange?: BooksAnnotationsRange; + } + export interface VolumeannotationContentRangesFormProperties { + + /** Content version applicable to ranges below. */ + contentVersion: FormControl, + } + export function CreateVolumeannotationContentRangesFormGroup() { + return new FormGroup({ + contentVersion: new FormControl(undefined), + }); + + } + + export interface Volumeannotations { + + /** A list of volume annotations. */ + items?: Array; + + /** Resource type */ + kind?: string | null; + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string | null; + + /** + * The total number of volume annotations found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + + /** The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the annotation data, just the information in this response (e.g. the location of annotations in the book). */ + version?: string | null; + } + export interface VolumeannotationsFormProperties { + + /** Resource type */ + kind: FormControl, + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken: FormControl, + + /** + * The total number of volume annotations found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems: FormControl, + + /** The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the annotation data, just the information in this response (e.g. the location of annotations in the book). */ + version: FormControl, + } + export function CreateVolumeannotationsFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + nextPageToken: new FormControl(undefined), + totalItems: new FormControl(undefined), + version: new FormControl(undefined), + }); + + } + + export interface Volumes { + + /** A list of volumes. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + + /** + * Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + export interface VolumesFormProperties { + + /** Resource type. */ + kind: FormControl, + + /** + * Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems: FormControl, + } + export function CreateVolumesFormGroup() { + return new FormGroup({ + kind: new FormControl(undefined), + totalItems: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Post cloudloading/addBook + * @param {string} drive_document_id A drive document id. The upload_client_token must not be set. + * @param {string} mime_type The document MIME type. It can be set only if the drive_document_id is set. + * @param {string} name The document name. It can be set only if the drive_document_id is set. + * @return {void} Successful response + */ + Books_cloudloading_addBook(drive_document_id: string | null | undefined, mime_type: string | null | undefined, name: string | null | undefined, upload_client_token: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'cloudloading/addBook?drive_document_id=' + (drive_document_id == null ? '' : encodeURIComponent(drive_document_id)) + '&mime_type=' + (mime_type == null ? '' : encodeURIComponent(mime_type)) + '&name=' + (name == null ? '' : encodeURIComponent(name)) + '&upload_client_token=' + (upload_client_token == null ? '' : encodeURIComponent(upload_client_token)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Remove the book and its contents + * Post cloudloading/deleteBook + * @param {string} volumeId The id of the book to be removed. + * @return {void} Successful response + */ + Books_cloudloading_deleteBook(volumeId: string): Observable> { + return this.http.post(this.baseUri + 'cloudloading/deleteBook?volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Post cloudloading/updateBook + * @return {void} Successful response + */ + Books_cloudloading_updateBook(requestBody: BooksCloudloadingResource): Observable> { + return this.http.post(this.baseUri + 'cloudloading/updateBook', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Returns a list of offline dictionary metadata available + * Get dictionary/listOfflineMetadata + * @param {string} cpksver The device/version ID from which to request the data. + * @return {void} Successful response + */ + Books_dictionary_listOfflineMetadata(cpksver: string): Observable> { + return this.http.get(this.baseUri + 'dictionary/listOfflineMetadata?cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets information regarding the family that the user is part of. + * Get familysharing/getFamilyInfo + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_familysharing_getFamilyInfo(source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'familysharing/getFamilyInfo?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Initiates sharing of the content with the user's family. Empty response indicates success. + * Post familysharing/share + * @param {string} docId The docid to share. + * @param {string} source String to identify the originator of this request. + * @param {string} volumeId The volume to share. + * @return {void} Successful response + */ + Books_familysharing_share(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'familysharing/share?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Initiates revoking content that has already been shared with the user's family. Empty response indicates success. + * Post familysharing/unshare + * @param {string} docId The docid to unshare. + * @param {string} source String to identify the originator of this request. + * @param {string} volumeId The volume to unshare. + * @return {void} Successful response + */ + Books_familysharing_unshare(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'familysharing/unshare?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the current settings for the user. + * Get myconfig/getUserSettings + * @return {void} Successful response + */ + Books_myconfig_getUserSettings(): Observable> { + return this.http.get(this.baseUri + 'myconfig/getUserSettings', { observe: 'response', responseType: 'text' }); + } + + /** + * Release downloaded content access restriction. + * Post myconfig/releaseDownloadAccess + * @param {Array} volumeIds The volume(s) to release restrictions for. + * @param {string} cpksver The device/version ID from which to release the restriction. + * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_myconfig_releaseDownloadAccess(volumeIds: Array, cpksver: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'myconfig/releaseDownloadAccess?' + volumeIds.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&') + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Request concurrent and download access restrictions. + * Post myconfig/requestAccess + * @param {string} source String to identify the originator of this request. + * @param {string} volumeId The volume to request concurrent/download restrictions for. + * @param {string} nonce The client nonce value. + * @param {string} cpksver The device/version ID from which to request the restrictions. + * @param {Books_myconfig_requestAccessLicenseTypes} licenseTypes The type of access license to request. If not specified, the default is BOTH. + * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @return {void} Successful response + */ + Books_myconfig_requestAccess(source: string, volumeId: string, nonce: string, cpksver: string, licenseTypes: Books_myconfig_requestAccessLicenseTypes | null | undefined, locale: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'myconfig/requestAccess?source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&licenseTypes=' + licenseTypes + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Request downloaded content access for specified volumes on the My eBooks shelf. + * Post myconfig/syncVolumeLicenses + * @param {string} source String to identify the originator of this request. + * @param {string} nonce The client nonce value. + * @param {string} cpksver The device/version ID from which to release the restriction. + * @param {Array} features List of features supported by the client, i.e., 'RENTALS' + * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. + * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {Array} volumeIds The volume(s) to request download restrictions for. + * @return {void} Successful response + */ + Books_myconfig_syncVolumeLicenses(source: string, nonce: string, cpksver: string, features: Array | null | undefined, includeNonComicsSeries: boolean | null | undefined, locale: string | null | undefined, showPreorders: boolean | null | undefined, volumeIds: Array | null | undefined): Observable> { + return this.http.post(this.baseUri + 'myconfig/syncVolumeLicenses?source=' + (source == null ? '' : encodeURIComponent(source)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&' + features?.map(z => `features=${encodeURIComponent(z)}`).join('&') + '&includeNonComicsSeries=' + includeNonComicsSeries + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&showPreorders=' + showPreorders + '&' + volumeIds?.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&'), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value. + * Post myconfig/updateUserSettings + * @return {void} Successful response + */ + Books_myconfig_updateUserSettings(requestBody: Usersettings): Observable> { + return this.http.post(this.baseUri + 'myconfig/updateUserSettings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves a list of annotations, possibly filtered. + * Get mylibrary/annotations + * @param {string} contentVersion The content version for the requested volume. + * @param {string} layerId The layer ID to limit annotation by. + * @param {Array} layerIds The layer ID(s) to limit annotation by. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 40 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {string} volumeId The volume to restrict annotations to. + * @return {void} Successful response + */ + Books_mylibrary_annotations_list(contentVersion: string | null | undefined, layerId: string | null | undefined, layerIds: Array | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/annotations?contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&layerId=' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&' + layerIds?.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Inserts a new annotation. + * Post mylibrary/annotations + * @param {string} annotationId The ID for the annotation to insert. + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {boolean} showOnlySummaryInResponse Requests that only the summary of the specified layer be provided in the response. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_annotations_insert(annotationId: string | null | undefined, country: string | null | undefined, showOnlySummaryInResponse: boolean | null | undefined, source: string | null | undefined, requestBody: Annotation): Observable> { + return this.http.post(this.baseUri + 'mylibrary/annotations?annotationId=' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&showOnlySummaryInResponse=' + showOnlySummaryInResponse + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Gets the summary of specified layers. + * Post mylibrary/annotations/summary + * @param {Array} layerIds Array of layer IDs to get the summary for. + * @param {string} volumeId Volume id to get the summary for. + * @return {void} Successful response + */ + Books_mylibrary_annotations_summary(layerIds: Array, volumeId: string): Observable> { + return this.http.post(this.baseUri + 'mylibrary/annotations/summary?' + layerIds.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Deletes an annotation. + * Delete mylibrary/annotations/{annotationId} + * @param {string} annotationId The ID for the annotation to delete. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_annotations_delete(annotationId: string, source: string | null | undefined): Observable> { + return this.http.delete(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Updates an existing annotation. + * Put mylibrary/annotations/{annotationId} + * @param {string} annotationId The ID for the annotation to update. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_annotations_update(annotationId: string, source: string | null | undefined, requestBody: Annotation): Observable> { + return this.http.put(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves a list of bookshelves belonging to the authenticated user. + * Get mylibrary/bookshelves + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_list(source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/bookshelves?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves metadata for a specific bookshelf belonging to the authenticated user. + * Get mylibrary/bookshelves/{shelf} + * @param {string} shelf ID of bookshelf to retrieve. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_get(shelf: string, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Adds a volume to a bookshelf. + * Post mylibrary/bookshelves/{shelf}/addVolume + * @param {string} shelf ID of bookshelf to which to add a volume. + * @param {string} volumeId ID of volume to add. + * @param {Books_mylibrary_bookshelves_addVolumeReason} reason The reason for which the book is added to the library. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_addVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_addVolumeReason | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/addVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Clears all volumes from a bookshelf. + * Post mylibrary/bookshelves/{shelf}/clearVolumes + * @param {string} shelf ID of bookshelf from which to remove a volume. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_clearVolumes(shelf: string, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/clearVolumes&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Moves a volume within a bookshelf. + * Post mylibrary/bookshelves/{shelf}/moveVolume + * @param {string} shelf ID of bookshelf with the volume. + * @param {string} volumeId ID of volume to move. + * @param {number} volumePosition Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_moveVolume(shelf: string, volumeId: string, volumePosition: number, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/moveVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&volumePosition=' + volumePosition + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Removes a volume from a bookshelf. + * Post mylibrary/bookshelves/{shelf}/removeVolume + * @param {string} shelf ID of bookshelf from which to remove a volume. + * @param {string} volumeId ID of volume to remove. + * @param {Books_mylibrary_bookshelves_removeVolumeReason} reason The reason for which the book is removed from the library. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_removeVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_removeVolumeReason | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/removeVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Gets volume information for volumes on a bookshelf. + * Get mylibrary/bookshelves/{shelf}/volumes + * @param {string} shelf The bookshelf ID or name retrieve volumes for. + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 + * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. + * @param {string} q Full-text search query string in this bookshelf. + * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first element to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_volumes_list(shelf: string, country: string | null | undefined, maxResults: number | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, q: string | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&country=' + (country == null ? '' : encodeURIComponent(country)) + '&maxResults=' + maxResults + '&projection=' + projection + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves my reading position information for a volume. + * Get mylibrary/readingpositions/{volumeId} + * @param {string} volumeId ID of volume for which to retrieve a reading position. + * @param {string} contentVersion Volume content version for which this reading position is requested. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_readingpositions_get(volumeId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Sets my reading position information for a volume. + * Post mylibrary/readingpositions/{volumeId}/setPosition + * @param {string} volumeId ID of volume for which to update the reading position. + * @param {string} timestamp RFC 3339 UTC format timestamp associated with this reading position. + * @param {string} position Position string for the new volume reading position. + * @param {Books_mylibrary_readingpositions_setPositionAction} action Action that caused this reading position to be set. + * @param {string} contentVersion Volume content version for which this reading position applies. + * @param {string} deviceCookie Random persistent device cookie optional on set position. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_readingpositions_setPosition(volumeId: string, timestamp: string, position: string, action: Books_mylibrary_readingpositions_setPositionAction | null | undefined, contentVersion: string | null | undefined, deviceCookie: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/setPosition×tamp=' + (timestamp == null ? '' : encodeURIComponent(timestamp)) + '&position=' + (position == null ? '' : encodeURIComponent(position)) + '&action=' + action + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&deviceCookie=' + (deviceCookie == null ? '' : encodeURIComponent(deviceCookie)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Returns notification details for a given notification id. + * Get notification/get + * @param {string} notification_id String to identify the notification. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_notification_get(notification_id: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'notification/get?notification_id=' + (notification_id == null ? '' : encodeURIComponent(notification_id)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * List categories for onboarding experience. + * Get onboarding/listCategories + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * @return {void} Successful response + */ + Books_onboarding_listCategories(locale: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'onboarding/listCategories?locale=' + (locale == null ? '' : encodeURIComponent(locale)), { observe: 'response', responseType: 'text' }); + } + + /** + * List available volumes under categories for onboarding experience. + * Get onboarding/listCategoryVolumes + * @param {Array} categoryId List of category ids requested. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. + * @param {number} pageSize Number of maximum results per page to be included in the response. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} pageToken The value of the nextToken from the previous page. + * @return {void} Successful response + */ + Books_onboarding_listCategoryVolumes(categoryId: Array | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, pageSize: number | null | undefined, pageToken: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'onboarding/listCategoryVolumes?' + categoryId?.map(z => `categoryId=${encodeURIComponent(z)}`).join('&') + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&pageSize=' + pageSize + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)), { observe: 'response', responseType: 'text' }); + } + + /** + * Returns a stream of personalized book clusters + * Get personalizedstream/get + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_personalizedstream_get(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'personalizedstream/get?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Post promooffer/accept + * @param {string} androidId device android_id + * @param {string} device device device + * @param {string} manufacturer device manufacturer + * @param {string} model device model + * @param {string} product device product + * @param {string} serial device serial + * @param {string} volumeId Volume id to exercise the offer + * @return {void} Successful response + */ + Books_promooffer_accept(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'promooffer/accept?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Post promooffer/dismiss + * @param {string} androidId device android_id + * @param {string} device device device + * @param {string} manufacturer device manufacturer + * @param {string} model device model + * @param {string} offerId Offer to dimiss + * @param {string} product device product + * @param {string} serial device serial + * @return {void} Successful response + */ + Books_promooffer_dismiss(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'promooffer/dismiss?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Returns a list of promo offers available to the user + * Get promooffer/get + * @param {string} androidId device android_id + * @param {string} device device device + * @param {string} manufacturer device manufacturer + * @param {string} model device model + * @param {string} product device product + * @param {string} serial device serial + * @return {void} Successful response + */ + Books_promooffer_get(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'promooffer/get?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), { observe: 'response', responseType: 'text' }); + } + + /** + * Returns Series metadata for the given series ids. + * Get series/get + * @param {Array} series_id String that identifies the series + * @return {void} Successful response + */ + Books_series_get(series_id: Array): Observable> { + return this.http.get(this.baseUri + 'series/get?' + series_id.map(z => `series_id=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); + } + + /** + * Returns Series membership data given the series id. + * Get series/membership/get + * @param {string} series_id String that identifies the series + * @param {number} page_size Number of maximum results per page to be included in the response. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} page_token The value of the nextToken from the previous page. + * @return {void} Successful response + */ + Books_series_membership_get(series_id: string, page_size: number | null | undefined, page_token: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'series/membership/get?series_id=' + (series_id == null ? '' : encodeURIComponent(series_id)) + '&page_size=' + page_size + '&page_token=' + (page_token == null ? '' : encodeURIComponent(page_token)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves a list of public bookshelves for the specified user. + * Get users/{userId}/bookshelves + * @param {string} userId ID of user for whom to retrieve bookshelves. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_bookshelves_list(userId: string, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves metadata for a specific bookshelf for the specified user. + * Get users/{userId}/bookshelves/{shelf} + * @param {string} userId ID of user for whom to retrieve bookshelves. + * @param {string} shelf ID of bookshelf to retrieve. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_bookshelves_get(userId: string, shelf: string, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves volumes in a specific bookshelf for the specified user. + * Get users/{userId}/bookshelves/{shelf}/volumes + * @param {string} userId ID of user for whom to retrieve bookshelf volumes. + * @param {string} shelf ID of bookshelf to retrieve volumes. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 + * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first element to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_bookshelves_volumes_list(userId: string, shelf: string, maxResults: number | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&maxResults=' + maxResults + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Performs a book search. + * Get volumes + * @param {string} q Full-text search query string. + * @param {Books_volumes_listDownload} download Restrict to volumes by download availability. + * @param {Books_volumes_listFilter} filter Filter search results. + * @param {string} langRestrict Restrict results to books with this language code. + * @param {Books_volumes_listLibraryRestrict} libraryRestrict Restrict search to this user's library. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {number} maxResults Maximum number of results to return. + * Minimum: 0 Maximum: 40 + * @param {Books_volumes_listOrderBy} orderBy Sort search results. + * @param {string} partner Restrict and brand results for partner ID. + * @param {Books_volumes_listPrintType} printType Restrict to books or magazines. + * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. + * @param {boolean} showPreorders Set to true to show books available for preorder. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first result to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_volumes_list(q: string, download: Books_volumes_listDownload | null | undefined, filter: Books_volumes_listFilter | null | undefined, langRestrict: string | null | undefined, libraryRestrict: Books_volumes_listLibraryRestrict | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, maxResults: number | null | undefined, orderBy: Books_volumes_listOrderBy | null | undefined, partner: string | null | undefined, printType: Books_volumes_listPrintType | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes?q=' + (q == null ? '' : encodeURIComponent(q)) + '&download=' + download + '&filter=' + filter + '&langRestrict=' + (langRestrict == null ? '' : encodeURIComponent(langRestrict)) + '&libraryRestrict=' + libraryRestrict + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&maxResults=' + maxResults + '&orderBy=' + orderBy + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&printType=' + printType + '&projection=' + projection + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of books in My Library. + * Get volumes/mybooks + * @param {Array} acquireMethod How the book was acquired + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. + * @param {number} maxResults Maximum number of results to return. + * Minimum: 0 Maximum: 100 + * @param {Array} processingState The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first result to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_volumes_mybooks_list(acquireMethod: Array | null | undefined, country: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/mybooks?' + acquireMethod?.map(z => `acquireMethod=${encodeURIComponent(z)}`).join('&') + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of recommended books for the current user. + * Get volumes/recommended + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_recommended_list(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/recommended?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Rate a recommended book for the current user. + * Post volumes/recommended/rate + * @param {Books_volumes_recommended_rateRating} rating Rating to be given to the volume. + * @param {string} volumeId ID of the source volume. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_recommended_rate(rating: Books_volumes_recommended_rateRating, volumeId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'volumes/recommended/rate?rating=' + rating + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of books uploaded by the current user. + * Get volumes/useruploaded + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {number} maxResults Maximum number of results to return. + * Minimum: 0 Maximum: 40 + * @param {Array} processingState The processing state of the user uploaded volumes to be returned. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first result to return (starts at 0) + * Minimum: 0 + * @param {Array} volumeId The ids of the volumes to be returned. If not specified all that match the processingState are returned. + * @return {void} Successful response + */ + Books_volumes_useruploaded_list(locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined, volumeId: Array | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/useruploaded?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex + '&' + volumeId?.map(z => `volumeId=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets volume information for a single volume. + * Get volumes/{volumeId} + * @param {string} volumeId ID of volume to retrieve. + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. + * @param {string} partner Brand results for partner ID. + * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_get(volumeId: string, country: string | null | undefined, includeNonComicsSeries: boolean | null | undefined, partner: string | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, source: string | null | undefined, user_library_consistent_read: boolean | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&includeNonComicsSeries=' + includeNonComicsSeries + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&projection=' + projection + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&user_library_consistent_read=' + user_library_consistent_read, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of associated books. + * Get volumes/{volumeId}/associated + * @param {string} volumeId ID of the source volume. + * @param {Books_volumes_associated_listAssociation} association Association type. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_associated_list(volumeId: string, association: Books_volumes_associated_listAssociation | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/associated&association=' + association + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the volume annotations for a volume and layer. + * Get volumes/{volumeId}/layers/{layerId} + * @param {string} volumeId The volume to retrieve annotations for. + * @param {string} layerId The ID for the layer to get the annotations. + * @param {string} contentVersion The content version for the requested volume. + * @param {string} endOffset The end offset to end retrieving data from. + * @param {string} endPosition The end position to end retrieving data from. + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 200 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {string} startOffset The start offset to start retrieving data from. + * @param {string} startPosition The start position to start retrieving data from. + * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {string} volumeAnnotationsVersion The version of the volume annotations that you are requesting. + * @return {void} Successful response + */ + Books_layers_volumeAnnotations_list(volumeId: string, layerId: string, contentVersion: string, endOffset: string | null | undefined, endPosition: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, startOffset: string | null | undefined, startPosition: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeAnnotationsVersion: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&endOffset=' + (endOffset == null ? '' : encodeURIComponent(endOffset)) + '&endPosition=' + (endPosition == null ? '' : encodeURIComponent(endPosition)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startOffset=' + (startOffset == null ? '' : encodeURIComponent(startOffset)) + '&startPosition=' + (startPosition == null ? '' : encodeURIComponent(startPosition)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeAnnotationsVersion=' + (volumeAnnotationsVersion == null ? '' : encodeURIComponent(volumeAnnotationsVersion)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the volume annotation. + * Get volumes/{volumeId}/layers/{layerId}/annotations/{annotationId} + * @param {string} volumeId The volume to retrieve annotations for. + * @param {string} layerId The ID for the layer to get the annotations. + * @param {string} annotationId The ID of the volume annotation to retrieve. + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_layers_volumeAnnotations_get(volumeId: string, layerId: string, annotationId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the annotation data for a volume and layer. + * Get volumes/{volumeId}/layers/{layerId}/data + * @param {string} volumeId The volume to retrieve annotation data for. + * @param {string} layerId The ID for the layer to get the annotation data. + * @param {string} contentVersion The content version for the requested volume. + * @param {Array} annotationDataId The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. + * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 200 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {number} scale The requested scale for the image. + * Minimum: 0 + * @param {string} source String to identify the originator of this request. + * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Successful response + */ + Books_layers_annotationData_list(volumeId: string, layerId: string, contentVersion: string, annotationDataId: Array | null | undefined, h: number | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, w: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&' + annotationDataId?.map(z => `annotationDataId=${encodeURIComponent(z)}`).join('&') + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&w=' + w, { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the annotation data. + * Get volumes/{volumeId}/layers/{layerId}/data/{annotationDataId} + * @param {string} volumeId The volume to retrieve annotations for. + * @param {string} layerId The ID for the layer to get the annotations. + * @param {string} annotationDataId The ID of the annotation data to retrieve. + * @param {string} contentVersion The content version for the volume you are trying to retrieve. + * @param {boolean} allowWebDefinitions For the dictionary layer. Whether or not to allow web definitions. + * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {number} scale The requested scale for the image. + * Minimum: 0 + * @param {string} source String to identify the originator of this request. + * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Successful response + */ + Books_layers_annotationData_get(volumeId: string, layerId: string, annotationDataId: string, contentVersion: string, allowWebDefinitions: boolean | null | undefined, h: number | null | undefined, locale: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, w: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data/' + (annotationDataId == null ? '' : encodeURIComponent(annotationDataId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&allowWebDefinitions=' + allowWebDefinitions + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&w=' + w, { observe: 'response', responseType: 'text' }); + } + + /** + * List the layer summaries for a volume. + * Get volumes/{volumeId}/layersummary + * @param {string} volumeId The volume to retrieve layers for. + * @param {string} contentVersion The content version for the requested volume. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 200 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_layers_list(volumeId: string, contentVersion: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the layer summary for a volume. + * Get volumes/{volumeId}/layersummary/{summaryId} + * @param {string} volumeId The volume to retrieve layers for. + * @param {string} summaryId The ID for the layer to get the summary for. + * @param {string} contentVersion The content version for the requested volume. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_layers_get(volumeId: string, summaryId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary/' + (summaryId == null ? '' : encodeURIComponent(summaryId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + } + + export enum Books_myconfig_requestAccessLicenseTypes { BOTH = 0, CONCURRENT = 1, DOWNLOAD = 2 } + + export enum Books_mylibrary_bookshelves_addVolumeReason { IOS_PREX = 0, IOS_SEARCH = 1, ONBOARDING = 2 } + + export enum Books_mylibrary_bookshelves_removeVolumeReason { ONBOARDING = 0 } + + export enum Books_mylibrary_bookshelves_volumes_listProjection { full = 0, lite = 1 } + + export enum Books_mylibrary_readingpositions_setPositionAction { bookmark = 0, chapter = 1, 'next-page' = 2, 'prev-page' = 3, scroll = 4, search = 5 } + + export enum Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating { mature = 0, 'not-mature' = 1 } + + export enum Books_volumes_listDownload { epub = 0 } + + export enum Books_volumes_listFilter { ebooks = 0, 'free-ebooks' = 1, full = 2, 'paid-ebooks' = 3, partial = 4 } + + export enum Books_volumes_listLibraryRestrict { 'my-library' = 0, 'no-restrict' = 1 } + + export enum Books_volumes_listOrderBy { newest = 0, relevance = 1 } + + export enum Books_volumes_listPrintType { all = 0, books = 1, magazines = 2 } + + export enum Books_volumes_recommended_rateRating { HAVE_IT = 0, NOT_INTERESTED = 1 } + + export enum Books_volumes_associated_listAssociation { 'end-of-sample' = 0, 'end-of-volume' = 1, 'related-for-play' = 2 } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/mcp.txt b/Tests/SwagTsTests/NG2FormGroupResults/mcp.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/mcp.txt rename to Tests/SwagTsTests/NG2FormGroupResults/mcp.ts index c117d823..b210293a 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/mcp.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/mcp.ts @@ -1,2021 +1,2021 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface BBSReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - export interface BBSReportRequestTypeFormProperties { - claimId: FormControl, - lodgementDate: FormControl, - } - export function CreateBBSReportRequestTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.minLength(6), Validators.maxLength(6)]), - lodgementDate: new FormControl(undefined), - }); - - } - - export interface ProviderType { - providerNumber: string; - } - export interface ProviderTypeFormProperties { - providerNumber: FormControl, - } - export function CreateProviderTypeFormGroup() { - return new FormGroup({ - providerNumber: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), - }); - - } - - export interface BBSPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - export interface BBSPaymentReportResponseTypeFormProperties { - status: FormControl, - } - export function CreateBBSPaymentReportResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface PaymentRunType { - payerName?: string | null; - runDate?: Date | null; - runNumber?: string | null; - } - export interface PaymentRunTypeFormProperties { - payerName: FormControl, - runDate: FormControl, - runNumber: FormControl, - } - export function CreatePaymentRunTypeFormGroup() { - return new FormGroup({ - payerName: new FormControl(undefined), - runDate: new FormControl(undefined), - runNumber: new FormControl(undefined), - }); - - } - - export interface PaymentType { - accountInfo: BankAccountType; - depositAmount?: string | null; - paymentReference?: string | null; - } - export interface PaymentTypeFormProperties { - depositAmount: FormControl, - paymentReference: FormControl, - } - export function CreatePaymentTypeFormGroup() { - return new FormGroup({ - depositAmount: new FormControl(undefined), - paymentReference: new FormControl(undefined), - }); - - } - - export interface BankAccountType { - accountName?: string | null; - accountNumber?: string | null; - bsbCode?: string | null; - } - export interface BankAccountTypeFormProperties { - accountName: FormControl, - accountNumber: FormControl, - bsbCode: FormControl, - } - export function CreateBankAccountTypeFormGroup() { - return new FormGroup({ - accountName: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(30)]), - accountNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - bsbCode: new FormControl(undefined, [Validators.minLength(6), Validators.maxLength(6)]), - }); - - } - - export interface ClaimSummaryType { - accountReferenceId?: string | null; - benefit?: string | null; - chargeAmount?: string | null; - claimChannelCode?: string | null; - claimId?: string | null; - lodgementDate?: Date | null; - transactionId?: string | null; - } - export interface ClaimSummaryTypeFormProperties { - accountReferenceId: FormControl, - benefit: FormControl, - chargeAmount: FormControl, - claimChannelCode: FormControl, - claimId: FormControl, - lodgementDate: FormControl, - transactionId: FormControl, - } - export function CreateClaimSummaryTypeFormGroup() { - return new FormGroup({ - accountReferenceId: new FormControl(undefined), - benefit: new FormControl(undefined), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - claimChannelCode: new FormControl(undefined), - claimId: new FormControl(undefined), - lodgementDate: new FormControl(undefined), - transactionId: new FormControl(undefined), - }); - - } - - export interface ServiceMessagesType { - highestSeverity: ServiceMessagesTypeHighestSeverity; - serviceMessage: Array; - } - export interface ServiceMessagesTypeFormProperties { - highestSeverity: FormControl, - } - export function CreateServiceMessagesTypeFormGroup() { - return new FormGroup({ - highestSeverity: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } - - export interface ServiceMessageType { - code: string; - severity: ServiceMessagesTypeHighestSeverity; - reason: string; - } - export interface ServiceMessageTypeFormProperties { - code: FormControl, - severity: FormControl, - reason: FormControl, - } - export function CreateServiceMessageTypeFormGroup() { - return new FormGroup({ - code: new FormControl(undefined, [Validators.required]), - severity: new FormControl(undefined, [Validators.required]), - reason: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface BBSProcessingReportResponseType { - claimAssessment?: ClaimAssessmentType; - status: string; - } - export interface BBSProcessingReportResponseTypeFormProperties { - status: FormControl, - } - export function CreateBBSProcessingReportResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface ClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - export interface ClaimAssessmentTypeFormProperties { - benefitPaid: FormControl, - chargeAmount: FormControl, - claimId: FormControl, - } - export function CreateClaimAssessmentTypeFormGroup() { - return new FormGroup({ - benefitPaid: new FormControl(undefined), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - claimId: new FormControl(undefined), - }); - - } - - export interface MedicalEventResponseType { - patient?: MembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - export interface MedicalEventResponseTypeFormProperties { - id: FormControl, - eventDate: FormControl, - } - export function CreateMedicalEventResponseTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - eventDate: new FormControl(undefined), - }); - - } - - export interface MembershipStatusType { - status?: StatusType; - currentMembership?: MembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - export interface MembershipStatusTypeFormProperties { - processDate: FormControl, - } - export function CreateMembershipStatusTypeFormGroup() { - return new FormGroup({ - processDate: new FormControl(undefined), - }); - - } - - export interface StatusType { - code?: number | null; - text?: string | null; - } - export interface StatusTypeFormProperties { - code: FormControl, - text: FormControl, - } - export function CreateStatusTypeFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - text: new FormControl(undefined), - }); - - } - - export interface MembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - } - export interface MembershipTypeFormProperties { - memberNumber: FormControl, - memberRefNumber: FormControl, - } - export function CreateMembershipTypeFormGroup() { - return new FormGroup({ - memberNumber: new FormControl(undefined, [Validators.minLength(10), Validators.maxLength(10)]), - memberRefNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface IdentityType { - dateOfBirth?: Date | null; - familyName?: string | null; - givenName?: string | null; - secondInitial?: string | null; - sex?: string | null; - } - export interface IdentityTypeFormProperties { - dateOfBirth: FormControl, - familyName: FormControl, - givenName: FormControl, - secondInitial: FormControl, - sex: FormControl, - } - export function CreateIdentityTypeFormGroup() { - return new FormGroup({ - dateOfBirth: new FormControl(undefined), - familyName: new FormControl(undefined), - givenName: new FormControl(undefined), - secondInitial: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - sex: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface ServiceResponseType { - error?: StatusType; - id?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - export interface ServiceResponseTypeFormProperties { - id: FormControl, - assessmentCode: FormControl, - benefitPaid: FormControl, - chargeAmount: FormControl, - itemNumber: FormControl, - numberOfPatientsSeen: FormControl, - } - export function CreateServiceResponseTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - assessmentCode: new FormControl(undefined), - benefitPaid: new FormControl(undefined), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - itemNumber: new FormControl(undefined), - numberOfPatientsSeen: new FormControl(undefined), - }); - - } - - export interface BulkBillStoreForwardRequestType { - claim: BulkBillClaimStoreForwardClaimType; - } - export interface BulkBillStoreForwardRequestTypeFormProperties { - } - export function CreateBulkBillStoreForwardRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface BulkBillClaimStoreForwardClaimType { - facilityId?: string | null; - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - export interface BulkBillClaimStoreForwardClaimTypeFormProperties { - facilityId: FormControl, - hospitalInd: FormControl, - serviceTypeCode: FormControl, - } - export function CreateBulkBillClaimStoreForwardClaimTypeFormGroup() { - return new FormGroup({ - facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - serviceTypeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface BBSMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - medicalEventDate: Date; - medicalEventTime?: string | null; - patient: MedicarePatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - service: Array; - submissionAuthorityInd: string; - } - export interface BBSMedicalEventTypeFormProperties { - id: FormControl, - authorisationDate: FormControl, - createDateTime: FormControl, - medicalEventDate: FormControl, - medicalEventTime: FormControl, - referralOverrideCode: FormControl, - submissionAuthorityInd: FormControl, - } - export function CreateBBSMedicalEventTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), - authorisationDate: CreateDateOnlyFormControl(), - createDateTime: new FormControl(undefined, [Validators.required]), - medicalEventDate: CreateDateOnlyFormControl(), - medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), - referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface MedicarePatientType { - identity: IdentityType; - medicare: MembershipType; - } - export interface MedicarePatientTypeFormProperties { - } - export function CreateMedicarePatientTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface ReferralType { - issueDate: Date; - period?: string | null; - periodCode?: string | null; - provider: ProviderType; - typeCode: string; - } - export interface ReferralTypeFormProperties { - issueDate: FormControl, - period: FormControl, - periodCode: FormControl, - typeCode: FormControl, - } - export function CreateReferralTypeFormGroup() { - return new FormGroup({ - issueDate: CreateDateOnlyFormControl(), - period: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - periodCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - typeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface ServiceType { - id: string; - accessionDateTime?: Date | null; - aftercareOverrideInd?: string | null; - chargeAmount?: string | null; - collectionDateTime?: Date | null; - duplicateServiceOverrideInd?: string | null; - fieldQuantity?: string | null; - itemNumber?: string | null; - lspNumber?: string | null; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - restrictiveOverrideCode?: string | null; - rule3ExemptInd?: string | null; - s4b3ExemptInd?: string | null; - scpId?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - } - export interface ServiceTypeFormProperties { - id: FormControl, - accessionDateTime: FormControl, - aftercareOverrideInd: FormControl, - chargeAmount: FormControl, - collectionDateTime: FormControl, - duplicateServiceOverrideInd: FormControl, - fieldQuantity: FormControl, - itemNumber: FormControl, - lspNumber: FormControl, - multipleProcedureOverrideInd: FormControl, - numberOfPatientsSeen: FormControl, - restrictiveOverrideCode: FormControl, - rule3ExemptInd: FormControl, - s4b3ExemptInd: FormControl, - scpId: FormControl, - selfDeemedCode: FormControl, - text: FormControl, - timeDuration: FormControl, - } - export function CreateServiceTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - accessionDateTime: new FormControl(undefined), - aftercareOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - collectionDateTime: new FormControl(undefined), - duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - fieldQuantity: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - itemNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), - lspNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), - multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), - rule3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - s4b3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - scpId: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(5)]), - selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - text: new FormControl(undefined), - timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), - }); - - } - - export interface BulkBillStoreForwardResponseType { - claimId: string; - status: string; - } - export interface BulkBillStoreForwardResponseTypeFormProperties { - claimId: FormControl, - status: FormControl, - } - export function CreateBulkBillStoreForwardResponseTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface AlliedHealthClaimRequestType { - claim: VAAClaimType; - } - export interface AlliedHealthClaimRequestTypeFormProperties { - } - export function CreateAlliedHealthClaimRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface VAAClaimType { - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - export interface VAAClaimTypeFormProperties { - hospitalInd: FormControl, - serviceTypeCode: FormControl, - } - export function CreateVAAClaimTypeFormGroup() { - return new FormGroup({ - hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - serviceTypeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface VAAMedicalEventType { - id: string; - acceptedDisability?: AcceptedDisabilityType; - authorisationDate: Date; - breakInEpisodeEndDate?: Date | null; - breakInEpisodeOfCareNumber?: string | null; - breakInEpisodeStartDate?: Date | null; - numberOfCNCHours?: string | null; - numberOfCNCVisits?: string | null; - createDateTime: Date; - numberOfENHours?: string | null; - numberOfENVisits?: string | null; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - numberOfNSSHours?: string | null; - numberOfNSSVisits?: string | null; - patient: VeteranPatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - numberOfRNHours?: string | null; - numberOfRNVisits?: string | null; - service: Array; - submissionAuthorityInd: string; - } - export interface VAAMedicalEventTypeFormProperties { - id: FormControl, - authorisationDate: FormControl, - breakInEpisodeEndDate: FormControl, - breakInEpisodeOfCareNumber: FormControl, - breakInEpisodeStartDate: FormControl, - numberOfCNCHours: FormControl, - numberOfCNCVisits: FormControl, - createDateTime: FormControl, - numberOfENHours: FormControl, - numberOfENVisits: FormControl, - facilityId: FormControl, - medicalEventDate: FormControl, - medicalEventTime: FormControl, - numberOfNSSHours: FormControl, - numberOfNSSVisits: FormControl, - referralOverrideCode: FormControl, - numberOfRNHours: FormControl, - numberOfRNVisits: FormControl, - submissionAuthorityInd: FormControl, - } - export function CreateVAAMedicalEventTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), - authorisationDate: CreateDateOnlyFormControl(), - breakInEpisodeEndDate: new FormControl(undefined), - breakInEpisodeOfCareNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - breakInEpisodeStartDate: new FormControl(undefined), - numberOfCNCHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), - numberOfCNCVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - createDateTime: new FormControl(undefined, [Validators.required]), - numberOfENHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), - numberOfENVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - medicalEventDate: CreateDateOnlyFormControl(), - medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), - numberOfNSSHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), - numberOfNSSVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - numberOfRNHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), - numberOfRNVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), - submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface AcceptedDisabilityType { - code: string; - ind: string; - } - export interface AcceptedDisabilityTypeFormProperties { - code: FormControl, - ind: FormControl, - } - export function CreateAcceptedDisabilityTypeFormGroup() { - return new FormGroup({ - code: new FormControl(undefined, [Validators.required]), - ind: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface VAAServiceType { - id: string; - accountReferenceNumber?: string | null; - admissionDate?: Date | null; - chargeAmount?: string | null; - dischargeDate?: Date | null; - distanceKilometres?: number | null; - duplicateServiceOverrideInd?: string | null; - itemNumber: string; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - numberOfTeeth?: string | null; - opticalScriptCode?: string | null; - restrictiveOverrideCode?: string | null; - secondDeviceInd?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - toothNumber?: string | null; - upperLowerJawCode?: string | null; - } - export interface VAAServiceTypeFormProperties { - id: FormControl, - accountReferenceNumber: FormControl, - admissionDate: FormControl, - chargeAmount: FormControl, - dischargeDate: FormControl, - distanceKilometres: FormControl, - duplicateServiceOverrideInd: FormControl, - itemNumber: FormControl, - multipleProcedureOverrideInd: FormControl, - numberOfPatientsSeen: FormControl, - numberOfTeeth: FormControl, - opticalScriptCode: FormControl, - restrictiveOverrideCode: FormControl, - secondDeviceInd: FormControl, - selfDeemedCode: FormControl, - text: FormControl, - timeDuration: FormControl, - toothNumber: FormControl, - upperLowerJawCode: FormControl, - } - export function CreateVAAServiceTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - accountReferenceNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(8)]), - admissionDate: new FormControl(undefined), - chargeAmount: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(7)]), - dischargeDate: new FormControl(undefined), - distanceKilometres: new FormControl(undefined), - duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - itemNumber: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(5)]), - multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - numberOfTeeth: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - opticalScriptCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), - secondDeviceInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - text: new FormControl(undefined), - timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), - toothNumber: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), - upperLowerJawCode: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), - }); - - } - - export interface VeteranPatientType extends PatientType { - veteranMembership?: VeteranMembershipType; - } - export interface VeteranPatientTypeFormProperties extends PatientTypeFormProperties { - } - export function CreateVeteranPatientTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface VeteranMembershipType { - veteranNumber: string; - } - export interface VeteranMembershipTypeFormProperties { - veteranNumber: FormControl, - } - export function CreateVeteranMembershipTypeFormGroup() { - return new FormGroup({ - veteranNumber: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(9)]), - }); - - } - - export interface PatientType { - identity: IdentityType; - residentialAddress?: AddressType; - } - export interface PatientTypeFormProperties { - } - export function CreatePatientTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postcode?: string | null; - } - export interface AddressTypeFormProperties { - addressLineOne: FormControl, - addressLineTwo: FormControl, - locality: FormControl, - postcode: FormControl, - } - export function CreateAddressTypeFormGroup() { - return new FormGroup({ - addressLineOne: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), - addressLineTwo: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), - locality: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), - postcode: new FormControl(undefined, [Validators.minLength(4), Validators.maxLength(4)]), - }); - - } - - export interface AlliedHealthClaimResponseType { - claimId: string; - status: string; - } - export interface AlliedHealthClaimResponseTypeFormProperties { - claimId: FormControl, - status: FormControl, - } - export function CreateAlliedHealthClaimResponseTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface DVAClaimRequestType { - claim: DVAClaimType; - } - export interface DVAClaimRequestTypeFormProperties { - } - export function CreateDVAClaimRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface DVAClaimType { - hospitalInd?: string | null; - serviceTypeCode: string; - medicalEvent: Array; - serviceProvider: ProviderType; - payeeProvider?: ProviderType; - } - export interface DVAClaimTypeFormProperties { - hospitalInd: FormControl, - serviceTypeCode: FormControl, - } - export function CreateDVAClaimTypeFormGroup() { - return new FormGroup({ - hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - serviceTypeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface DVAMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - referralOverrideCode?: string | null; - submissionAuthorityInd: string; - treatmentLocationCode?: string | null; - acceptedDisability?: AcceptedDisabilityType; - referral?: ReferralType; - patient: VeteranPatientType; - service: Array; - } - export interface DVAMedicalEventTypeFormProperties { - id: FormControl, - authorisationDate: FormControl, - createDateTime: FormControl, - facilityId: FormControl, - medicalEventDate: FormControl, - medicalEventTime: FormControl, - referralOverrideCode: FormControl, - submissionAuthorityInd: FormControl, - treatmentLocationCode: FormControl, - } - export function CreateDVAMedicalEventTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), - authorisationDate: CreateDateOnlyFormControl(), - createDateTime: new FormControl(undefined, [Validators.required]), - facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - medicalEventDate: CreateDateOnlyFormControl(), - medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), - referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - treatmentLocationCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface DVAServiceType extends ServiceType { - accountReferenceNumber?: string | null; - distanceKilometres?: number | null; - } - export interface DVAServiceTypeFormProperties extends ServiceTypeFormProperties { - accountReferenceNumber: FormControl, - distanceKilometres: FormControl, - } - export function CreateDVAServiceTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - accessionDateTime: new FormControl(undefined), - aftercareOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - collectionDateTime: new FormControl(undefined), - duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - fieldQuantity: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - itemNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), - lspNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), - multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), - rule3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - s4b3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - scpId: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(5)]), - selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - text: new FormControl(undefined), - timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), - accountReferenceNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(8)]), - distanceKilometres: new FormControl(undefined), - }); - - } - - export interface DVAClaimResponseType { - claimId: string; - status: string; - } - export interface DVAClaimResponseTypeFormProperties { - claimId: FormControl, - status: FormControl, - } - export function CreateDVAClaimResponseTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface DVAReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - export interface DVAReportRequestTypeFormProperties { - claimId: FormControl, - lodgementDate: FormControl, - } - export function CreateDVAReportRequestTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.minLength(6), Validators.maxLength(6)]), - lodgementDate: new FormControl(undefined), - }); - - } - - export interface DVAPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - export interface DVAPaymentReportResponseTypeFormProperties { - status: FormControl, - } - export function CreateDVAPaymentReportResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface DVAProcessingReportResponseType { - claimAssessment?: DVAClaimAssessmentType; - status: string; - } - export interface DVAProcessingReportResponseTypeFormProperties { - status: FormControl, - } - export function CreateDVAProcessingReportResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface DVAClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - export interface DVAClaimAssessmentTypeFormProperties { - benefitPaid: FormControl, - chargeAmount: FormControl, - claimId: FormControl, - } - export function CreateDVAClaimAssessmentTypeFormGroup() { - return new FormGroup({ - benefitPaid: new FormControl(undefined), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - claimId: new FormControl(undefined), - }); - - } - - export interface DVAMedicalEventAssessmentType { - patient?: VeteranMembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - export interface DVAMedicalEventAssessmentTypeFormProperties { - id: FormControl, - eventDate: FormControl, - } - export function CreateDVAMedicalEventAssessmentTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - eventDate: new FormControl(undefined), - }); - - } - - export interface VeteranMembershipStatusType { - currentMembership?: VeteranMembershipResponseType; - currentMember?: IdentityType; - status?: StatusType; - processDate?: Date | null; - } - export interface VeteranMembershipStatusTypeFormProperties { - processDate: FormControl, - } - export function CreateVeteranMembershipStatusTypeFormGroup() { - return new FormGroup({ - processDate: new FormControl(undefined), - }); - - } - - export interface DVAServiceAssessmentType { - id?: string | null; - accountReferenceNumber?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - gstInd?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - export interface DVAServiceAssessmentTypeFormProperties { - id: FormControl, - accountReferenceNumber: FormControl, - assessmentCode: FormControl, - benefitPaid: FormControl, - chargeAmount: FormControl, - gstInd: FormControl, - itemNumber: FormControl, - numberOfPatientsSeen: FormControl, - } - export function CreateDVAServiceAssessmentTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - accountReferenceNumber: new FormControl(undefined), - assessmentCode: new FormControl(undefined), - benefitPaid: new FormControl(undefined), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - gstInd: new FormControl(undefined), - itemNumber: new FormControl(undefined), - numberOfPatientsSeen: new FormControl(undefined), - }); - - } - - export interface VeteranMembershipResponseType extends VeteranMembershipType { - entitlementCode?: string | null; - } - export interface VeteranMembershipResponseTypeFormProperties extends VeteranMembershipTypeFormProperties { - entitlementCode: FormControl, - } - export function CreateVeteranMembershipResponseTypeFormGroup() { - return new FormGroup({ - veteranNumber: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(9)]), - entitlementCode: new FormControl(undefined), - }); - - } - - export interface EnterpriseConcessionVerificationRequestType { - timeout?: number | null; - concessionVerificationRequest: Array; - } - export interface EnterpriseConcessionVerificationRequestTypeFormProperties { - timeout: FormControl, - } - export function CreateEnterpriseConcessionVerificationRequestTypeFormGroup() { - return new FormGroup({ - timeout: new FormControl(undefined), - }); - - } - - export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { - id: string; - } - export interface ReferenceConcessionVerificationRequestTypeFormProperties extends ConcessionVerificationRequestTypeFormProperties { - id: FormControl, - } - export function CreateReferenceConcessionVerificationRequestTypeFormGroup() { - return new FormGroup({ - dateOfService: new FormControl(undefined), - id: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface ConcessionVerificationRequestType { - patient: MedicarePatientType; - dateOfService?: Date | null; - } - export interface ConcessionVerificationRequestTypeFormProperties { - dateOfService: FormControl, - } - export function CreateConcessionVerificationRequestTypeFormGroup() { - return new FormGroup({ - dateOfService: new FormControl(undefined), - }); - - } - - export interface EnterpriseConcessionVerificationResponseType { - status: string; - concessionVerificationResponse?: Array; - } - export interface EnterpriseConcessionVerificationResponseTypeFormProperties { - status: FormControl, - } - export function CreateEnterpriseConcessionVerificationResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { - id: string; - } - export interface ReferenceConcessionVerificationResponseTypeFormProperties extends ConcessionVerificationResponseTypeFormProperties { - id: FormControl, - } - export function CreateReferenceConcessionVerificationResponseTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface ConcessionVerificationResponseType { - medicareStatus: MembershipStatusType; - concessionStatus: ConcessionStatusType; - } - export interface ConcessionVerificationResponseTypeFormProperties { - } - export function CreateConcessionVerificationResponseTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface ConcessionStatusType { - status?: StatusType; - processDate?: Date | null; - } - export interface ConcessionStatusTypeFormProperties { - processDate: FormControl, - } - export function CreateConcessionStatusTypeFormGroup() { - return new FormGroup({ - processDate: new FormControl(undefined), - }); - - } - - export interface EnterprisePatientVerificationRequestType { - timeout?: number | null; - patientVerificationRequest: Array; - } - export interface EnterprisePatientVerificationRequestTypeFormProperties { - timeout: FormControl, - } - export function CreateEnterprisePatientVerificationRequestTypeFormGroup() { - return new FormGroup({ - timeout: new FormControl(undefined), - }); - - } - - export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { - id: string; - } - export interface ReferencePatientVerificationRequestTypeFormProperties extends PatientVerificationRequestTypeFormProperties { - id: FormControl, - } - export function CreateReferencePatientVerificationRequestTypeFormGroup() { - return new FormGroup({ - dateOfService: new FormControl(undefined), - typeCode: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(3)]), - id: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface PatientVerificationRequestType { - patient: FundPatientType; - provider?: ProviderType; - dateOfService?: Date | null; - typeCode: string; - } - export interface PatientVerificationRequestTypeFormProperties { - dateOfService: FormControl, - typeCode: FormControl, - } - export function CreatePatientVerificationRequestTypeFormGroup() { - return new FormGroup({ - dateOfService: new FormControl(undefined), - typeCode: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(3)]), - }); - - } - - export interface FundPatientType extends PatientType { - alsoKnownAs?: IdentityType; - medicare?: MembershipType; - healthFund?: FundMembershipType; - } - export interface FundPatientTypeFormProperties extends PatientTypeFormProperties { - } - export function CreateFundPatientTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface FundMembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - organisation?: string | null; - } - export interface FundMembershipTypeFormProperties { - memberNumber: FormControl, - memberRefNumber: FormControl, - organisation: FormControl, - } - export function CreateFundMembershipTypeFormGroup() { - return new FormGroup({ - memberNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(19)]), - memberRefNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - organisation: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), - }); - - } - - export interface EnterprisePatientVerificationResponseType { - status: string; - patientVerificationResponse?: Array; - } - export interface EnterprisePatientVerificationResponseTypeFormProperties { - status: FormControl, - } - export function CreateEnterprisePatientVerificationResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { - id: string; - } - export interface ReferencePatientVerificationResponseTypeFormProperties extends PatientVerificationResponseTypeFormProperties { - id: FormControl, - } - export function CreateReferencePatientVerificationResponseTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface PatientVerificationResponseType { - medicareStatus?: MembershipStatusType; - healthFundStatus?: FundMembershipStatusType; - } - export interface PatientVerificationResponseTypeFormProperties { - } - export function CreatePatientVerificationResponseTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface FundMembershipStatusType { - status?: StatusType; - currentMembership?: FundMembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - export interface FundMembershipStatusTypeFormProperties { - processDate: FormControl, - } - export function CreateFundMembershipStatusTypeFormGroup() { - return new FormGroup({ - processDate: new FormControl(undefined), - }); - - } - - export interface EnterpriseVeteranVerificationRequestType { - timeout?: number | null; - veteranVerificationRequest: Array; - } - export interface EnterpriseVeteranVerificationRequestTypeFormProperties { - timeout: FormControl, - } - export function CreateEnterpriseVeteranVerificationRequestTypeFormGroup() { - return new FormGroup({ - timeout: new FormControl(undefined), - }); - - } - - export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { - id: string; - } - export interface ReferenceVeteranVerificationRequestTypeFormProperties extends VeteranVerificationRequestTypeFormProperties { - id: FormControl, - } - export function CreateReferenceVeteranVerificationRequestTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface VeteranVerificationRequestType { - patient: VeteranPatientType; - } - export interface VeteranVerificationRequestTypeFormProperties { - } - export function CreateVeteranVerificationRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface EnterpriseVeteranVerificationResponseType { - status: string; - veteranVerificationResponse?: Array; - } - export interface EnterpriseVeteranVerificationResponseTypeFormProperties { - status: FormControl, - } - export function CreateEnterpriseVeteranVerificationResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { - id?: string | null; - } - export interface ReferenceVeteranVerificationResponseTypeFormProperties extends VeteranVerificationResponseTypeFormProperties { - id: FormControl, - } - export function CreateReferenceVeteranVerificationResponseTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - }); - - } - - export interface VeteranVerificationResponseType { - veteranStatus?: VeteranMembershipStatusType; - } - export interface VeteranVerificationResponseTypeFormProperties { - } - export function CreateVeteranVerificationResponseTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface PatientClaimInteractiveRequestType { - patientClaimInteractive: PatientClaimInteractiveType; - } - export interface PatientClaimInteractiveRequestTypeFormProperties { - } - export function CreatePatientClaimInteractiveRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface PatientClaimInteractiveType { - patient: MedicarePatientType; - referral?: ReferralType; - claimant: ClaimantType; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - referralOverrideCode?: string | null; - accountPaidInd: string; - accountReferenceId?: string | null; - submissionAuthorityInd: string; - authorisationDate: Date; - } - export interface PatientClaimInteractiveTypeFormProperties { - referralOverrideCode: FormControl, - accountPaidInd: FormControl, - accountReferenceId: FormControl, - submissionAuthorityInd: FormControl, - authorisationDate: FormControl, - } - export function CreatePatientClaimInteractiveTypeFormGroup() { - return new FormGroup({ - referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - accountPaidInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - accountReferenceId: new FormControl(undefined), - submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), - authorisationDate: CreateDateOnlyFormControl(), - }); - - } - - export interface PCIMedicalEventType { - service: Array; - id: string; - medicalEventDate: Date; - medicalEventTime?: string | null; - } - export interface PCIMedicalEventTypeFormProperties { - id: FormControl, - medicalEventDate: FormControl, - medicalEventTime: FormControl, - } - export function CreatePCIMedicalEventTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), - medicalEventDate: CreateDateOnlyFormControl(), - medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), - }); - - } - - export interface PCIServiceType extends ServiceType { - patientContribAmount?: string | null; - facilityId?: string | null; - hospitalInd?: string | null; - } - export interface PCIServiceTypeFormProperties extends ServiceTypeFormProperties { - patientContribAmount: FormControl, - facilityId: FormControl, - hospitalInd: FormControl, - } - export function CreatePCIServiceTypeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), - accessionDateTime: new FormControl(undefined), - aftercareOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), - collectionDateTime: new FormControl(undefined), - duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - fieldQuantity: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - itemNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), - lspNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), - multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), - rule3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - s4b3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - scpId: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(5)]), - selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), - text: new FormControl(undefined), - timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), - patientContribAmount: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(7)]), - facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), - hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), - }); - - } - - export interface ClaimantType extends MedicarePatientType { - eftDetails?: BankAccountType; - residentialAddress?: AddressType; - contactDetails?: ContactType; - } - export interface ClaimantTypeFormProperties extends MedicarePatientTypeFormProperties { - } - export function CreateClaimantTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface ContactType { - emailAddress?: string | null; - name?: string | null; - phoneNumber?: string | null; - } - export interface ContactTypeFormProperties { - emailAddress: FormControl, - name: FormControl, - phoneNumber: FormControl, - } - export function CreateContactTypeFormGroup() { - return new FormGroup({ - emailAddress: new FormControl(undefined, [Validators.minLength(5), Validators.maxLength(128)]), - name: new FormControl(undefined), - phoneNumber: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(19)]), - }); - - } - - export interface PatientClaimInteractiveResponseType { - claimAssessment: PCIAssessmentType; - status: string; - } - export interface PatientClaimInteractiveResponseTypeFormProperties { - status: FormControl, - } - export function CreatePatientClaimInteractiveResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface PCIAssessmentType { - claimant?: CurrentMembershipType; - patient?: CurrentMembershipType; - medicalEvent?: Array; - error?: StatusType; - claimId: string; - } - export interface PCIAssessmentTypeFormProperties { - claimId: FormControl, - } - export function CreatePCIAssessmentTypeFormGroup() { - return new FormGroup({ - claimId: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface CurrentMembershipType { - currentMembership: MembershipType; - } - export interface CurrentMembershipTypeFormProperties { - } - export function CreateCurrentMembershipTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface PCIMedicalEventResponseType { - service?: Array; - eventDate?: Date | null; - id?: string | null; - } - export interface PCIMedicalEventResponseTypeFormProperties { - eventDate: FormControl, - id: FormControl, - } - export function CreatePCIMedicalEventResponseTypeFormGroup() { - return new FormGroup({ - eventDate: new FormControl(undefined), - id: new FormControl(undefined), - }); - - } - - export interface RetrieveReportRequestType { - transactionId: Array; - } - export interface RetrieveReportRequestTypeFormProperties { - } - export function CreateRetrieveReportRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface RetrieveReportResponseType { - content?: Array; - } - export interface RetrieveReportResponseTypeFormProperties { - } - export function CreateRetrieveReportResponseTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface ContentType { - transactionId?: string | null; - status?: string | null; - } - export interface ContentTypeFormProperties { - transactionId: FormControl, - status: FormControl, - } - export function CreateContentTypeFormGroup() { - return new FormGroup({ - transactionId: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export interface EnterpriseConcessionVerificationReportContentType extends ContentType { - report?: EnterpriseConcessionVerificationResponseType; - } - export interface EnterpriseConcessionVerificationReportContentTypeFormProperties extends ContentTypeFormProperties { - } - export function CreateEnterpriseConcessionVerificationReportContentTypeFormGroup() { - return new FormGroup({ - transactionId: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export interface EnterprisePatientVerificationReportContentType extends ContentType { - report?: EnterprisePatientVerificationResponseType; - } - export interface EnterprisePatientVerificationReportContentTypeFormProperties extends ContentTypeFormProperties { - } - export function CreateEnterprisePatientVerificationReportContentTypeFormGroup() { - return new FormGroup({ - transactionId: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export interface EnterpriseVeteranVerificationReportContentType extends ContentType { - report?: EnterpriseVeteranVerificationResponseType; - } - export interface EnterpriseVeteranVerificationReportContentTypeFormProperties extends ContentTypeFormProperties { - } - export function CreateEnterpriseVeteranVerificationReportContentTypeFormGroup() { - return new FormGroup({ - transactionId: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export interface SameDayDeleteRequestType { - sameDayDelete: SameDayDeleteType; - } - export interface SameDayDeleteRequestTypeFormProperties { - } - export function CreateSameDayDeleteRequestTypeFormGroup() { - return new FormGroup({ - }); - - } - - export interface SameDayDeleteType { - patient: MedicarePatientType; - reasonCode: string; - } - export interface SameDayDeleteTypeFormProperties { - reasonCode: FormControl, - } - export function CreateSameDayDeleteTypeFormGroup() { - return new FormGroup({ - reasonCode: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(3)]), - }); - - } - - export interface SameDayDeleteResponseType { - status: string; - } - export interface SameDayDeleteResponseTypeFormProperties { - status: FormControl, - } - export function CreateSameDayDeleteResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface StatusReportRequestType { - transactionId?: Array; - associateName?: string | null; - fromDateTime?: Date | null; - toDateTime?: Date | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - status?: string | null; - } - export interface StatusReportRequestTypeFormProperties { - associateName: FormControl, - fromDateTime: FormControl, - toDateTime: FormControl, - reportStatus: FormControl, - requestTransmissionType: FormControl, - status: FormControl, - } - export function CreateStatusReportRequestTypeFormGroup() { - return new FormGroup({ - associateName: new FormControl(undefined), - fromDateTime: new FormControl(undefined), - toDateTime: new FormControl(undefined), - reportStatus: new FormControl(undefined), - requestTransmissionType: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export interface StatusReportResponseType { - transactionStatus?: Array; - status: string; - } - export interface StatusReportResponseTypeFormProperties { - status: FormControl, - } - export function CreateStatusReportResponseTypeFormGroup() { - return new FormGroup({ - status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface TransactionStatusType { - associateName?: string | null; - lodgementDateTime?: Date | null; - processStatus?: string | null; - reference?: string | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - transactionId?: string | null; - } - export interface TransactionStatusTypeFormProperties { - associateName: FormControl, - lodgementDateTime: FormControl, - processStatus: FormControl, - reference: FormControl, - reportStatus: FormControl, - requestTransmissionType: FormControl, - transactionId: FormControl, - } - export function CreateTransactionStatusTypeFormGroup() { - return new FormGroup({ - associateName: new FormControl(undefined), - lodgementDateTime: new FormControl(undefined), - processStatus: new FormControl(undefined), - reference: new FormControl(undefined), - reportStatus: new FormControl(undefined), - requestTransmissionType: new FormControl(undefined), - transactionId: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This is the request - * Post mcp/bulkbillpaymentreport/v1 - * @return {BBSPaymentReportResponseType} successful operation - */ - McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillprocessingreport/v1 - * @return {BBSProcessingReportResponseType} successful operation - */ - McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/general/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/pathology/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/specialist/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/allied/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/communitynursing/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/dental/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/optical/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/psych/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/speechpathology/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaclaim/general/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaclaim/pathology/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaclaim/specialist/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvapaymentreport/v1 - * @return {DVAPaymentReportResponseType} successful operation - */ - McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaprocessingreport/v1 - * @return {DVAProcessingReportResponseType} successful operation - */ - McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/v1 - * @return {EnterpriseConcessionVerificationResponseType} successful operation - */ - McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/v1 - * @return {EnterprisePatientVerificationResponseType} successful operation - */ - McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/v1 - * @return {EnterpriseVeteranVerificationResponseType} successful operation - */ - McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/general/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/pathology/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/specialist/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientverification/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientverification/hf/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientverification/medicare/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/samedaydelete/v1 - * @return {SameDayDeleteResponseType} successful operation - */ - McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/statusreport/v1 - * @return {StatusReportResponseType} successful operation - */ - McpStatusReport1Eigw(requestBody: StatusReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/veteranverification/v1 - * @return {VeteranVerificationResponseType} successful operation - */ - McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface BBSReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + export interface BBSReportRequestTypeFormProperties { + claimId: FormControl, + lodgementDate: FormControl, + } + export function CreateBBSReportRequestTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.minLength(6), Validators.maxLength(6)]), + lodgementDate: CreateDateOnlyFormControl(), + }); + + } + + export interface ProviderType { + providerNumber: string; + } + export interface ProviderTypeFormProperties { + providerNumber: FormControl, + } + export function CreateProviderTypeFormGroup() { + return new FormGroup({ + providerNumber: new FormControl(undefined, [Validators.required, Validators.minLength(8), Validators.maxLength(8)]), + }); + + } + + export interface BBSPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + export interface BBSPaymentReportResponseTypeFormProperties { + status: FormControl, + } + export function CreateBBSPaymentReportResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface PaymentRunType { + payerName?: string | null; + runDate?: Date | null; + runNumber?: string | null; + } + export interface PaymentRunTypeFormProperties { + payerName: FormControl, + runDate: FormControl, + runNumber: FormControl, + } + export function CreatePaymentRunTypeFormGroup() { + return new FormGroup({ + payerName: new FormControl(undefined), + runDate: CreateDateOnlyFormControl(), + runNumber: new FormControl(undefined), + }); + + } + + export interface PaymentType { + accountInfo: BankAccountType; + depositAmount?: string | null; + paymentReference?: string | null; + } + export interface PaymentTypeFormProperties { + depositAmount: FormControl, + paymentReference: FormControl, + } + export function CreatePaymentTypeFormGroup() { + return new FormGroup({ + depositAmount: new FormControl(undefined), + paymentReference: new FormControl(undefined), + }); + + } + + export interface BankAccountType { + accountName?: string | null; + accountNumber?: string | null; + bsbCode?: string | null; + } + export interface BankAccountTypeFormProperties { + accountName: FormControl, + accountNumber: FormControl, + bsbCode: FormControl, + } + export function CreateBankAccountTypeFormGroup() { + return new FormGroup({ + accountName: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(30)]), + accountNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + bsbCode: new FormControl(undefined, [Validators.minLength(6), Validators.maxLength(6)]), + }); + + } + + export interface ClaimSummaryType { + accountReferenceId?: string | null; + benefit?: string | null; + chargeAmount?: string | null; + claimChannelCode?: string | null; + claimId?: string | null; + lodgementDate?: Date | null; + transactionId?: string | null; + } + export interface ClaimSummaryTypeFormProperties { + accountReferenceId: FormControl, + benefit: FormControl, + chargeAmount: FormControl, + claimChannelCode: FormControl, + claimId: FormControl, + lodgementDate: FormControl, + transactionId: FormControl, + } + export function CreateClaimSummaryTypeFormGroup() { + return new FormGroup({ + accountReferenceId: new FormControl(undefined), + benefit: new FormControl(undefined), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + claimChannelCode: new FormControl(undefined), + claimId: new FormControl(undefined), + lodgementDate: CreateDateOnlyFormControl(), + transactionId: new FormControl(undefined), + }); + + } + + export interface ServiceMessagesType { + highestSeverity: ServiceMessagesTypeHighestSeverity; + serviceMessage: Array; + } + export interface ServiceMessagesTypeFormProperties { + highestSeverity: FormControl, + } + export function CreateServiceMessagesTypeFormGroup() { + return new FormGroup({ + highestSeverity: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } + + export interface ServiceMessageType { + code: string; + severity: ServiceMessagesTypeHighestSeverity; + reason: string; + } + export interface ServiceMessageTypeFormProperties { + code: FormControl, + severity: FormControl, + reason: FormControl, + } + export function CreateServiceMessageTypeFormGroup() { + return new FormGroup({ + code: new FormControl(undefined, [Validators.required]), + severity: new FormControl(undefined, [Validators.required]), + reason: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface BBSProcessingReportResponseType { + claimAssessment?: ClaimAssessmentType; + status: string; + } + export interface BBSProcessingReportResponseTypeFormProperties { + status: FormControl, + } + export function CreateBBSProcessingReportResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface ClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + export interface ClaimAssessmentTypeFormProperties { + benefitPaid: FormControl, + chargeAmount: FormControl, + claimId: FormControl, + } + export function CreateClaimAssessmentTypeFormGroup() { + return new FormGroup({ + benefitPaid: new FormControl(undefined), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + claimId: new FormControl(undefined), + }); + + } + + export interface MedicalEventResponseType { + patient?: MembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + export interface MedicalEventResponseTypeFormProperties { + id: FormControl, + eventDate: FormControl, + } + export function CreateMedicalEventResponseTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + eventDate: CreateDateOnlyFormControl(), + }); + + } + + export interface MembershipStatusType { + status?: StatusType; + currentMembership?: MembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + export interface MembershipStatusTypeFormProperties { + processDate: FormControl, + } + export function CreateMembershipStatusTypeFormGroup() { + return new FormGroup({ + processDate: CreateDateOnlyFormControl(), + }); + + } + + export interface StatusType { + code?: number | null; + text?: string | null; + } + export interface StatusTypeFormProperties { + code: FormControl, + text: FormControl, + } + export function CreateStatusTypeFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + text: new FormControl(undefined), + }); + + } + + export interface MembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + } + export interface MembershipTypeFormProperties { + memberNumber: FormControl, + memberRefNumber: FormControl, + } + export function CreateMembershipTypeFormGroup() { + return new FormGroup({ + memberNumber: new FormControl(undefined, [Validators.minLength(10), Validators.maxLength(10)]), + memberRefNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface IdentityType { + dateOfBirth?: Date | null; + familyName?: string | null; + givenName?: string | null; + secondInitial?: string | null; + sex?: string | null; + } + export interface IdentityTypeFormProperties { + dateOfBirth: FormControl, + familyName: FormControl, + givenName: FormControl, + secondInitial: FormControl, + sex: FormControl, + } + export function CreateIdentityTypeFormGroup() { + return new FormGroup({ + dateOfBirth: CreateDateOnlyFormControl(), + familyName: new FormControl(undefined), + givenName: new FormControl(undefined), + secondInitial: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + sex: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface ServiceResponseType { + error?: StatusType; + id?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + export interface ServiceResponseTypeFormProperties { + id: FormControl, + assessmentCode: FormControl, + benefitPaid: FormControl, + chargeAmount: FormControl, + itemNumber: FormControl, + numberOfPatientsSeen: FormControl, + } + export function CreateServiceResponseTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + assessmentCode: new FormControl(undefined), + benefitPaid: new FormControl(undefined), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + itemNumber: new FormControl(undefined), + numberOfPatientsSeen: new FormControl(undefined), + }); + + } + + export interface BulkBillStoreForwardRequestType { + claim: BulkBillClaimStoreForwardClaimType; + } + export interface BulkBillStoreForwardRequestTypeFormProperties { + } + export function CreateBulkBillStoreForwardRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface BulkBillClaimStoreForwardClaimType { + facilityId?: string | null; + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + export interface BulkBillClaimStoreForwardClaimTypeFormProperties { + facilityId: FormControl, + hospitalInd: FormControl, + serviceTypeCode: FormControl, + } + export function CreateBulkBillClaimStoreForwardClaimTypeFormGroup() { + return new FormGroup({ + facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + serviceTypeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface BBSMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + medicalEventDate: Date; + medicalEventTime?: string | null; + patient: MedicarePatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + service: Array; + submissionAuthorityInd: string; + } + export interface BBSMedicalEventTypeFormProperties { + id: FormControl, + authorisationDate: FormControl, + createDateTime: FormControl, + medicalEventDate: FormControl, + medicalEventTime: FormControl, + referralOverrideCode: FormControl, + submissionAuthorityInd: FormControl, + } + export function CreateBBSMedicalEventTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), + authorisationDate: CreateDateOnlyFormControl(), + createDateTime: new FormControl(undefined, [Validators.required]), + medicalEventDate: CreateDateOnlyFormControl(), + medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), + referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface MedicarePatientType { + identity: IdentityType; + medicare: MembershipType; + } + export interface MedicarePatientTypeFormProperties { + } + export function CreateMedicarePatientTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface ReferralType { + issueDate: Date; + period?: string | null; + periodCode?: string | null; + provider: ProviderType; + typeCode: string; + } + export interface ReferralTypeFormProperties { + issueDate: FormControl, + period: FormControl, + periodCode: FormControl, + typeCode: FormControl, + } + export function CreateReferralTypeFormGroup() { + return new FormGroup({ + issueDate: CreateDateOnlyFormControl(), + period: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + periodCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + typeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface ServiceType { + id: string; + accessionDateTime?: Date | null; + aftercareOverrideInd?: string | null; + chargeAmount?: string | null; + collectionDateTime?: Date | null; + duplicateServiceOverrideInd?: string | null; + fieldQuantity?: string | null; + itemNumber?: string | null; + lspNumber?: string | null; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + restrictiveOverrideCode?: string | null; + rule3ExemptInd?: string | null; + s4b3ExemptInd?: string | null; + scpId?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + } + export interface ServiceTypeFormProperties { + id: FormControl, + accessionDateTime: FormControl, + aftercareOverrideInd: FormControl, + chargeAmount: FormControl, + collectionDateTime: FormControl, + duplicateServiceOverrideInd: FormControl, + fieldQuantity: FormControl, + itemNumber: FormControl, + lspNumber: FormControl, + multipleProcedureOverrideInd: FormControl, + numberOfPatientsSeen: FormControl, + restrictiveOverrideCode: FormControl, + rule3ExemptInd: FormControl, + s4b3ExemptInd: FormControl, + scpId: FormControl, + selfDeemedCode: FormControl, + text: FormControl, + timeDuration: FormControl, + } + export function CreateServiceTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + accessionDateTime: new FormControl(undefined), + aftercareOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + collectionDateTime: new FormControl(undefined), + duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + fieldQuantity: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + itemNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), + lspNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), + multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), + rule3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + s4b3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + scpId: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(5)]), + selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + text: new FormControl(undefined), + timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), + }); + + } + + export interface BulkBillStoreForwardResponseType { + claimId: string; + status: string; + } + export interface BulkBillStoreForwardResponseTypeFormProperties { + claimId: FormControl, + status: FormControl, + } + export function CreateBulkBillStoreForwardResponseTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface AlliedHealthClaimRequestType { + claim: VAAClaimType; + } + export interface AlliedHealthClaimRequestTypeFormProperties { + } + export function CreateAlliedHealthClaimRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface VAAClaimType { + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + export interface VAAClaimTypeFormProperties { + hospitalInd: FormControl, + serviceTypeCode: FormControl, + } + export function CreateVAAClaimTypeFormGroup() { + return new FormGroup({ + hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + serviceTypeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface VAAMedicalEventType { + id: string; + acceptedDisability?: AcceptedDisabilityType; + authorisationDate: Date; + breakInEpisodeEndDate?: Date | null; + breakInEpisodeOfCareNumber?: string | null; + breakInEpisodeStartDate?: Date | null; + numberOfCNCHours?: string | null; + numberOfCNCVisits?: string | null; + createDateTime: Date; + numberOfENHours?: string | null; + numberOfENVisits?: string | null; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + numberOfNSSHours?: string | null; + numberOfNSSVisits?: string | null; + patient: VeteranPatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + numberOfRNHours?: string | null; + numberOfRNVisits?: string | null; + service: Array; + submissionAuthorityInd: string; + } + export interface VAAMedicalEventTypeFormProperties { + id: FormControl, + authorisationDate: FormControl, + breakInEpisodeEndDate: FormControl, + breakInEpisodeOfCareNumber: FormControl, + breakInEpisodeStartDate: FormControl, + numberOfCNCHours: FormControl, + numberOfCNCVisits: FormControl, + createDateTime: FormControl, + numberOfENHours: FormControl, + numberOfENVisits: FormControl, + facilityId: FormControl, + medicalEventDate: FormControl, + medicalEventTime: FormControl, + numberOfNSSHours: FormControl, + numberOfNSSVisits: FormControl, + referralOverrideCode: FormControl, + numberOfRNHours: FormControl, + numberOfRNVisits: FormControl, + submissionAuthorityInd: FormControl, + } + export function CreateVAAMedicalEventTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), + authorisationDate: CreateDateOnlyFormControl(), + breakInEpisodeEndDate: CreateDateOnlyFormControl(), + breakInEpisodeOfCareNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + breakInEpisodeStartDate: CreateDateOnlyFormControl(), + numberOfCNCHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), + numberOfCNCVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + createDateTime: new FormControl(undefined, [Validators.required]), + numberOfENHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), + numberOfENVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + medicalEventDate: CreateDateOnlyFormControl(), + medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), + numberOfNSSHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), + numberOfNSSVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + numberOfRNHours: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), + numberOfRNVisits: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(3)]), + submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface AcceptedDisabilityType { + code: string; + ind: string; + } + export interface AcceptedDisabilityTypeFormProperties { + code: FormControl, + ind: FormControl, + } + export function CreateAcceptedDisabilityTypeFormGroup() { + return new FormGroup({ + code: new FormControl(undefined, [Validators.required]), + ind: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface VAAServiceType { + id: string; + accountReferenceNumber?: string | null; + admissionDate?: Date | null; + chargeAmount?: string | null; + dischargeDate?: Date | null; + distanceKilometres?: number | null; + duplicateServiceOverrideInd?: string | null; + itemNumber: string; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + numberOfTeeth?: string | null; + opticalScriptCode?: string | null; + restrictiveOverrideCode?: string | null; + secondDeviceInd?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + toothNumber?: string | null; + upperLowerJawCode?: string | null; + } + export interface VAAServiceTypeFormProperties { + id: FormControl, + accountReferenceNumber: FormControl, + admissionDate: FormControl, + chargeAmount: FormControl, + dischargeDate: FormControl, + distanceKilometres: FormControl, + duplicateServiceOverrideInd: FormControl, + itemNumber: FormControl, + multipleProcedureOverrideInd: FormControl, + numberOfPatientsSeen: FormControl, + numberOfTeeth: FormControl, + opticalScriptCode: FormControl, + restrictiveOverrideCode: FormControl, + secondDeviceInd: FormControl, + selfDeemedCode: FormControl, + text: FormControl, + timeDuration: FormControl, + toothNumber: FormControl, + upperLowerJawCode: FormControl, + } + export function CreateVAAServiceTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + accountReferenceNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(8)]), + admissionDate: CreateDateOnlyFormControl(), + chargeAmount: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(7)]), + dischargeDate: CreateDateOnlyFormControl(), + distanceKilometres: new FormControl(undefined), + duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + itemNumber: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(5)]), + multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + numberOfTeeth: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + opticalScriptCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), + secondDeviceInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + text: new FormControl(undefined), + timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), + toothNumber: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), + upperLowerJawCode: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), + }); + + } + + export interface VeteranPatientType extends PatientType { + veteranMembership?: VeteranMembershipType; + } + export interface VeteranPatientTypeFormProperties extends PatientTypeFormProperties { + } + export function CreateVeteranPatientTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface VeteranMembershipType { + veteranNumber: string; + } + export interface VeteranMembershipTypeFormProperties { + veteranNumber: FormControl, + } + export function CreateVeteranMembershipTypeFormGroup() { + return new FormGroup({ + veteranNumber: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(9)]), + }); + + } + + export interface PatientType { + identity: IdentityType; + residentialAddress?: AddressType; + } + export interface PatientTypeFormProperties { + } + export function CreatePatientTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postcode?: string | null; + } + export interface AddressTypeFormProperties { + addressLineOne: FormControl, + addressLineTwo: FormControl, + locality: FormControl, + postcode: FormControl, + } + export function CreateAddressTypeFormGroup() { + return new FormGroup({ + addressLineOne: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), + addressLineTwo: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), + locality: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(40)]), + postcode: new FormControl(undefined, [Validators.minLength(4), Validators.maxLength(4)]), + }); + + } + + export interface AlliedHealthClaimResponseType { + claimId: string; + status: string; + } + export interface AlliedHealthClaimResponseTypeFormProperties { + claimId: FormControl, + status: FormControl, + } + export function CreateAlliedHealthClaimResponseTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface DVAClaimRequestType { + claim: DVAClaimType; + } + export interface DVAClaimRequestTypeFormProperties { + } + export function CreateDVAClaimRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface DVAClaimType { + hospitalInd?: string | null; + serviceTypeCode: string; + medicalEvent: Array; + serviceProvider: ProviderType; + payeeProvider?: ProviderType; + } + export interface DVAClaimTypeFormProperties { + hospitalInd: FormControl, + serviceTypeCode: FormControl, + } + export function CreateDVAClaimTypeFormGroup() { + return new FormGroup({ + hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + serviceTypeCode: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface DVAMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + referralOverrideCode?: string | null; + submissionAuthorityInd: string; + treatmentLocationCode?: string | null; + acceptedDisability?: AcceptedDisabilityType; + referral?: ReferralType; + patient: VeteranPatientType; + service: Array; + } + export interface DVAMedicalEventTypeFormProperties { + id: FormControl, + authorisationDate: FormControl, + createDateTime: FormControl, + facilityId: FormControl, + medicalEventDate: FormControl, + medicalEventTime: FormControl, + referralOverrideCode: FormControl, + submissionAuthorityInd: FormControl, + treatmentLocationCode: FormControl, + } + export function CreateDVAMedicalEventTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), + authorisationDate: CreateDateOnlyFormControl(), + createDateTime: new FormControl(undefined, [Validators.required]), + facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + medicalEventDate: CreateDateOnlyFormControl(), + medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), + referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + treatmentLocationCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface DVAServiceType extends ServiceType { + accountReferenceNumber?: string | null; + distanceKilometres?: number | null; + } + export interface DVAServiceTypeFormProperties extends ServiceTypeFormProperties { + accountReferenceNumber: FormControl, + distanceKilometres: FormControl, + } + export function CreateDVAServiceTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + accessionDateTime: new FormControl(undefined), + aftercareOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + collectionDateTime: new FormControl(undefined), + duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + fieldQuantity: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + itemNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), + lspNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), + multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), + rule3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + s4b3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + scpId: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(5)]), + selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + text: new FormControl(undefined), + timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), + accountReferenceNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(8)]), + distanceKilometres: new FormControl(undefined), + }); + + } + + export interface DVAClaimResponseType { + claimId: string; + status: string; + } + export interface DVAClaimResponseTypeFormProperties { + claimId: FormControl, + status: FormControl, + } + export function CreateDVAClaimResponseTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface DVAReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + export interface DVAReportRequestTypeFormProperties { + claimId: FormControl, + lodgementDate: FormControl, + } + export function CreateDVAReportRequestTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.minLength(6), Validators.maxLength(6)]), + lodgementDate: CreateDateOnlyFormControl(), + }); + + } + + export interface DVAPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + export interface DVAPaymentReportResponseTypeFormProperties { + status: FormControl, + } + export function CreateDVAPaymentReportResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface DVAProcessingReportResponseType { + claimAssessment?: DVAClaimAssessmentType; + status: string; + } + export interface DVAProcessingReportResponseTypeFormProperties { + status: FormControl, + } + export function CreateDVAProcessingReportResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface DVAClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + export interface DVAClaimAssessmentTypeFormProperties { + benefitPaid: FormControl, + chargeAmount: FormControl, + claimId: FormControl, + } + export function CreateDVAClaimAssessmentTypeFormGroup() { + return new FormGroup({ + benefitPaid: new FormControl(undefined), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + claimId: new FormControl(undefined), + }); + + } + + export interface DVAMedicalEventAssessmentType { + patient?: VeteranMembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + export interface DVAMedicalEventAssessmentTypeFormProperties { + id: FormControl, + eventDate: FormControl, + } + export function CreateDVAMedicalEventAssessmentTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + eventDate: CreateDateOnlyFormControl(), + }); + + } + + export interface VeteranMembershipStatusType { + currentMembership?: VeteranMembershipResponseType; + currentMember?: IdentityType; + status?: StatusType; + processDate?: Date | null; + } + export interface VeteranMembershipStatusTypeFormProperties { + processDate: FormControl, + } + export function CreateVeteranMembershipStatusTypeFormGroup() { + return new FormGroup({ + processDate: CreateDateOnlyFormControl(), + }); + + } + + export interface DVAServiceAssessmentType { + id?: string | null; + accountReferenceNumber?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + gstInd?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + export interface DVAServiceAssessmentTypeFormProperties { + id: FormControl, + accountReferenceNumber: FormControl, + assessmentCode: FormControl, + benefitPaid: FormControl, + chargeAmount: FormControl, + gstInd: FormControl, + itemNumber: FormControl, + numberOfPatientsSeen: FormControl, + } + export function CreateDVAServiceAssessmentTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + accountReferenceNumber: new FormControl(undefined), + assessmentCode: new FormControl(undefined), + benefitPaid: new FormControl(undefined), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + gstInd: new FormControl(undefined), + itemNumber: new FormControl(undefined), + numberOfPatientsSeen: new FormControl(undefined), + }); + + } + + export interface VeteranMembershipResponseType extends VeteranMembershipType { + entitlementCode?: string | null; + } + export interface VeteranMembershipResponseTypeFormProperties extends VeteranMembershipTypeFormProperties { + entitlementCode: FormControl, + } + export function CreateVeteranMembershipResponseTypeFormGroup() { + return new FormGroup({ + veteranNumber: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(9)]), + entitlementCode: new FormControl(undefined), + }); + + } + + export interface EnterpriseConcessionVerificationRequestType { + timeout?: number | null; + concessionVerificationRequest: Array; + } + export interface EnterpriseConcessionVerificationRequestTypeFormProperties { + timeout: FormControl, + } + export function CreateEnterpriseConcessionVerificationRequestTypeFormGroup() { + return new FormGroup({ + timeout: new FormControl(undefined), + }); + + } + + export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { + id: string; + } + export interface ReferenceConcessionVerificationRequestTypeFormProperties extends ConcessionVerificationRequestTypeFormProperties { + id: FormControl, + } + export function CreateReferenceConcessionVerificationRequestTypeFormGroup() { + return new FormGroup({ + dateOfService: CreateDateOnlyFormControl(), + id: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface ConcessionVerificationRequestType { + patient: MedicarePatientType; + dateOfService?: Date | null; + } + export interface ConcessionVerificationRequestTypeFormProperties { + dateOfService: FormControl, + } + export function CreateConcessionVerificationRequestTypeFormGroup() { + return new FormGroup({ + dateOfService: CreateDateOnlyFormControl(), + }); + + } + + export interface EnterpriseConcessionVerificationResponseType { + status: string; + concessionVerificationResponse?: Array; + } + export interface EnterpriseConcessionVerificationResponseTypeFormProperties { + status: FormControl, + } + export function CreateEnterpriseConcessionVerificationResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { + id: string; + } + export interface ReferenceConcessionVerificationResponseTypeFormProperties extends ConcessionVerificationResponseTypeFormProperties { + id: FormControl, + } + export function CreateReferenceConcessionVerificationResponseTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface ConcessionVerificationResponseType { + medicareStatus: MembershipStatusType; + concessionStatus: ConcessionStatusType; + } + export interface ConcessionVerificationResponseTypeFormProperties { + } + export function CreateConcessionVerificationResponseTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface ConcessionStatusType { + status?: StatusType; + processDate?: Date | null; + } + export interface ConcessionStatusTypeFormProperties { + processDate: FormControl, + } + export function CreateConcessionStatusTypeFormGroup() { + return new FormGroup({ + processDate: CreateDateOnlyFormControl(), + }); + + } + + export interface EnterprisePatientVerificationRequestType { + timeout?: number | null; + patientVerificationRequest: Array; + } + export interface EnterprisePatientVerificationRequestTypeFormProperties { + timeout: FormControl, + } + export function CreateEnterprisePatientVerificationRequestTypeFormGroup() { + return new FormGroup({ + timeout: new FormControl(undefined), + }); + + } + + export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { + id: string; + } + export interface ReferencePatientVerificationRequestTypeFormProperties extends PatientVerificationRequestTypeFormProperties { + id: FormControl, + } + export function CreateReferencePatientVerificationRequestTypeFormGroup() { + return new FormGroup({ + dateOfService: CreateDateOnlyFormControl(), + typeCode: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(3)]), + id: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface PatientVerificationRequestType { + patient: FundPatientType; + provider?: ProviderType; + dateOfService?: Date | null; + typeCode: string; + } + export interface PatientVerificationRequestTypeFormProperties { + dateOfService: FormControl, + typeCode: FormControl, + } + export function CreatePatientVerificationRequestTypeFormGroup() { + return new FormGroup({ + dateOfService: CreateDateOnlyFormControl(), + typeCode: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(3)]), + }); + + } + + export interface FundPatientType extends PatientType { + alsoKnownAs?: IdentityType; + medicare?: MembershipType; + healthFund?: FundMembershipType; + } + export interface FundPatientTypeFormProperties extends PatientTypeFormProperties { + } + export function CreateFundPatientTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface FundMembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + organisation?: string | null; + } + export interface FundMembershipTypeFormProperties { + memberNumber: FormControl, + memberRefNumber: FormControl, + organisation: FormControl, + } + export function CreateFundMembershipTypeFormGroup() { + return new FormGroup({ + memberNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(19)]), + memberRefNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + organisation: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), + }); + + } + + export interface EnterprisePatientVerificationResponseType { + status: string; + patientVerificationResponse?: Array; + } + export interface EnterprisePatientVerificationResponseTypeFormProperties { + status: FormControl, + } + export function CreateEnterprisePatientVerificationResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { + id: string; + } + export interface ReferencePatientVerificationResponseTypeFormProperties extends PatientVerificationResponseTypeFormProperties { + id: FormControl, + } + export function CreateReferencePatientVerificationResponseTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface PatientVerificationResponseType { + medicareStatus?: MembershipStatusType; + healthFundStatus?: FundMembershipStatusType; + } + export interface PatientVerificationResponseTypeFormProperties { + } + export function CreatePatientVerificationResponseTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface FundMembershipStatusType { + status?: StatusType; + currentMembership?: FundMembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + export interface FundMembershipStatusTypeFormProperties { + processDate: FormControl, + } + export function CreateFundMembershipStatusTypeFormGroup() { + return new FormGroup({ + processDate: CreateDateOnlyFormControl(), + }); + + } + + export interface EnterpriseVeteranVerificationRequestType { + timeout?: number | null; + veteranVerificationRequest: Array; + } + export interface EnterpriseVeteranVerificationRequestTypeFormProperties { + timeout: FormControl, + } + export function CreateEnterpriseVeteranVerificationRequestTypeFormGroup() { + return new FormGroup({ + timeout: new FormControl(undefined), + }); + + } + + export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { + id: string; + } + export interface ReferenceVeteranVerificationRequestTypeFormProperties extends VeteranVerificationRequestTypeFormProperties { + id: FormControl, + } + export function CreateReferenceVeteranVerificationRequestTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface VeteranVerificationRequestType { + patient: VeteranPatientType; + } + export interface VeteranVerificationRequestTypeFormProperties { + } + export function CreateVeteranVerificationRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface EnterpriseVeteranVerificationResponseType { + status: string; + veteranVerificationResponse?: Array; + } + export interface EnterpriseVeteranVerificationResponseTypeFormProperties { + status: FormControl, + } + export function CreateEnterpriseVeteranVerificationResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { + id?: string | null; + } + export interface ReferenceVeteranVerificationResponseTypeFormProperties extends VeteranVerificationResponseTypeFormProperties { + id: FormControl, + } + export function CreateReferenceVeteranVerificationResponseTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + }); + + } + + export interface VeteranVerificationResponseType { + veteranStatus?: VeteranMembershipStatusType; + } + export interface VeteranVerificationResponseTypeFormProperties { + } + export function CreateVeteranVerificationResponseTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface PatientClaimInteractiveRequestType { + patientClaimInteractive: PatientClaimInteractiveType; + } + export interface PatientClaimInteractiveRequestTypeFormProperties { + } + export function CreatePatientClaimInteractiveRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface PatientClaimInteractiveType { + patient: MedicarePatientType; + referral?: ReferralType; + claimant: ClaimantType; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + referralOverrideCode?: string | null; + accountPaidInd: string; + accountReferenceId?: string | null; + submissionAuthorityInd: string; + authorisationDate: Date; + } + export interface PatientClaimInteractiveTypeFormProperties { + referralOverrideCode: FormControl, + accountPaidInd: FormControl, + accountReferenceId: FormControl, + submissionAuthorityInd: FormControl, + authorisationDate: FormControl, + } + export function CreatePatientClaimInteractiveTypeFormGroup() { + return new FormGroup({ + referralOverrideCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + accountPaidInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + accountReferenceId: new FormControl(undefined), + submissionAuthorityInd: new FormControl(undefined, [Validators.required, Validators.minLength(1), Validators.maxLength(1)]), + authorisationDate: CreateDateOnlyFormControl(), + }); + + } + + export interface PCIMedicalEventType { + service: Array; + id: string; + medicalEventDate: Date; + medicalEventTime?: string | null; + } + export interface PCIMedicalEventTypeFormProperties { + id: FormControl, + medicalEventDate: FormControl, + medicalEventTime: FormControl, + } + export function CreatePCIMedicalEventTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(2), Validators.maxLength(2)]), + medicalEventDate: CreateDateOnlyFormControl(), + medicalEventTime: new FormControl(undefined, [Validators.pattern('^([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]*)?(Z|z|(([+]|-)([0-1][0-9]|2[0-3]):[0-5][0-9]))?$')]), + }); + + } + + export interface PCIServiceType extends ServiceType { + patientContribAmount?: string | null; + facilityId?: string | null; + hospitalInd?: string | null; + } + export interface PCIServiceTypeFormProperties extends ServiceTypeFormProperties { + patientContribAmount: FormControl, + facilityId: FormControl, + hospitalInd: FormControl, + } + export function CreatePCIServiceTypeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined, [Validators.required, Validators.minLength(4), Validators.maxLength(4)]), + accessionDateTime: new FormControl(undefined), + aftercareOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + chargeAmount: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(9)]), + collectionDateTime: new FormControl(undefined), + duplicateServiceOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + fieldQuantity: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + itemNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(5)]), + lspNumber: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(6)]), + multipleProcedureOverrideInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + numberOfPatientsSeen: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + restrictiveOverrideCode: new FormControl(undefined, [Validators.minLength(2), Validators.maxLength(2)]), + rule3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + s4b3ExemptInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + scpId: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(5)]), + selfDeemedCode: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(2)]), + text: new FormControl(undefined), + timeDuration: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(3)]), + patientContribAmount: new FormControl(undefined, [Validators.minLength(3), Validators.maxLength(7)]), + facilityId: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(8)]), + hospitalInd: new FormControl(undefined, [Validators.minLength(1), Validators.maxLength(1)]), + }); + + } + + export interface ClaimantType extends MedicarePatientType { + eftDetails?: BankAccountType; + residentialAddress?: AddressType; + contactDetails?: ContactType; + } + export interface ClaimantTypeFormProperties extends MedicarePatientTypeFormProperties { + } + export function CreateClaimantTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface ContactType { + emailAddress?: string | null; + name?: string | null; + phoneNumber?: string | null; + } + export interface ContactTypeFormProperties { + emailAddress: FormControl, + name: FormControl, + phoneNumber: FormControl, + } + export function CreateContactTypeFormGroup() { + return new FormGroup({ + emailAddress: new FormControl(undefined, [Validators.minLength(5), Validators.maxLength(128)]), + name: new FormControl(undefined), + phoneNumber: new FormControl(undefined, [Validators.minLength(8), Validators.maxLength(19)]), + }); + + } + + export interface PatientClaimInteractiveResponseType { + claimAssessment: PCIAssessmentType; + status: string; + } + export interface PatientClaimInteractiveResponseTypeFormProperties { + status: FormControl, + } + export function CreatePatientClaimInteractiveResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface PCIAssessmentType { + claimant?: CurrentMembershipType; + patient?: CurrentMembershipType; + medicalEvent?: Array; + error?: StatusType; + claimId: string; + } + export interface PCIAssessmentTypeFormProperties { + claimId: FormControl, + } + export function CreatePCIAssessmentTypeFormGroup() { + return new FormGroup({ + claimId: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface CurrentMembershipType { + currentMembership: MembershipType; + } + export interface CurrentMembershipTypeFormProperties { + } + export function CreateCurrentMembershipTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface PCIMedicalEventResponseType { + service?: Array; + eventDate?: Date | null; + id?: string | null; + } + export interface PCIMedicalEventResponseTypeFormProperties { + eventDate: FormControl, + id: FormControl, + } + export function CreatePCIMedicalEventResponseTypeFormGroup() { + return new FormGroup({ + eventDate: CreateDateOnlyFormControl(), + id: new FormControl(undefined), + }); + + } + + export interface RetrieveReportRequestType { + transactionId: Array; + } + export interface RetrieveReportRequestTypeFormProperties { + } + export function CreateRetrieveReportRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface RetrieveReportResponseType { + content?: Array; + } + export interface RetrieveReportResponseTypeFormProperties { + } + export function CreateRetrieveReportResponseTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface ContentType { + transactionId?: string | null; + status?: string | null; + } + export interface ContentTypeFormProperties { + transactionId: FormControl, + status: FormControl, + } + export function CreateContentTypeFormGroup() { + return new FormGroup({ + transactionId: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export interface EnterpriseConcessionVerificationReportContentType extends ContentType { + report?: EnterpriseConcessionVerificationResponseType; + } + export interface EnterpriseConcessionVerificationReportContentTypeFormProperties extends ContentTypeFormProperties { + } + export function CreateEnterpriseConcessionVerificationReportContentTypeFormGroup() { + return new FormGroup({ + transactionId: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export interface EnterprisePatientVerificationReportContentType extends ContentType { + report?: EnterprisePatientVerificationResponseType; + } + export interface EnterprisePatientVerificationReportContentTypeFormProperties extends ContentTypeFormProperties { + } + export function CreateEnterprisePatientVerificationReportContentTypeFormGroup() { + return new FormGroup({ + transactionId: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export interface EnterpriseVeteranVerificationReportContentType extends ContentType { + report?: EnterpriseVeteranVerificationResponseType; + } + export interface EnterpriseVeteranVerificationReportContentTypeFormProperties extends ContentTypeFormProperties { + } + export function CreateEnterpriseVeteranVerificationReportContentTypeFormGroup() { + return new FormGroup({ + transactionId: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export interface SameDayDeleteRequestType { + sameDayDelete: SameDayDeleteType; + } + export interface SameDayDeleteRequestTypeFormProperties { + } + export function CreateSameDayDeleteRequestTypeFormGroup() { + return new FormGroup({ + }); + + } + + export interface SameDayDeleteType { + patient: MedicarePatientType; + reasonCode: string; + } + export interface SameDayDeleteTypeFormProperties { + reasonCode: FormControl, + } + export function CreateSameDayDeleteTypeFormGroup() { + return new FormGroup({ + reasonCode: new FormControl(undefined, [Validators.required, Validators.minLength(3), Validators.maxLength(3)]), + }); + + } + + export interface SameDayDeleteResponseType { + status: string; + } + export interface SameDayDeleteResponseTypeFormProperties { + status: FormControl, + } + export function CreateSameDayDeleteResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface StatusReportRequestType { + transactionId?: Array; + associateName?: string | null; + fromDateTime?: Date | null; + toDateTime?: Date | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + status?: string | null; + } + export interface StatusReportRequestTypeFormProperties { + associateName: FormControl, + fromDateTime: FormControl, + toDateTime: FormControl, + reportStatus: FormControl, + requestTransmissionType: FormControl, + status: FormControl, + } + export function CreateStatusReportRequestTypeFormGroup() { + return new FormGroup({ + associateName: new FormControl(undefined), + fromDateTime: new FormControl(undefined), + toDateTime: new FormControl(undefined), + reportStatus: new FormControl(undefined), + requestTransmissionType: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export interface StatusReportResponseType { + transactionStatus?: Array; + status: string; + } + export interface StatusReportResponseTypeFormProperties { + status: FormControl, + } + export function CreateStatusReportResponseTypeFormGroup() { + return new FormGroup({ + status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface TransactionStatusType { + associateName?: string | null; + lodgementDateTime?: Date | null; + processStatus?: string | null; + reference?: string | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + transactionId?: string | null; + } + export interface TransactionStatusTypeFormProperties { + associateName: FormControl, + lodgementDateTime: FormControl, + processStatus: FormControl, + reference: FormControl, + reportStatus: FormControl, + requestTransmissionType: FormControl, + transactionId: FormControl, + } + export function CreateTransactionStatusTypeFormGroup() { + return new FormGroup({ + associateName: new FormControl(undefined), + lodgementDateTime: new FormControl(undefined), + processStatus: new FormControl(undefined), + reference: new FormControl(undefined), + reportStatus: new FormControl(undefined), + requestTransmissionType: new FormControl(undefined), + transactionId: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This is the request + * Post mcp/bulkbillpaymentreport/v1 + * @return {BBSPaymentReportResponseType} successful operation + */ + McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillprocessingreport/v1 + * @return {BBSProcessingReportResponseType} successful operation + */ + McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/general/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/pathology/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/specialist/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/allied/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/communitynursing/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/dental/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/optical/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/psych/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/speechpathology/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaclaim/general/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaclaim/pathology/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaclaim/specialist/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvapaymentreport/v1 + * @return {DVAPaymentReportResponseType} successful operation + */ + McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaprocessingreport/v1 + * @return {DVAProcessingReportResponseType} successful operation + */ + McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/v1 + * @return {EnterpriseConcessionVerificationResponseType} successful operation + */ + McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/v1 + * @return {EnterprisePatientVerificationResponseType} successful operation + */ + McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/v1 + * @return {EnterpriseVeteranVerificationResponseType} successful operation + */ + McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/general/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/pathology/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/specialist/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientverification/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientverification/hf/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientverification/medicare/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/samedaydelete/v1 + * @return {SameDayDeleteResponseType} successful operation + */ + McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/statusreport/v1 + * @return {StatusReportResponseType} successful operation + */ + McpStatusReport1Eigw(requestBody: StatusReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/veteranverification/v1 + * @return {VeteranVerificationResponseType} successful operation + */ + McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/redocOpenApi200501.txt b/Tests/SwagTsTests/NG2FormGroupResults/redocOpenApi200501.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/redocOpenApi200501.txt rename to Tests/SwagTsTests/NG2FormGroupResults/redocOpenApi200501.ts index d71c0ac4..56f7f8ae 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/redocOpenApi200501.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/redocOpenApi200501.ts @@ -1,687 +1,687 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - export interface ApiResponseFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code: FormControl, - type: FormControl, - message: FormControl, - } - export function CreateApiResponseFormGroup() { - return new FormGroup({ - code: new FormControl(undefined), - type: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - /** A representation of a cat */ - export interface CatFormProperties extends PetFormProperties { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: FormControl, - } - export function CreateCatFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - huntingSkill: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - export interface CategoryFormProperties { - - /** Category ID */ - id: FormControl, - - /** - * Category name - * Min length: 1 - */ - name: FormControl, - } - export function CreateCategoryFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - export interface CategorySubFormProperties { - - /** Dumb Property */ - prop1: FormControl, - } - export function CreateCategorySubFormGroup() { - return new FormGroup({ - prop1: new FormControl(undefined), - }); - - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1.0 - */ - packSize: number; - } - - /** A representation of a dog */ - export interface DogFormProperties extends PetFormProperties { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1.0 - */ - packSize: FormControl, - } - export function CreateDogFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - packSize: new FormControl(undefined, [Validators.required, Validators.min(1.0)]), - }); - - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - /** A representation of a honey bee */ - export interface HoneyBeeFormProperties extends PetFormProperties { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: FormControl, - } - export function CreateHoneyBeeFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - honeyPerDay: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1.0 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - export interface OrderFormProperties { - - /** Order ID */ - id: FormControl, - - /** Pet ID */ - petId: FormControl, - - /** Minimum: 1.0 */ - quantity: FormControl, - - /** Estimated ship date */ - shipDate: FormControl, - - /** Order Status */ - status: FormControl, - - /** Indicates whenever order was completed or not */ - complete: FormControl, - - /** Unique Request Id */ - requestId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - petId: new FormControl(undefined), - quantity: new FormControl(undefined, [Validators.min(1.0)]), - shipDate: new FormControl(undefined), - status: new FormControl(undefined), - complete: new FormControl(undefined), - requestId: new FormControl(undefined), - }); - - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - export interface PetFormProperties { - - /** Pet ID */ - id: FormControl, - - /** - * The name given to a pet - * Required - */ - name: FormControl, - - /** Pet status in the store */ - status: FormControl, - - /** Type of a pet */ - petType: FormControl, - } - export function CreatePetFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined), - petType: new FormControl(undefined), - }); - - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - export interface TagFormProperties { - - /** Tag ID */ - id: FormControl, - - /** - * Tag name - * Min length: 1 - */ - name: FormControl, - } - export function CreateTagFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.minLength(1)]), - }); - - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - export interface UserFormProperties { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id: FormControl, - - /** - * User supplied username - * Min length: 4 - */ - username: FormControl, - - /** - * User first name - * Min length: 1 - */ - firstName: FormControl, - - /** - * User last name - * Min length: 1 - */ - lastName: FormControl, - - /** User email address */ - email: FormControl, - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password: FormControl, - - /** User phone number in international format */ - phone: FormControl, - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - username: new FormControl(undefined, [Validators.minLength(4)]), - firstName: new FormControl(undefined, [Validators.minLength(1)]), - lastName: new FormControl(undefined, [Validators.minLength(1)]), - email: new FormControl(undefined), - password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), - phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), - userStatus: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @return {void} - */ - AddPet(): Observable> { - return this.http.post(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @return {void} - */ - UpdatePet(): Observable> { - return this.http.put(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1.0 Maximum: 5.0 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1.0 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Subscribe to the Store events - * Add subscription for a store events - * Post store/subscribe - * @return {void} - */ - Subscribe(requestBody: SubscribePostBody): Observable> { - return this.http.post(this.baseUri + 'store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @return {void} - */ - CreateUsersWithArrayInput(): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @return {void} - */ - CreateUsersWithListInput(): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - - export interface SubscribePostBody { - - /** - * This URL will be called by the server when the desired event will occur - * Required - */ - callbackUrl: string; - - /** - * Event name for the subscription - * Required - */ - eventName: SubscribePostBodyEventName; - } - export interface SubscribePostBodyFormProperties { - - /** - * This URL will be called by the server when the desired event will occur - * Required - */ - callbackUrl: FormControl, - - /** - * Event name for the subscription - * Required - */ - eventName: FormControl, - } - export function CreateSubscribePostBodyFormGroup() { - return new FormGroup({ - callbackUrl: new FormControl(undefined, [Validators.required]), - eventName: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + export interface ApiResponseFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code: FormControl, + type: FormControl, + message: FormControl, + } + export function CreateApiResponseFormGroup() { + return new FormGroup({ + code: new FormControl(undefined), + type: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + /** A representation of a cat */ + export interface CatFormProperties extends PetFormProperties { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: FormControl, + } + export function CreateCatFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + huntingSkill: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + export interface CategoryFormProperties { + + /** Category ID */ + id: FormControl, + + /** + * Category name + * Min length: 1 + */ + name: FormControl, + } + export function CreateCategoryFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + export interface CategorySubFormProperties { + + /** Dumb Property */ + prop1: FormControl, + } + export function CreateCategorySubFormGroup() { + return new FormGroup({ + prop1: new FormControl(undefined), + }); + + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1.0 + */ + packSize: number; + } + + /** A representation of a dog */ + export interface DogFormProperties extends PetFormProperties { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1.0 + */ + packSize: FormControl, + } + export function CreateDogFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + packSize: new FormControl(undefined, [Validators.required, Validators.min(1.0)]), + }); + + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + /** A representation of a honey bee */ + export interface HoneyBeeFormProperties extends PetFormProperties { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: FormControl, + } + export function CreateHoneyBeeFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + honeyPerDay: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1.0 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + export interface OrderFormProperties { + + /** Order ID */ + id: FormControl, + + /** Pet ID */ + petId: FormControl, + + /** Minimum: 1.0 */ + quantity: FormControl, + + /** Estimated ship date */ + shipDate: FormControl, + + /** Order Status */ + status: FormControl, + + /** Indicates whenever order was completed or not */ + complete: FormControl, + + /** Unique Request Id */ + requestId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + petId: new FormControl(undefined), + quantity: new FormControl(undefined, [Validators.min(1.0)]), + shipDate: new FormControl(undefined), + status: new FormControl(undefined), + complete: new FormControl(undefined), + requestId: new FormControl(undefined), + }); + + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + export interface PetFormProperties { + + /** Pet ID */ + id: FormControl, + + /** + * The name given to a pet + * Required + */ + name: FormControl, + + /** Pet status in the store */ + status: FormControl, + + /** Type of a pet */ + petType: FormControl, + } + export function CreatePetFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined), + petType: new FormControl(undefined), + }); + + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + export interface TagFormProperties { + + /** Tag ID */ + id: FormControl, + + /** + * Tag name + * Min length: 1 + */ + name: FormControl, + } + export function CreateTagFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.minLength(1)]), + }); + + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + export interface UserFormProperties { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id: FormControl, + + /** + * User supplied username + * Min length: 4 + */ + username: FormControl, + + /** + * User first name + * Min length: 1 + */ + firstName: FormControl, + + /** + * User last name + * Min length: 1 + */ + lastName: FormControl, + + /** User email address */ + email: FormControl, + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password: FormControl, + + /** User phone number in international format */ + phone: FormControl, + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + username: new FormControl(undefined, [Validators.minLength(4)]), + firstName: new FormControl(undefined, [Validators.minLength(1)]), + lastName: new FormControl(undefined, [Validators.minLength(1)]), + email: new FormControl(undefined), + password: new FormControl(undefined, [Validators.minLength(8), Validators.pattern('/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/')]), + phone: new FormControl(undefined, [Validators.pattern('/^\+(?:[0-9]-?){6,14}[0-9]$/')]), + userStatus: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @return {void} + */ + AddPet(): Observable> { + return this.http.post(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @return {void} + */ + UpdatePet(): Observable> { + return this.http.put(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1.0 Maximum: 5.0 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1.0 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Subscribe to the Store events + * Add subscription for a store events + * Post store/subscribe + * @return {void} + */ + Subscribe(requestBody: SubscribePostBody): Observable> { + return this.http.post(this.baseUri + 'store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @return {void} + */ + CreateUsersWithArrayInput(): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @return {void} + */ + CreateUsersWithListInput(): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + + export interface SubscribePostBody { + + /** + * This URL will be called by the server when the desired event will occur + * Required + */ + callbackUrl: string; + + /** + * Event name for the subscription + * Required + */ + eventName: SubscribePostBodyEventName; + } + export interface SubscribePostBodyFormProperties { + + /** + * This URL will be called by the server when the desired event will occur + * Required + */ + callbackUrl: FormControl, + + /** + * Event name for the subscription + * Required + */ + eventName: FormControl, + } + export function CreateSubscribePostBodyFormGroup() { + return new FormGroup({ + callbackUrl: new FormControl(undefined, [Validators.required]), + eventName: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_account.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_account.ts similarity index 99% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_account.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_account.ts index f508dd5e..3ee6225a 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_account.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_account.ts @@ -1,2044 +1,2044 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface AmountFormProperties { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency: FormControl, - - /** The value of the monetary amount in the specified currency. */ - value: FormControl, - } - export function CreateAmountFormGroup() { - return new FormGroup({ - currency: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ - export interface CategoryType { - - /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ - default?: boolean | null; - - /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ - name?: string | null; - } - - /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ - export interface CategoryTypeFormProperties { - - /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ - default: FormControl, - - /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ - name: FormControl, - } - export function CreateCategoryTypeFormGroup() { - return new FormGroup({ - default: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - - /** A container that describes the details of a deposit. Used only with motor listings. */ - export interface Deposit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - dueIn?: TimeDuration; - - /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ - paymentMethods?: Array; - } - - /** A container that describes the details of a deposit. Used only with motor listings. */ - export interface DepositFormProperties { - } - export function CreateDepositFormGroup() { - return new FormGroup({ - }); - - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDurationFormProperties { - - /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** - * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value: FormControl, - } - export function CreateTimeDurationFormGroup() { - return new FormGroup({ - unit: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ - export interface PaymentMethod { - - /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ - brands?: Array; - - /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ - paymentMethodType?: string | null; - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - recipientAccountReference?: RecipientAccountReference; - } - - /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ - export interface PaymentMethodFormProperties { - - /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ - paymentMethodType: FormControl, - } - export function CreatePaymentMethodFormGroup() { - return new FormGroup({ - paymentMethodType: new FormControl(undefined), - }); - - } - - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - export interface RecipientAccountReference { - - /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ - referenceId?: string | null; - - /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ - referenceType?: string | null; - } - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - export interface RecipientAccountReferenceFormProperties { - - /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ - referenceId: FormControl, - - /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ - referenceType: FormControl, - } - export function CreateRecipientAccountReferenceFormGroup() { - return new FormGroup({ - referenceId: new FormControl(undefined), - referenceType: new FormControl(undefined), - }); - - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface FulfillmentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface FulfillmentPolicyFormProperties { - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description: FormControl, - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping: FormControl, - - /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId: FormControl, - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping: FormControl, - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup: FormControl, - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff: FormControl, - } - export function CreateFulfillmentPolicyFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - freightShipping: new FormControl(undefined), - fulfillmentPolicyId: new FormControl(undefined), - globalShipping: new FormControl(undefined), - localPickup: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - pickupDropOff: new FormControl(undefined), - }); - - } - - - /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ - export interface ShippingOption { - - /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ - costType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - insuranceFee?: Amount; - - /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ - insuranceOffered?: boolean | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ - optionType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - packageHandlingCost?: Amount; - - /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ - rateTableId?: string | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ - shippingServices?: Array; - } - - /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ - export interface ShippingOptionFormProperties { - - /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ - costType: FormControl, - - /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ - insuranceOffered: FormControl, - - /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ - optionType: FormControl, - - /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ - rateTableId: FormControl, - } - export function CreateShippingOptionFormGroup() { - return new FormGroup({ - costType: new FormControl(undefined), - insuranceOffered: new FormControl(undefined), - optionType: new FormControl(undefined), - rateTableId: new FormControl(undefined), - }); - - } - - - /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ - export interface ShippingService { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalShippingCost?: Amount; - - /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForPickup?: boolean | null; - - /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForShipping?: boolean | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - cashOnDeliveryFee?: Amount; - - /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ - freeShipping?: boolean | null; - - /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ - shippingCarrierCode?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - shippingCost?: Amount; - - /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ - shippingServiceCode?: string | null; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** - * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - sortOrder?: number | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - surcharge?: Amount; - } - - /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ - export interface ShippingServiceFormProperties { - - /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForPickup: FormControl, - - /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForShipping: FormControl, - - /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ - freeShipping: FormControl, - - /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ - shippingCarrierCode: FormControl, - - /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ - shippingServiceCode: FormControl, - - /** - * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - sortOrder: FormControl, - } - export function CreateShippingServiceFormGroup() { - return new FormGroup({ - buyerResponsibleForPickup: new FormControl(undefined), - buyerResponsibleForShipping: new FormControl(undefined), - freeShipping: new FormControl(undefined), - shippingCarrierCode: new FormControl(undefined), - shippingServiceCode: new FormControl(undefined), - sortOrder: new FormControl(undefined), - }); - - } - - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - export interface RegionSet { - - /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ - regionExcluded?: Array; - - /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ - regionIncluded?: Array; - } - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - export interface RegionSetFormProperties { - } - export function CreateRegionSetFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines information for a region. */ - export interface Region { - - /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ - regionName?: string | null; - - /** Reserved for future use. For implementation help, refer to eBay API documentation */ - regionType?: string | null; - } - - /** This type defines information for a region. */ - export interface RegionFormProperties { - - /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ - regionName: FormControl, - - /** Reserved for future use. For implementation help, refer to eBay API documentation */ - regionType: FormControl, - } - export function CreateRegionFormGroup() { - return new FormGroup({ - regionName: new FormControl(undefined), - regionType: new FormControl(undefined), - }); - - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface FulfillmentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface FulfillmentPolicyRequestFormProperties { - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description: FormControl, - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping: FormControl, - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping: FormControl, - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup: FormControl, - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff: FormControl, - } - export function CreateFulfillmentPolicyRequestFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - freightShipping: new FormControl(undefined), - globalShipping: new FormControl(undefined), - localPickup: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - pickupDropOff: new FormControl(undefined), - }); - - } - - - /** The response payload for requests that return a list of fulfillment policies. */ - export interface FulfillmentPolicyResponse { - - /** A list of the seller's fulfillment policies. */ - fulfillmentPolicies?: Array; - - /** Returns a URL link to the result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** The response payload for requests that return a list of fulfillment policies. */ - export interface FulfillmentPolicyResponseFormProperties { - - /** Returns a URL link to the result set. */ - href: FormControl, - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** Returns a URL link to the next set of results. */ - next: FormControl, - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** Returns a URL link to the previous set of results. */ - prev: FormControl, - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateFulfillmentPolicyResponseFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - export interface InternationalReturnOverrideType { - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ - returnsAccepted?: boolean | null; - - /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - export interface InternationalReturnOverrideTypeFormProperties { - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod: FormControl, - - /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ - returnsAccepted: FormControl, - - /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer: FormControl, - } - export function CreateInternationalReturnOverrideTypeFormGroup() { - return new FormGroup({ - returnMethod: new FormControl(undefined), - returnsAccepted: new FormControl(undefined), - returnShippingCostPayer: new FormControl(undefined), - }); - - } - - - /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface PaymentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - } - - /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface PaymentPolicyFormProperties { - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description: FormControl, - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay: FormControl, - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions: FormControl, - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId: FormControl, - } - export function CreatePaymentPolicyFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - immediatePay: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - paymentInstructions: new FormControl(undefined), - paymentPolicyId: new FormControl(undefined), - }); - - } - - - /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface PaymentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - } - - /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface PaymentPolicyRequestFormProperties { - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description: FormControl, - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay: FormControl, - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions: FormControl, - } - export function CreatePaymentPolicyRequestFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - immediatePay: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - paymentInstructions: new FormControl(undefined), - }); - - } - - - /** The response payload for payment policy requests. */ - export interface PaymentPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** A list of the seller's payment policies. */ - paymentPolicies?: Array; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** The response payload for payment policy requests. */ - export interface PaymentPolicyResponseFormProperties { - - /** Returns a URL link to the current result set. */ - href: FormControl, - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** Returns a URL link to the next set of results. */ - next: FormControl, - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** Returns a URL link to the previous set of results. */ - prev: FormControl, - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreatePaymentPolicyResponseFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** The response object containing the sellers status with regards to the specified payment program. */ - export interface PaymentsProgramResponse { - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ - paymentsProgramType?: string | null; - - /** For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ - wasPreviouslyOptedIn?: boolean | null; - } - - /** The response object containing the sellers status with regards to the specified payment program. */ - export interface PaymentsProgramResponseFormProperties { - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ - paymentsProgramType: FormControl, - - /** For implementation help, refer to eBay API documentation */ - status: FormControl, - - /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ - wasPreviouslyOptedIn: FormControl, - } - export function CreatePaymentsProgramResponseFormGroup() { - return new FormGroup({ - marketplaceId: new FormControl(undefined), - paymentsProgramType: new FormControl(undefined), - status: new FormControl(undefined), - wasPreviouslyOptedIn: new FormControl(undefined), - }); - - } - - - /** A seller program in to which a seller can opt-in. */ - export interface Program { - - /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ - programType?: string | null; - } - - /** A seller program in to which a seller can opt-in. */ - export interface ProgramFormProperties { - - /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ - programType: FormControl, - } - export function CreateProgramFormGroup() { - return new FormGroup({ - programType: new FormControl(undefined), - }); - - } - - - /** A list of the supported seller programs. */ - export interface Programs { - - /** A list of seller programs. */ - programs?: Array; - } - - /** A list of the supported seller programs. */ - export interface ProgramsFormProperties { - } - export function CreateProgramsFormGroup() { - return new FormGroup({ - }); - - } - - - /** A complex type that contains information pertaining to a shipping rate table. */ - export interface RateTable { - - /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ - locality?: string | null; - - /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ - name?: string | null; - - /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ - rateTableId?: string | null; - } - - /** A complex type that contains information pertaining to a shipping rate table. */ - export interface RateTableFormProperties { - - /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ - countryCode: FormControl, - - /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ - locality: FormControl, - - /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ - name: FormControl, - - /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ - rateTableId: FormControl, - } - export function CreateRateTableFormGroup() { - return new FormGroup({ - countryCode: new FormControl(undefined), - locality: new FormControl(undefined), - name: new FormControl(undefined), - rateTableId: new FormControl(undefined), - }); - - } - - - /** The response container for with information on a seller's shipping rate tables. */ - export interface RateTableResponse { - - /** A list of elements that provide information on the seller-defined shipping rate tables. */ - rateTables?: Array; - } - - /** The response container for with information on a seller's shipping rate tables. */ - export interface RateTableResponseFormProperties { - } - export function CreateRateTableResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface ReturnPolicy { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface ReturnPolicyFormProperties { - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description: FormControl, - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered: FormControl, - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod: FormControl, - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage: FormControl, - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions: FormControl, - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod: FormControl, - - /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ - returnPolicyId: FormControl, - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted: FormControl, - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer: FormControl, - } - export function CreateReturnPolicyFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - extendedHolidayReturnsOffered: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - refundMethod: new FormControl(undefined), - restockingFeePercentage: new FormControl(undefined), - returnInstructions: new FormControl(undefined), - returnMethod: new FormControl(undefined), - returnPolicyId: new FormControl(undefined), - returnsAccepted: new FormControl(undefined), - returnShippingCostPayer: new FormControl(undefined), - }); - - } - - - /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface ReturnPolicyRequest { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface ReturnPolicyRequestFormProperties { - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description: FormControl, - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered: FormControl, - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod: FormControl, - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage: FormControl, - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions: FormControl, - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod: FormControl, - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted: FormControl, - - /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer: FormControl, - } - export function CreateReturnPolicyRequestFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - extendedHolidayReturnsOffered: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - refundMethod: new FormControl(undefined), - restockingFeePercentage: new FormControl(undefined), - returnInstructions: new FormControl(undefined), - returnMethod: new FormControl(undefined), - returnsAccepted: new FormControl(undefined), - returnShippingCostPayer: new FormControl(undefined), - }); - - } - - - /** The response payload for return policy requests. */ - export interface ReturnPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** A list of the seller's return policies. */ - returnPolicies?: Array; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** The response payload for return policy requests. */ - export interface ReturnPolicyResponseFormProperties { - - /** Returns a URL link to the current result set. */ - href: FormControl, - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** Returns a URL link to the next set of results. */ - next: FormControl, - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** Returns a URL link to the previous set of results. */ - prev: FormControl, - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateReturnPolicyResponseFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ - export interface SalesTax { - - /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ - salesTaxJurisdictionId?: string | null; - - /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ - export interface SalesTaxFormProperties { - - /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ - countryCode: FormControl, - - /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ - salesTaxJurisdictionId: FormControl, - - /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ - salesTaxPercentage: FormControl, - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed: FormControl, - } - export function CreateSalesTaxFormGroup() { - return new FormGroup({ - countryCode: new FormControl(undefined), - salesTaxJurisdictionId: new FormControl(undefined), - salesTaxPercentage: new FormControl(undefined), - shippingAndHandlingTaxed: new FormControl(undefined), - }); - - } - - - /** A container that describes the how the sales tax rate is calculated. */ - export interface SalesTaxBase { - - /** The sales tax rate, as a percentage of the sale. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - /** A container that describes the how the sales tax rate is calculated. */ - export interface SalesTaxBaseFormProperties { - - /** The sales tax rate, as a percentage of the sale. */ - salesTaxPercentage: FormControl, - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed: FormControl, - } - export function CreateSalesTaxBaseFormGroup() { - return new FormGroup({ - salesTaxPercentage: new FormControl(undefined), - shippingAndHandlingTaxed: new FormControl(undefined), - }); - - } - - - /** A list of sales tax tables. */ - export interface SalesTaxes { - - /** A list of sales tax tables that have been set up by a seller. */ - salesTaxes?: Array; - } - - /** A list of sales tax tables. */ - export interface SalesTaxesFormProperties { - } - export function CreateSalesTaxesFormGroup() { - return new FormGroup({ - }); - - } - - - /** Defines the selling limit applied to an eBay seller's account. */ - export interface SellingLimit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** - * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - /** Defines the selling limit applied to an eBay seller's account. */ - export interface SellingLimitFormProperties { - - /** - * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity: FormControl, - } - export function CreateSellingLimitFormGroup() { - return new FormGroup({ - quantity: new FormControl(undefined), - }); - - } - - - /** A merchant's selling limit, and the status of their account registration. */ - export interface SellingPrivileges { - - /** If set to true, the seller's registration is completed. */ - sellerRegistrationCompleted?: boolean | null; - - /** Defines the selling limit applied to an eBay seller's account. */ - sellingLimit?: SellingLimit; - } - - /** A merchant's selling limit, and the status of their account registration. */ - export interface SellingPrivilegesFormProperties { - - /** If set to true, the seller's registration is completed. */ - sellerRegistrationCompleted: FormControl, - } - export function CreateSellingPrivilegesFormGroup() { - return new FormGroup({ - sellerRegistrationCompleted: new FormControl(undefined), - }); - - } - - - /** Complex type that that gets populated with a response containing a fulfillment policy. */ - export interface SetFulfillmentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - /** Complex type that that gets populated with a response containing a fulfillment policy. */ - export interface SetFulfillmentPolicyResponseFormProperties { - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description: FormControl, - - /** If set to true, the seller offers freight shipping. */ - freightShipping: FormControl, - - /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId: FormControl, - - /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ - globalShipping: FormControl, - - /** If set to true, the seller offers local pickup of their items. */ - localPickup: FormControl, - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ - pickupDropOff: FormControl, - } - export function CreateSetFulfillmentPolicyResponseFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - freightShipping: new FormControl(undefined), - fulfillmentPolicyId: new FormControl(undefined), - globalShipping: new FormControl(undefined), - localPickup: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - pickupDropOff: new FormControl(undefined), - }); - - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - /** A container that defines the elements of error and warning messages. */ - export interface ErrorFormProperties { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category: FormControl, - - /** Name of the domain containing the service or application. */ - domain: FormControl, - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage: FormControl, - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message: FormControl, - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - /** Container for an error parameter. */ - export interface ErrorParameterFormProperties { - - /** Name of the entity that threw the error. */ - name: FormControl, - - /** A description of the error. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** Complex type that that gets populated with a response containing a payment policy. */ - export interface SetPaymentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - /** Complex type that that gets populated with a response containing a payment policy. */ - export interface SetPaymentPolicyResponseFormProperties { - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ - description: FormControl, - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ - immediatePay: FormControl, - - /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions: FormControl, - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId: FormControl, - } - export function CreateSetPaymentPolicyResponseFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - immediatePay: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - paymentInstructions: new FormControl(undefined), - paymentPolicyId: new FormControl(undefined), - }); - - } - - - /** Complex type that that gets populated with a response containing a return policy. */ - export interface SetReturnPolicyResponse { - - /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ - restockingFeePercentage?: string | null; - - /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ - returnInstructions?: string | null; - - /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - /** Complex type that that gets populated with a response containing a return policy. */ - export interface SetReturnPolicyResponseFormProperties { - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ - description: FormControl, - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ - extendedHolidayReturnsOffered: FormControl, - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name: FormControl, - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ - refundMethod: FormControl, - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ - restockingFeePercentage: FormControl, - - /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ - returnInstructions: FormControl, - - /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ - returnMethod: FormControl, - - /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ - returnPolicyId: FormControl, - - /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ - returnsAccepted: FormControl, - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer: FormControl, - } - export function CreateSetReturnPolicyResponseFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - extendedHolidayReturnsOffered: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - refundMethod: new FormControl(undefined), - restockingFeePercentage: new FormControl(undefined), - returnInstructions: new FormControl(undefined), - returnMethod: new FormControl(undefined), - returnPolicyId: new FormControl(undefined), - returnsAccepted: new FormControl(undefined), - returnShippingCostPayer: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {FulfillmentPolicyResponse} Success - */ - GetFulfillmentPolicies(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - - /** - * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post fulfillment_policy/ - * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. - * @return {void} - */ - CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Observable> { - return this.http.post(this.baseUri + 'fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. - * Get fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicy(fulfillmentPolicyId: string): Observable { - return this.http.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}); - } - - /** - * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. - * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request - * @return {SetFulfillmentPolicyResponse} OK - */ - UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Observable { - return this.http.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. - * Delete fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. - * @return {void} - */ - DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Observable> { - return this.http.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicyByName(marketplace_id: string, name: string): Observable { - return this.http.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); - } - - /** - * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {PaymentPolicyResponse} Success - */ - GetPaymentPolicies(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - - /** - * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post payment_policy/ - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {void} - */ - CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Observable> { - return this.http.post(this.baseUri + 'payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. - * Get payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicy(payment_policy_id: string): Observable { - return this.http.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}); - } - - /** - * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {SetPaymentPolicyResponse} OK - */ - UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Observable { - return this.http.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. - * Delete payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. - * @return {void} - */ - DeletePaymentPolicy(payment_policy_id: string): Observable> { - return this.http.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicyByName(marketplace_id: string, name: string): Observable { - return this.http.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); - } - - /** - * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. - * Get payments_program/{marketplace_id}/{payments_program_type} - * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. - * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. - * @return {PaymentsProgramResponse} Success - */ - GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Observable { - return this.http.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}); - } - - /** - * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). - * Get privilege/ - * @return {SellingPrivileges} Success - */ - GetPrivileges(): Observable { - return this.http.get(this.baseUri + 'privilege/', {}); - } - - /** - * This method gets a list of the seller programs that the seller has opted-in to. - * Get program/get_opted_in_programs - * @return {Programs} Success - */ - GetOptedInPrograms(): Observable { - return this.http.get(this.baseUri + 'program/get_opted_in_programs', {}); - } - - /** - * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. - * Post program/opt_in - * @param {Program} requestBody Program being opted-in to. - * @return {string} Success - */ - OptInToProgram(requestBody: Program): Observable { - return this.http.post(this.baseUri + 'program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. - * Post program/opt_out - * @param {Program} requestBody Program being opted-out of. - * @return {string} Success - */ - OptOutOfProgram(requestBody: Program): Observable { - return this.http.post(this.baseUri + 'program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. - * Get rate_table/ - * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {RateTableResponse} Success - */ - GetRateTables(country_code: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); - } - - /** - * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/ - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - - /** - * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post return_policy/ - * @param {ReturnPolicyRequest} requestBody Return policy request - * @return {void} - */ - CreateReturnPolicy(requestBody: ReturnPolicyRequest): Observable> { - return this.http.post(this.baseUri + 'return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. - * Get return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicy(return_policy_id: string): Observable { - return this.http.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}); - } - - /** - * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. - * @param {ReturnPolicyRequest} requestBody Container for a return policy request. - * @return {SetReturnPolicyResponse} OK - */ - UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Observable { - return this.http.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. - * Delete return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. - * @return {void} - */ - DeleteReturnPolicy(return_policy_id: string): Observable> { - return this.http.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicyByName(marketplace_id: string, name: string): Observable { - return this.http.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); - } - - /** - * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. - * Get sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. - * @return {SalesTax} Success - */ - GetSalesTax(countryCode: string, jurisdictionId: string): Observable { - return this.http.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}); - } - - /** - * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. - * Put sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. - * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. - * @return {void} - */ - CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Observable> { - return this.http.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. - * Delete sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. - * @return {void} - */ - DeleteSalesTax(countryCode: string, jurisdictionId: string): Observable> { - return this.http.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. - * Get sales_tax/ - * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {SalesTaxes} Success - */ - GetSalesTaxes(country_code: string): Observable { - return this.http.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface AmountFormProperties { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency: FormControl, + + /** The value of the monetary amount in the specified currency. */ + value: FormControl, + } + export function CreateAmountFormGroup() { + return new FormGroup({ + currency: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ + export interface CategoryType { + + /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ + default?: boolean | null; + + /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ + name?: string | null; + } + + /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ + export interface CategoryTypeFormProperties { + + /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ + default: FormControl, + + /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ + name: FormControl, + } + export function CreateCategoryTypeFormGroup() { + return new FormGroup({ + default: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + + /** A container that describes the details of a deposit. Used only with motor listings. */ + export interface Deposit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + dueIn?: TimeDuration; + + /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ + paymentMethods?: Array; + } + + /** A container that describes the details of a deposit. Used only with motor listings. */ + export interface DepositFormProperties { + } + export function CreateDepositFormGroup() { + return new FormGroup({ + }); + + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDurationFormProperties { + + /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** + * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value: FormControl, + } + export function CreateTimeDurationFormGroup() { + return new FormGroup({ + unit: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ + export interface PaymentMethod { + + /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ + brands?: Array; + + /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ + paymentMethodType?: string | null; + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + recipientAccountReference?: RecipientAccountReference; + } + + /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ + export interface PaymentMethodFormProperties { + + /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ + paymentMethodType: FormControl, + } + export function CreatePaymentMethodFormGroup() { + return new FormGroup({ + paymentMethodType: new FormControl(undefined), + }); + + } + + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + export interface RecipientAccountReference { + + /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ + referenceId?: string | null; + + /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ + referenceType?: string | null; + } + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + export interface RecipientAccountReferenceFormProperties { + + /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ + referenceId: FormControl, + + /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ + referenceType: FormControl, + } + export function CreateRecipientAccountReferenceFormGroup() { + return new FormGroup({ + referenceId: new FormControl(undefined), + referenceType: new FormControl(undefined), + }); + + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface FulfillmentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface FulfillmentPolicyFormProperties { + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description: FormControl, + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping: FormControl, + + /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId: FormControl, + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping: FormControl, + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup: FormControl, + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff: FormControl, + } + export function CreateFulfillmentPolicyFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + freightShipping: new FormControl(undefined), + fulfillmentPolicyId: new FormControl(undefined), + globalShipping: new FormControl(undefined), + localPickup: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + pickupDropOff: new FormControl(undefined), + }); + + } + + + /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ + export interface ShippingOption { + + /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ + costType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + insuranceFee?: Amount; + + /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ + insuranceOffered?: boolean | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ + optionType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + packageHandlingCost?: Amount; + + /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ + rateTableId?: string | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ + shippingServices?: Array; + } + + /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ + export interface ShippingOptionFormProperties { + + /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ + costType: FormControl, + + /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ + insuranceOffered: FormControl, + + /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ + optionType: FormControl, + + /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ + rateTableId: FormControl, + } + export function CreateShippingOptionFormGroup() { + return new FormGroup({ + costType: new FormControl(undefined), + insuranceOffered: new FormControl(undefined), + optionType: new FormControl(undefined), + rateTableId: new FormControl(undefined), + }); + + } + + + /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ + export interface ShippingService { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalShippingCost?: Amount; + + /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForPickup?: boolean | null; + + /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForShipping?: boolean | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + cashOnDeliveryFee?: Amount; + + /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ + freeShipping?: boolean | null; + + /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ + shippingCarrierCode?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + shippingCost?: Amount; + + /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ + shippingServiceCode?: string | null; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** + * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + sortOrder?: number | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + surcharge?: Amount; + } + + /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ + export interface ShippingServiceFormProperties { + + /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForPickup: FormControl, + + /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForShipping: FormControl, + + /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ + freeShipping: FormControl, + + /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ + shippingCarrierCode: FormControl, + + /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ + shippingServiceCode: FormControl, + + /** + * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + sortOrder: FormControl, + } + export function CreateShippingServiceFormGroup() { + return new FormGroup({ + buyerResponsibleForPickup: new FormControl(undefined), + buyerResponsibleForShipping: new FormControl(undefined), + freeShipping: new FormControl(undefined), + shippingCarrierCode: new FormControl(undefined), + shippingServiceCode: new FormControl(undefined), + sortOrder: new FormControl(undefined), + }); + + } + + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + export interface RegionSet { + + /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ + regionExcluded?: Array; + + /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ + regionIncluded?: Array; + } + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + export interface RegionSetFormProperties { + } + export function CreateRegionSetFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines information for a region. */ + export interface Region { + + /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ + regionName?: string | null; + + /** Reserved for future use. For implementation help, refer to eBay API documentation */ + regionType?: string | null; + } + + /** This type defines information for a region. */ + export interface RegionFormProperties { + + /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ + regionName: FormControl, + + /** Reserved for future use. For implementation help, refer to eBay API documentation */ + regionType: FormControl, + } + export function CreateRegionFormGroup() { + return new FormGroup({ + regionName: new FormControl(undefined), + regionType: new FormControl(undefined), + }); + + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface FulfillmentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface FulfillmentPolicyRequestFormProperties { + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description: FormControl, + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping: FormControl, + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping: FormControl, + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup: FormControl, + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff: FormControl, + } + export function CreateFulfillmentPolicyRequestFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + freightShipping: new FormControl(undefined), + globalShipping: new FormControl(undefined), + localPickup: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + pickupDropOff: new FormControl(undefined), + }); + + } + + + /** The response payload for requests that return a list of fulfillment policies. */ + export interface FulfillmentPolicyResponse { + + /** A list of the seller's fulfillment policies. */ + fulfillmentPolicies?: Array; + + /** Returns a URL link to the result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** The response payload for requests that return a list of fulfillment policies. */ + export interface FulfillmentPolicyResponseFormProperties { + + /** Returns a URL link to the result set. */ + href: FormControl, + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** Returns a URL link to the next set of results. */ + next: FormControl, + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** Returns a URL link to the previous set of results. */ + prev: FormControl, + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateFulfillmentPolicyResponseFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + export interface InternationalReturnOverrideType { + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ + returnsAccepted?: boolean | null; + + /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + export interface InternationalReturnOverrideTypeFormProperties { + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod: FormControl, + + /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ + returnsAccepted: FormControl, + + /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer: FormControl, + } + export function CreateInternationalReturnOverrideTypeFormGroup() { + return new FormGroup({ + returnMethod: new FormControl(undefined), + returnsAccepted: new FormControl(undefined), + returnShippingCostPayer: new FormControl(undefined), + }); + + } + + + /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface PaymentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + } + + /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface PaymentPolicyFormProperties { + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description: FormControl, + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay: FormControl, + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions: FormControl, + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId: FormControl, + } + export function CreatePaymentPolicyFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + immediatePay: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + paymentInstructions: new FormControl(undefined), + paymentPolicyId: new FormControl(undefined), + }); + + } + + + /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface PaymentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + } + + /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface PaymentPolicyRequestFormProperties { + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description: FormControl, + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay: FormControl, + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions: FormControl, + } + export function CreatePaymentPolicyRequestFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + immediatePay: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + paymentInstructions: new FormControl(undefined), + }); + + } + + + /** The response payload for payment policy requests. */ + export interface PaymentPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** A list of the seller's payment policies. */ + paymentPolicies?: Array; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** The response payload for payment policy requests. */ + export interface PaymentPolicyResponseFormProperties { + + /** Returns a URL link to the current result set. */ + href: FormControl, + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** Returns a URL link to the next set of results. */ + next: FormControl, + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** Returns a URL link to the previous set of results. */ + prev: FormControl, + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreatePaymentPolicyResponseFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** The response object containing the sellers status with regards to the specified payment program. */ + export interface PaymentsProgramResponse { + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ + paymentsProgramType?: string | null; + + /** For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ + wasPreviouslyOptedIn?: boolean | null; + } + + /** The response object containing the sellers status with regards to the specified payment program. */ + export interface PaymentsProgramResponseFormProperties { + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ + paymentsProgramType: FormControl, + + /** For implementation help, refer to eBay API documentation */ + status: FormControl, + + /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ + wasPreviouslyOptedIn: FormControl, + } + export function CreatePaymentsProgramResponseFormGroup() { + return new FormGroup({ + marketplaceId: new FormControl(undefined), + paymentsProgramType: new FormControl(undefined), + status: new FormControl(undefined), + wasPreviouslyOptedIn: new FormControl(undefined), + }); + + } + + + /** A seller program in to which a seller can opt-in. */ + export interface Program { + + /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ + programType?: string | null; + } + + /** A seller program in to which a seller can opt-in. */ + export interface ProgramFormProperties { + + /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ + programType: FormControl, + } + export function CreateProgramFormGroup() { + return new FormGroup({ + programType: new FormControl(undefined), + }); + + } + + + /** A list of the supported seller programs. */ + export interface Programs { + + /** A list of seller programs. */ + programs?: Array; + } + + /** A list of the supported seller programs. */ + export interface ProgramsFormProperties { + } + export function CreateProgramsFormGroup() { + return new FormGroup({ + }); + + } + + + /** A complex type that contains information pertaining to a shipping rate table. */ + export interface RateTable { + + /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ + locality?: string | null; + + /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ + name?: string | null; + + /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ + rateTableId?: string | null; + } + + /** A complex type that contains information pertaining to a shipping rate table. */ + export interface RateTableFormProperties { + + /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ + countryCode: FormControl, + + /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ + locality: FormControl, + + /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ + name: FormControl, + + /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ + rateTableId: FormControl, + } + export function CreateRateTableFormGroup() { + return new FormGroup({ + countryCode: new FormControl(undefined), + locality: new FormControl(undefined), + name: new FormControl(undefined), + rateTableId: new FormControl(undefined), + }); + + } + + + /** The response container for with information on a seller's shipping rate tables. */ + export interface RateTableResponse { + + /** A list of elements that provide information on the seller-defined shipping rate tables. */ + rateTables?: Array; + } + + /** The response container for with information on a seller's shipping rate tables. */ + export interface RateTableResponseFormProperties { + } + export function CreateRateTableResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface ReturnPolicy { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface ReturnPolicyFormProperties { + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description: FormControl, + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered: FormControl, + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod: FormControl, + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage: FormControl, + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions: FormControl, + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod: FormControl, + + /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ + returnPolicyId: FormControl, + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted: FormControl, + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer: FormControl, + } + export function CreateReturnPolicyFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + extendedHolidayReturnsOffered: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + refundMethod: new FormControl(undefined), + restockingFeePercentage: new FormControl(undefined), + returnInstructions: new FormControl(undefined), + returnMethod: new FormControl(undefined), + returnPolicyId: new FormControl(undefined), + returnsAccepted: new FormControl(undefined), + returnShippingCostPayer: new FormControl(undefined), + }); + + } + + + /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface ReturnPolicyRequest { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface ReturnPolicyRequestFormProperties { + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description: FormControl, + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered: FormControl, + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod: FormControl, + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage: FormControl, + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions: FormControl, + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod: FormControl, + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted: FormControl, + + /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer: FormControl, + } + export function CreateReturnPolicyRequestFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + extendedHolidayReturnsOffered: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + refundMethod: new FormControl(undefined), + restockingFeePercentage: new FormControl(undefined), + returnInstructions: new FormControl(undefined), + returnMethod: new FormControl(undefined), + returnsAccepted: new FormControl(undefined), + returnShippingCostPayer: new FormControl(undefined), + }); + + } + + + /** The response payload for return policy requests. */ + export interface ReturnPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** A list of the seller's return policies. */ + returnPolicies?: Array; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** The response payload for return policy requests. */ + export interface ReturnPolicyResponseFormProperties { + + /** Returns a URL link to the current result set. */ + href: FormControl, + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** Returns a URL link to the next set of results. */ + next: FormControl, + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** Returns a URL link to the previous set of results. */ + prev: FormControl, + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateReturnPolicyResponseFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ + export interface SalesTax { + + /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ + salesTaxJurisdictionId?: string | null; + + /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ + export interface SalesTaxFormProperties { + + /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ + countryCode: FormControl, + + /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ + salesTaxJurisdictionId: FormControl, + + /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ + salesTaxPercentage: FormControl, + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed: FormControl, + } + export function CreateSalesTaxFormGroup() { + return new FormGroup({ + countryCode: new FormControl(undefined), + salesTaxJurisdictionId: new FormControl(undefined), + salesTaxPercentage: new FormControl(undefined), + shippingAndHandlingTaxed: new FormControl(undefined), + }); + + } + + + /** A container that describes the how the sales tax rate is calculated. */ + export interface SalesTaxBase { + + /** The sales tax rate, as a percentage of the sale. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + /** A container that describes the how the sales tax rate is calculated. */ + export interface SalesTaxBaseFormProperties { + + /** The sales tax rate, as a percentage of the sale. */ + salesTaxPercentage: FormControl, + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed: FormControl, + } + export function CreateSalesTaxBaseFormGroup() { + return new FormGroup({ + salesTaxPercentage: new FormControl(undefined), + shippingAndHandlingTaxed: new FormControl(undefined), + }); + + } + + + /** A list of sales tax tables. */ + export interface SalesTaxes { + + /** A list of sales tax tables that have been set up by a seller. */ + salesTaxes?: Array; + } + + /** A list of sales tax tables. */ + export interface SalesTaxesFormProperties { + } + export function CreateSalesTaxesFormGroup() { + return new FormGroup({ + }); + + } + + + /** Defines the selling limit applied to an eBay seller's account. */ + export interface SellingLimit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** + * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + /** Defines the selling limit applied to an eBay seller's account. */ + export interface SellingLimitFormProperties { + + /** + * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity: FormControl, + } + export function CreateSellingLimitFormGroup() { + return new FormGroup({ + quantity: new FormControl(undefined), + }); + + } + + + /** A merchant's selling limit, and the status of their account registration. */ + export interface SellingPrivileges { + + /** If set to true, the seller's registration is completed. */ + sellerRegistrationCompleted?: boolean | null; + + /** Defines the selling limit applied to an eBay seller's account. */ + sellingLimit?: SellingLimit; + } + + /** A merchant's selling limit, and the status of their account registration. */ + export interface SellingPrivilegesFormProperties { + + /** If set to true, the seller's registration is completed. */ + sellerRegistrationCompleted: FormControl, + } + export function CreateSellingPrivilegesFormGroup() { + return new FormGroup({ + sellerRegistrationCompleted: new FormControl(undefined), + }); + + } + + + /** Complex type that that gets populated with a response containing a fulfillment policy. */ + export interface SetFulfillmentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + /** Complex type that that gets populated with a response containing a fulfillment policy. */ + export interface SetFulfillmentPolicyResponseFormProperties { + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description: FormControl, + + /** If set to true, the seller offers freight shipping. */ + freightShipping: FormControl, + + /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId: FormControl, + + /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ + globalShipping: FormControl, + + /** If set to true, the seller offers local pickup of their items. */ + localPickup: FormControl, + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ + pickupDropOff: FormControl, + } + export function CreateSetFulfillmentPolicyResponseFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + freightShipping: new FormControl(undefined), + fulfillmentPolicyId: new FormControl(undefined), + globalShipping: new FormControl(undefined), + localPickup: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + pickupDropOff: new FormControl(undefined), + }); + + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + /** A container that defines the elements of error and warning messages. */ + export interface ErrorFormProperties { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category: FormControl, + + /** Name of the domain containing the service or application. */ + domain: FormControl, + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage: FormControl, + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message: FormControl, + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + /** Container for an error parameter. */ + export interface ErrorParameterFormProperties { + + /** Name of the entity that threw the error. */ + name: FormControl, + + /** A description of the error. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** Complex type that that gets populated with a response containing a payment policy. */ + export interface SetPaymentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + /** Complex type that that gets populated with a response containing a payment policy. */ + export interface SetPaymentPolicyResponseFormProperties { + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ + description: FormControl, + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ + immediatePay: FormControl, + + /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions: FormControl, + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId: FormControl, + } + export function CreateSetPaymentPolicyResponseFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + immediatePay: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + paymentInstructions: new FormControl(undefined), + paymentPolicyId: new FormControl(undefined), + }); + + } + + + /** Complex type that that gets populated with a response containing a return policy. */ + export interface SetReturnPolicyResponse { + + /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ + restockingFeePercentage?: string | null; + + /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ + returnInstructions?: string | null; + + /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + /** Complex type that that gets populated with a response containing a return policy. */ + export interface SetReturnPolicyResponseFormProperties { + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ + description: FormControl, + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ + extendedHolidayReturnsOffered: FormControl, + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name: FormControl, + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ + refundMethod: FormControl, + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ + restockingFeePercentage: FormControl, + + /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ + returnInstructions: FormControl, + + /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ + returnMethod: FormControl, + + /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ + returnPolicyId: FormControl, + + /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ + returnsAccepted: FormControl, + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer: FormControl, + } + export function CreateSetReturnPolicyResponseFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + extendedHolidayReturnsOffered: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + refundMethod: new FormControl(undefined), + restockingFeePercentage: new FormControl(undefined), + returnInstructions: new FormControl(undefined), + returnMethod: new FormControl(undefined), + returnPolicyId: new FormControl(undefined), + returnsAccepted: new FormControl(undefined), + returnShippingCostPayer: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {FulfillmentPolicyResponse} Success + */ + GetFulfillmentPolicies(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + + /** + * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post fulfillment_policy/ + * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. + * @return {void} + */ + CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Observable> { + return this.http.post(this.baseUri + 'fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. + * Get fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicy(fulfillmentPolicyId: string): Observable { + return this.http.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}); + } + + /** + * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. + * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request + * @return {SetFulfillmentPolicyResponse} OK + */ + UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Observable { + return this.http.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. + * Delete fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. + * @return {void} + */ + DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Observable> { + return this.http.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicyByName(marketplace_id: string, name: string): Observable { + return this.http.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); + } + + /** + * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {PaymentPolicyResponse} Success + */ + GetPaymentPolicies(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + + /** + * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post payment_policy/ + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {void} + */ + CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Observable> { + return this.http.post(this.baseUri + 'payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. + * Get payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicy(payment_policy_id: string): Observable { + return this.http.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}); + } + + /** + * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {SetPaymentPolicyResponse} OK + */ + UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Observable { + return this.http.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. + * Delete payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. + * @return {void} + */ + DeletePaymentPolicy(payment_policy_id: string): Observable> { + return this.http.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicyByName(marketplace_id: string, name: string): Observable { + return this.http.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); + } + + /** + * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. + * Get payments_program/{marketplace_id}/{payments_program_type} + * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. + * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. + * @return {PaymentsProgramResponse} Success + */ + GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Observable { + return this.http.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}); + } + + /** + * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). + * Get privilege/ + * @return {SellingPrivileges} Success + */ + GetPrivileges(): Observable { + return this.http.get(this.baseUri + 'privilege/', {}); + } + + /** + * This method gets a list of the seller programs that the seller has opted-in to. + * Get program/get_opted_in_programs + * @return {Programs} Success + */ + GetOptedInPrograms(): Observable { + return this.http.get(this.baseUri + 'program/get_opted_in_programs', {}); + } + + /** + * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. + * Post program/opt_in + * @param {Program} requestBody Program being opted-in to. + * @return {string} Success + */ + OptInToProgram(requestBody: Program): Observable { + return this.http.post(this.baseUri + 'program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. + * Post program/opt_out + * @param {Program} requestBody Program being opted-out of. + * @return {string} Success + */ + OptOutOfProgram(requestBody: Program): Observable { + return this.http.post(this.baseUri + 'program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. + * Get rate_table/ + * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {RateTableResponse} Success + */ + GetRateTables(country_code: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); + } + + /** + * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/ + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + + /** + * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post return_policy/ + * @param {ReturnPolicyRequest} requestBody Return policy request + * @return {void} + */ + CreateReturnPolicy(requestBody: ReturnPolicyRequest): Observable> { + return this.http.post(this.baseUri + 'return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. + * Get return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicy(return_policy_id: string): Observable { + return this.http.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}); + } + + /** + * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. + * @param {ReturnPolicyRequest} requestBody Container for a return policy request. + * @return {SetReturnPolicyResponse} OK + */ + UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Observable { + return this.http.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. + * Delete return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. + * @return {void} + */ + DeleteReturnPolicy(return_policy_id: string): Observable> { + return this.http.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicyByName(marketplace_id: string, name: string): Observable { + return this.http.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); + } + + /** + * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. + * Get sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. + * @return {SalesTax} Success + */ + GetSalesTax(countryCode: string, jurisdictionId: string): Observable { + return this.http.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}); + } + + /** + * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. + * Put sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. + * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. + * @return {void} + */ + CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Observable> { + return this.http.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. + * Delete sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. + * @return {void} + */ + DeleteSalesTax(countryCode: string, jurisdictionId: string): Observable> { + return this.http.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. + * Get sales_tax/ + * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {SalesTaxes} Success + */ + GetSalesTaxes(country_code: string): Observable { + return this.http.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_analytics.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_analytics.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_analytics.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_analytics.ts index 51a28ff8..45465593 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_analytics.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_analytics.ts @@ -1,752 +1,752 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - export interface BenchmarkMetadata { - - /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ - average?: string | null; - } - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - export interface BenchmarkMetadataFormProperties { - - /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ - average: FormControl, - } - export function CreateBenchmarkMetadataFormGroup() { - return new FormGroup({ - average: new FormControl(undefined), - }); - - } - - - /** A complex type that describes a program cycle. */ - export interface Cycle { - - /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ - cycleType?: string | null; - - /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - evaluationDate?: string | null; - - /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ - evaluationMonth?: string | null; - } - - /** A complex type that describes a program cycle. */ - export interface CycleFormProperties { - - /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ - cycleType: FormControl, - - /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - evaluationDate: FormControl, - - /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ - evaluationMonth: FormControl, - } - export function CreateCycleFormGroup() { - return new FormGroup({ - cycleType: new FormControl(undefined), - evaluationDate: new FormControl(undefined), - evaluationMonth: new FormControl(undefined), - }); - - } - - - /** A complex type that defines a dimension key and metrics in a traffic report. */ - export interface Definition { - - /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The value the dimension or metric parameter as submitted in the request. */ - key?: string | null; - - /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ - localizedName?: string | null; - } - - /** A complex type that defines a dimension key and metrics in a traffic report. */ - export interface DefinitionFormProperties { - - /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ - dataType: FormControl, - - /** The value the dimension or metric parameter as submitted in the request. */ - key: FormControl, - - /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ - localizedName: FormControl, - } - export function CreateDefinitionFormGroup() { - return new FormGroup({ - dataType: new FormControl(undefined), - key: new FormControl(undefined), - localizedName: new FormControl(undefined), - }); - - } - - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - export interface Dimension { - - /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ - dimensionKey?: string | null; - - /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ - name?: string | null; - - /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ - value?: string | null; - } - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - export interface DimensionFormProperties { - - /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ - dimensionKey: FormControl, - - /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ - name: FormControl, - - /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ - value: FormControl, - } - export function CreateDimensionFormGroup() { - return new FormGroup({ - dimensionKey: new FormControl(undefined), - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ - export interface DimensionMetric { - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - dimension?: Dimension; - - /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ - metrics?: Array; - } - - /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ - export interface DimensionMetricFormProperties { - } - export function CreateDimensionMetricFormGroup() { - return new FormGroup({ - }); - - } - - - /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ - export interface Metric { - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - benchmark?: MetricBenchmark; - - /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ - distributions?: Array; - - /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ - metricKey?: string | null; - - /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ - value?: string | null; - } - - /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ - export interface MetricFormProperties { - - /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ - metricKey: FormControl, - - /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ - value: FormControl, - } - export function CreateMetricFormGroup() { - return new FormGroup({ - metricKey: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - export interface MetricBenchmark { - - /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ - adjustment?: string | null; - - /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ - basis?: string | null; - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - metadata?: BenchmarkMetadata; - - /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ - rating?: string | null; - } - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - export interface MetricBenchmarkFormProperties { - - /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ - adjustment: FormControl, - - /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ - basis: FormControl, - - /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ - rating: FormControl, - } - export function CreateMetricBenchmarkFormGroup() { - return new FormGroup({ - adjustment: new FormControl(undefined), - basis: new FormControl(undefined), - rating: new FormControl(undefined), - }); - - } - - - /** This complex data type describes the metric distribution by basis. */ - export interface MetricDistribution { - - /** This field returns the basis, or the method, by which the metric rating is calculated. */ - basis?: string | null; - - /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ - data?: Array; - } - - /** This complex data type describes the metric distribution by basis. */ - export interface MetricDistributionFormProperties { - - /** This field returns the basis, or the method, by which the metric rating is calculated. */ - basis: FormControl, - } - export function CreateMetricDistributionFormGroup() { - return new FormGroup({ - basis: new FormControl(undefined), - }); - - } - - - /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ - export interface Distribution { - - /** The name of a distribution in which the seller is active. */ - name?: string | null; - - /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ - value?: string | null; - } - - /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ - export interface DistributionFormProperties { - - /** The name of a distribution in which the seller is active. */ - name: FormControl, - - /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ - value: FormControl, - } - export function CreateDistributionFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** Type that defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ - category?: string | null; - - /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error than given in the message error field. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** If present, indicates which subsystem in which the error occurred. */ - subdomain?: string | null; - } - - /** Type that defines the fields that can be returned in an error. */ - export interface ErrorFormProperties { - - /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ - category: FormControl, - - /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ - domain: FormControl, - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A more detailed explanation of the error than given in the message error field. */ - longMessage: FormControl, - - /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message: FormControl, - - /** If present, indicates which subsystem in which the error occurred. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - - /** A complex type that defines an error and error message. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - /** A complex type that defines an error and error message. */ - export interface ErrorParameterFormProperties { - - /** Name of the entity that threw the error. */ - name: FormControl, - - /** A description of the error. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - export interface EvaluationCycle { - - /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - endDate?: string | null; - - /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ - evaluationDate?: string | null; - - /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ - evaluationType?: string | null; - - /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - startDate?: string | null; - } - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - export interface EvaluationCycleFormProperties { - - /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - endDate: FormControl, - - /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ - evaluationDate: FormControl, - - /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ - evaluationType: FormControl, - - /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - startDate: FormControl, - } - export function CreateEvaluationCycleFormGroup() { - return new FormGroup({ - endDate: new FormControl(undefined), - evaluationDate: new FormControl(undefined), - evaluationType: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** The response container for a list of seller profiles. */ - export interface FindSellerStandardsProfilesResponse { - - /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ - standardsProfiles?: Array; - } - - /** The response container for a list of seller profiles. */ - export interface FindSellerStandardsProfilesResponseFormProperties { - } - export function CreateFindSellerStandardsProfilesResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** A complex type that defines a seller profile. */ - export interface StandardsProfile { - - /** A complex type that describes a program cycle. */ - cycle?: Cycle; - - /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ - defaultProgram?: boolean | null; - - /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ - evaluationReason?: string | null; - - /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ - metrics?: Array; - - /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ - program?: string | null; - - /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ - standardsLevel?: string | null; - } - - /** A complex type that defines a seller profile. */ - export interface StandardsProfileFormProperties { - - /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ - defaultProgram: FormControl, - - /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ - evaluationReason: FormControl, - - /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ - program: FormControl, - - /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ - standardsLevel: FormControl, - } - export function CreateStandardsProfileFormGroup() { - return new FormGroup({ - defaultProgram: new FormControl(undefined), - evaluationReason: new FormControl(undefined), - program: new FormControl(undefined), - standardsLevel: new FormControl(undefined), - }); - - } - - - /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ - export interface GetCustomerServiceMetricResponse { - - /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ - dimensionMetrics?: Array; - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - evaluationCycle?: EvaluationCycle; - - /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ - export interface GetCustomerServiceMetricResponseFormProperties { - - /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - } - export function CreateGetCustomerServiceMetricResponseFormGroup() { - return new FormGroup({ - marketplaceId: new FormControl(undefined), - }); - - } - - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - export interface Header { - - /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ - dimensionKeys?: Array; - - /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ - metrics?: Array; - } - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - export interface HeaderFormProperties { - } - export function CreateHeaderFormGroup() { - return new FormGroup({ - }); - - } - - - /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ - export interface Metadata { - - /** Type that defines the metadata header fields. */ - metadataHeader?: MetadataHeader; - - /** A list of the individual report records. */ - metadataRecords?: Array; - } - - /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ - export interface MetadataFormProperties { - } - export function CreateMetadataFormGroup() { - return new FormGroup({ - }); - - } - - - /** Type that defines the metadata header fields. */ - export interface MetadataHeader { - - /** The key value used for the report. For example: "key": "LISTING_ID" */ - key?: string | null; - - /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ - metadataKeys?: Array; - } - - /** Type that defines the metadata header fields. */ - export interface MetadataHeaderFormProperties { - - /** The key value used for the report. For example: "key": "LISTING_ID" */ - key: FormControl, - } - export function CreateMetadataHeaderFormGroup() { - return new FormGroup({ - key: new FormControl(undefined), - }); - - } - - - /** A complex type that defines the data records returned in the report. */ - export interface MetadataRecord { - - /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ - metadataValues?: Array; - - /** A complex type that contains a value, plus the veracity of that value. */ - value?: Value; - } - - /** A complex type that defines the data records returned in the report. */ - export interface MetadataRecordFormProperties { - } - export function CreateMetadataRecordFormGroup() { - return new FormGroup({ - }); - - } - - - /** A complex type that contains a value, plus the veracity of that value. */ - export interface Value { - - /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ - applicable?: boolean | null; - - /** The value of the report data. */ - value?: string | null; - } - - /** A complex type that contains a value, plus the veracity of that value. */ - export interface ValueFormProperties { - - /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ - applicable: FormControl, - - /** The value of the report data. */ - value: FormControl, - } - export function CreateValueFormGroup() { - return new FormGroup({ - applicable: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** Type that defines the fields of the individual record of the report. */ - export interface Record { - - /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ - dimensionValues?: Array; - - /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ - metricValues?: Array; - } - - /** Type that defines the fields of the individual record of the report. */ - export interface RecordFormProperties { - } - export function CreateRecordFormGroup() { - return new FormGroup({ - }); - - } - - - /** The complex type that defines that defines the report. */ - export interface Report { - - /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ - dimensionMetadata?: Array; - - /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - endDate?: string | null; - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - header?: Header; - - /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ - lastUpdatedDate?: string | null; - - /** A complex type containing the individual data records for the traffic report. */ - records?: Array; - - /** The start date of the date range used to calculate the report, in ISO 8601 format. */ - startDate?: string | null; - - /** An array of any process errors or warnings that were generated during the processing of the call processing. */ - warnings?: Array; - } - - /** The complex type that defines that defines the report. */ - export interface ReportFormProperties { - - /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - endDate: FormControl, - - /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ - lastUpdatedDate: FormControl, - - /** The start date of the date range used to calculate the report, in ISO 8601 format. */ - startDate: FormControl, - } - export function CreateReportFormGroup() { - return new FormGroup({ - endDate: new FormControl(undefined), - lastUpdatedDate: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. - * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} - * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED - * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html - * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. - * @return {GetCustomerServiceMetricResponse} Success - */ - GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Observable { - return this.http.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}); - } - - /** - * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. - * Get seller_standards_profile - * @return {FindSellerStandardsProfilesResponse} Success - */ - FindSellerStandardsProfiles(): Observable { - return this.http.get(this.baseUri + 'seller_standards_profile', {}); - } - - /** - * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. - * Get seller_standards_profile/{program}/{cycle} - * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. - * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. - * @return {StandardsProfile} Success - */ - GetSellerStandardsProfile(cycle: string, program: string): Observable { - return this.http.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}); - } - - /** - * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. - * Get traffic_report - * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. - * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html - * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count - * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html - * @return {Report} Success - */ - GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + export interface BenchmarkMetadata { + + /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ + average?: string | null; + } + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + export interface BenchmarkMetadataFormProperties { + + /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ + average: FormControl, + } + export function CreateBenchmarkMetadataFormGroup() { + return new FormGroup({ + average: new FormControl(undefined), + }); + + } + + + /** A complex type that describes a program cycle. */ + export interface Cycle { + + /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ + cycleType?: string | null; + + /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + evaluationDate?: string | null; + + /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ + evaluationMonth?: string | null; + } + + /** A complex type that describes a program cycle. */ + export interface CycleFormProperties { + + /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ + cycleType: FormControl, + + /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + evaluationDate: FormControl, + + /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ + evaluationMonth: FormControl, + } + export function CreateCycleFormGroup() { + return new FormGroup({ + cycleType: new FormControl(undefined), + evaluationDate: new FormControl(undefined), + evaluationMonth: new FormControl(undefined), + }); + + } + + + /** A complex type that defines a dimension key and metrics in a traffic report. */ + export interface Definition { + + /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The value the dimension or metric parameter as submitted in the request. */ + key?: string | null; + + /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ + localizedName?: string | null; + } + + /** A complex type that defines a dimension key and metrics in a traffic report. */ + export interface DefinitionFormProperties { + + /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ + dataType: FormControl, + + /** The value the dimension or metric parameter as submitted in the request. */ + key: FormControl, + + /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ + localizedName: FormControl, + } + export function CreateDefinitionFormGroup() { + return new FormGroup({ + dataType: new FormControl(undefined), + key: new FormControl(undefined), + localizedName: new FormControl(undefined), + }); + + } + + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + export interface Dimension { + + /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ + dimensionKey?: string | null; + + /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ + name?: string | null; + + /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ + value?: string | null; + } + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + export interface DimensionFormProperties { + + /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ + dimensionKey: FormControl, + + /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ + name: FormControl, + + /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ + value: FormControl, + } + export function CreateDimensionFormGroup() { + return new FormGroup({ + dimensionKey: new FormControl(undefined), + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ + export interface DimensionMetric { + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + dimension?: Dimension; + + /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ + metrics?: Array; + } + + /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ + export interface DimensionMetricFormProperties { + } + export function CreateDimensionMetricFormGroup() { + return new FormGroup({ + }); + + } + + + /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ + export interface Metric { + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + benchmark?: MetricBenchmark; + + /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ + distributions?: Array; + + /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ + metricKey?: string | null; + + /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ + value?: string | null; + } + + /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ + export interface MetricFormProperties { + + /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ + metricKey: FormControl, + + /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ + value: FormControl, + } + export function CreateMetricFormGroup() { + return new FormGroup({ + metricKey: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + export interface MetricBenchmark { + + /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ + adjustment?: string | null; + + /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ + basis?: string | null; + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + metadata?: BenchmarkMetadata; + + /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ + rating?: string | null; + } + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + export interface MetricBenchmarkFormProperties { + + /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ + adjustment: FormControl, + + /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ + basis: FormControl, + + /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ + rating: FormControl, + } + export function CreateMetricBenchmarkFormGroup() { + return new FormGroup({ + adjustment: new FormControl(undefined), + basis: new FormControl(undefined), + rating: new FormControl(undefined), + }); + + } + + + /** This complex data type describes the metric distribution by basis. */ + export interface MetricDistribution { + + /** This field returns the basis, or the method, by which the metric rating is calculated. */ + basis?: string | null; + + /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ + data?: Array; + } + + /** This complex data type describes the metric distribution by basis. */ + export interface MetricDistributionFormProperties { + + /** This field returns the basis, or the method, by which the metric rating is calculated. */ + basis: FormControl, + } + export function CreateMetricDistributionFormGroup() { + return new FormGroup({ + basis: new FormControl(undefined), + }); + + } + + + /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ + export interface Distribution { + + /** The name of a distribution in which the seller is active. */ + name?: string | null; + + /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ + value?: string | null; + } + + /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ + export interface DistributionFormProperties { + + /** The name of a distribution in which the seller is active. */ + name: FormControl, + + /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ + value: FormControl, + } + export function CreateDistributionFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** Type that defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ + category?: string | null; + + /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error than given in the message error field. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** If present, indicates which subsystem in which the error occurred. */ + subdomain?: string | null; + } + + /** Type that defines the fields that can be returned in an error. */ + export interface ErrorFormProperties { + + /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ + category: FormControl, + + /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ + domain: FormControl, + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A more detailed explanation of the error than given in the message error field. */ + longMessage: FormControl, + + /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message: FormControl, + + /** If present, indicates which subsystem in which the error occurred. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + + /** A complex type that defines an error and error message. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + /** A complex type that defines an error and error message. */ + export interface ErrorParameterFormProperties { + + /** Name of the entity that threw the error. */ + name: FormControl, + + /** A description of the error. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + export interface EvaluationCycle { + + /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + endDate?: string | null; + + /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ + evaluationDate?: string | null; + + /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ + evaluationType?: string | null; + + /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + startDate?: string | null; + } + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + export interface EvaluationCycleFormProperties { + + /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + endDate: FormControl, + + /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ + evaluationDate: FormControl, + + /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ + evaluationType: FormControl, + + /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + startDate: FormControl, + } + export function CreateEvaluationCycleFormGroup() { + return new FormGroup({ + endDate: new FormControl(undefined), + evaluationDate: new FormControl(undefined), + evaluationType: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** The response container for a list of seller profiles. */ + export interface FindSellerStandardsProfilesResponse { + + /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ + standardsProfiles?: Array; + } + + /** The response container for a list of seller profiles. */ + export interface FindSellerStandardsProfilesResponseFormProperties { + } + export function CreateFindSellerStandardsProfilesResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** A complex type that defines a seller profile. */ + export interface StandardsProfile { + + /** A complex type that describes a program cycle. */ + cycle?: Cycle; + + /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ + defaultProgram?: boolean | null; + + /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ + evaluationReason?: string | null; + + /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ + metrics?: Array; + + /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ + program?: string | null; + + /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ + standardsLevel?: string | null; + } + + /** A complex type that defines a seller profile. */ + export interface StandardsProfileFormProperties { + + /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ + defaultProgram: FormControl, + + /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ + evaluationReason: FormControl, + + /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ + program: FormControl, + + /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ + standardsLevel: FormControl, + } + export function CreateStandardsProfileFormGroup() { + return new FormGroup({ + defaultProgram: new FormControl(undefined), + evaluationReason: new FormControl(undefined), + program: new FormControl(undefined), + standardsLevel: new FormControl(undefined), + }); + + } + + + /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ + export interface GetCustomerServiceMetricResponse { + + /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ + dimensionMetrics?: Array; + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + evaluationCycle?: EvaluationCycle; + + /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ + export interface GetCustomerServiceMetricResponseFormProperties { + + /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + } + export function CreateGetCustomerServiceMetricResponseFormGroup() { + return new FormGroup({ + marketplaceId: new FormControl(undefined), + }); + + } + + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + export interface Header { + + /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ + dimensionKeys?: Array; + + /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ + metrics?: Array; + } + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + export interface HeaderFormProperties { + } + export function CreateHeaderFormGroup() { + return new FormGroup({ + }); + + } + + + /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ + export interface Metadata { + + /** Type that defines the metadata header fields. */ + metadataHeader?: MetadataHeader; + + /** A list of the individual report records. */ + metadataRecords?: Array; + } + + /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ + export interface MetadataFormProperties { + } + export function CreateMetadataFormGroup() { + return new FormGroup({ + }); + + } + + + /** Type that defines the metadata header fields. */ + export interface MetadataHeader { + + /** The key value used for the report. For example: "key": "LISTING_ID" */ + key?: string | null; + + /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ + metadataKeys?: Array; + } + + /** Type that defines the metadata header fields. */ + export interface MetadataHeaderFormProperties { + + /** The key value used for the report. For example: "key": "LISTING_ID" */ + key: FormControl, + } + export function CreateMetadataHeaderFormGroup() { + return new FormGroup({ + key: new FormControl(undefined), + }); + + } + + + /** A complex type that defines the data records returned in the report. */ + export interface MetadataRecord { + + /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ + metadataValues?: Array; + + /** A complex type that contains a value, plus the veracity of that value. */ + value?: Value; + } + + /** A complex type that defines the data records returned in the report. */ + export interface MetadataRecordFormProperties { + } + export function CreateMetadataRecordFormGroup() { + return new FormGroup({ + }); + + } + + + /** A complex type that contains a value, plus the veracity of that value. */ + export interface Value { + + /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ + applicable?: boolean | null; + + /** The value of the report data. */ + value?: string | null; + } + + /** A complex type that contains a value, plus the veracity of that value. */ + export interface ValueFormProperties { + + /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ + applicable: FormControl, + + /** The value of the report data. */ + value: FormControl, + } + export function CreateValueFormGroup() { + return new FormGroup({ + applicable: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** Type that defines the fields of the individual record of the report. */ + export interface Record { + + /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ + dimensionValues?: Array; + + /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ + metricValues?: Array; + } + + /** Type that defines the fields of the individual record of the report. */ + export interface RecordFormProperties { + } + export function CreateRecordFormGroup() { + return new FormGroup({ + }); + + } + + + /** The complex type that defines that defines the report. */ + export interface Report { + + /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ + dimensionMetadata?: Array; + + /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + endDate?: string | null; + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + header?: Header; + + /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ + lastUpdatedDate?: string | null; + + /** A complex type containing the individual data records for the traffic report. */ + records?: Array; + + /** The start date of the date range used to calculate the report, in ISO 8601 format. */ + startDate?: string | null; + + /** An array of any process errors or warnings that were generated during the processing of the call processing. */ + warnings?: Array; + } + + /** The complex type that defines that defines the report. */ + export interface ReportFormProperties { + + /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + endDate: FormControl, + + /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ + lastUpdatedDate: FormControl, + + /** The start date of the date range used to calculate the report, in ISO 8601 format. */ + startDate: FormControl, + } + export function CreateReportFormGroup() { + return new FormGroup({ + endDate: new FormControl(undefined), + lastUpdatedDate: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. + * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} + * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED + * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html + * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. + * @return {GetCustomerServiceMetricResponse} Success + */ + GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Observable { + return this.http.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}); + } + + /** + * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. + * Get seller_standards_profile + * @return {FindSellerStandardsProfilesResponse} Success + */ + FindSellerStandardsProfiles(): Observable { + return this.http.get(this.baseUri + 'seller_standards_profile', {}); + } + + /** + * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. + * Get seller_standards_profile/{program}/{cycle} + * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. + * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. + * @return {StandardsProfile} Success + */ + GetSellerStandardsProfile(cycle: string, program: string): Observable { + return this.http.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}); + } + + /** + * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. + * Get traffic_report + * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. + * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html + * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count + * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html + * @return {Report} Success + */ + GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_compliance.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_compliance.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_compliance.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_compliance.ts index 0aad736b..3e330792 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_compliance.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_compliance.ts @@ -1,523 +1,523 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ - export interface AspectRecommendations { - - /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ - localizedAspectName?: string | null; - - /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ - suggestedValues?: Array; - } - - /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ - export interface AspectRecommendationsFormProperties { - - /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ - localizedAspectName: FormControl, - } - export function CreateAspectRecommendationsFormGroup() { - return new FormGroup({ - localizedAspectName: new FormControl(undefined), - }); - - } - - - /** This type is used by each listing violation that is returned under the violations container. */ - export interface ComplianceDetail { - - /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ - reasonCode?: string | null; - - /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ - message?: string | null; - - /** This type is used to identify the product variation that has the listing violation. */ - variation?: VariationDetails; - - /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ - violationData?: Array; - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - correctiveRecommendations?: CorrectiveRecommendations; - - /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ - complianceState?: string | null; - } - - /** This type is used by each listing violation that is returned under the violations container. */ - export interface ComplianceDetailFormProperties { - - /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ - reasonCode: FormControl, - - /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ - message: FormControl, - - /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ - complianceState: FormControl, - } - export function CreateComplianceDetailFormGroup() { - return new FormGroup({ - reasonCode: new FormControl(undefined), - message: new FormControl(undefined), - complianceState: new FormControl(undefined), - }); - - } - - - /** This type is used to identify the product variation that has the listing violation. */ - export interface VariationDetails { - - /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ - sku?: string | null; - - /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ - variationAspects?: Array; - } - - /** This type is used to identify the product variation that has the listing violation. */ - export interface VariationDetailsFormProperties { - - /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ - sku: FormControl, - } - export function CreateVariationDetailsFormGroup() { - return new FormGroup({ - sku: new FormControl(undefined), - }); - - } - - - /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ - export interface NameValueList { - - /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - name?: string | null; - - /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - value?: string | null; - } - - /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ - export interface NameValueListFormProperties { - - /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - name: FormControl, - - /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - value: FormControl, - } - export function CreateNameValueListFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - export interface CorrectiveRecommendations { - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - productRecommendation?: ProductRecommendation; - - /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ - aspectRecommendations?: Array; - } - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - export interface CorrectiveRecommendationsFormProperties { - } - export function CreateCorrectiveRecommendationsFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - export interface ProductRecommendation { - - /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ - epid?: string | null; - } - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - export interface ProductRecommendationFormProperties { - - /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ - epid: FormControl, - } - export function CreateProductRecommendationFormGroup() { - return new FormGroup({ - epid: new FormControl(undefined), - }); - - } - - - /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ - export interface ComplianceSummary { - - /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ - violationSummaries?: Array; - } - - /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ - export interface ComplianceSummaryFormProperties { - } - export function CreateComplianceSummaryFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ - export interface ComplianceSummaryInfo { - - /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - listingCount?: number | null; - } - - /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ - export interface ComplianceSummaryInfoFormProperties { - - /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ - complianceType: FormControl, - - /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** - * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - listingCount: FormControl, - } - export function CreateComplianceSummaryInfoFormGroup() { - return new FormGroup({ - complianceType: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - listingCount: new FormControl(undefined), - }); - - } - - - /** This type is used by each listing violation that is returned under the listingViolations container. */ - export interface ComplianceViolation { - - /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ - listingId?: string | null; - - /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ - sku?: string | null; - - /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ - offerId?: string | null; - - /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ - violations?: Array; - } - - /** This type is used by each listing violation that is returned under the listingViolations container. */ - export interface ComplianceViolationFormProperties { - - /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ - complianceType: FormControl, - - /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ - listingId: FormControl, - - /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ - sku: FormControl, - - /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ - offerId: FormControl, - } - export function CreateComplianceViolationFormGroup() { - return new FormGroup({ - complianceType: new FormControl(undefined), - listingId: new FormControl(undefined), - sku: new FormControl(undefined), - offerId: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - /** This type defines the fields that can be returned in an error. */ - export interface ErrorFormProperties { - - /** Identifies the type of erro. */ - category: FormControl, - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain: FormControl, - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A more detailed explanation of the error. */ - longMessage: FormControl, - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message: FormControl, - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - export interface ErrorParameterFormProperties { - - /** The object of the error. */ - name: FormControl, - - /** The value of the object. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is the base response type of the getListingViolations method. */ - export interface PagedComplianceViolationCollection { - - /** - * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI of the getListingViolations call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ - next?: string | null; - - /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ - prev?: string | null; - - /** - * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ - listingViolations?: Array; - } - - /** This type is the base response type of the getListingViolations method. */ - export interface PagedComplianceViolationCollectionFormProperties { - - /** - * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI of the getListingViolations call request that produced the current page of the result set. */ - href: FormControl, - - /** - * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - - /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ - next: FormControl, - - /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ - prev: FormControl, - - /** - * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - } - export function CreatePagedComplianceViolationCollectionFormGroup() { - return new FormGroup({ - offset: new FormControl(undefined), - href: new FormControl(undefined), - total: new FormControl(undefined), - next: new FormControl(undefined), - prev: new FormControl(undefined), - limit: new FormControl(undefined), - }); - - } - - - /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ - export interface SuppressViolationRequest { - - /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ - listingId?: string | null; - } - - /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ - export interface SuppressViolationRequestFormProperties { - - /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ - complianceType: FormControl, - - /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ - listingId: FormControl, - } - export function CreateSuppressViolationRequestFormGroup() { - return new FormGroup({ - complianceType: new FormControl(undefined), - listingId: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * Get listing_violation_summary - * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * @return {void} Success - */ - GetListingViolationsSummary(compliance_type: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. - * Get listing_violation - * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. - * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) - * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. - * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 - * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} - * @return {void} Success - */ - GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. - * Post suppress_listing_violation - * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. - * @return {void} - */ - SuppressViolation(requestBody: SuppressViolationRequest): Observable> { - return this.http.post(this.baseUri + 'suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ + export interface AspectRecommendations { + + /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ + localizedAspectName?: string | null; + + /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ + suggestedValues?: Array; + } + + /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ + export interface AspectRecommendationsFormProperties { + + /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ + localizedAspectName: FormControl, + } + export function CreateAspectRecommendationsFormGroup() { + return new FormGroup({ + localizedAspectName: new FormControl(undefined), + }); + + } + + + /** This type is used by each listing violation that is returned under the violations container. */ + export interface ComplianceDetail { + + /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ + reasonCode?: string | null; + + /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ + message?: string | null; + + /** This type is used to identify the product variation that has the listing violation. */ + variation?: VariationDetails; + + /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ + violationData?: Array; + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + correctiveRecommendations?: CorrectiveRecommendations; + + /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ + complianceState?: string | null; + } + + /** This type is used by each listing violation that is returned under the violations container. */ + export interface ComplianceDetailFormProperties { + + /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ + reasonCode: FormControl, + + /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ + message: FormControl, + + /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ + complianceState: FormControl, + } + export function CreateComplianceDetailFormGroup() { + return new FormGroup({ + reasonCode: new FormControl(undefined), + message: new FormControl(undefined), + complianceState: new FormControl(undefined), + }); + + } + + + /** This type is used to identify the product variation that has the listing violation. */ + export interface VariationDetails { + + /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ + sku?: string | null; + + /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ + variationAspects?: Array; + } + + /** This type is used to identify the product variation that has the listing violation. */ + export interface VariationDetailsFormProperties { + + /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ + sku: FormControl, + } + export function CreateVariationDetailsFormGroup() { + return new FormGroup({ + sku: new FormControl(undefined), + }); + + } + + + /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ + export interface NameValueList { + + /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + name?: string | null; + + /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + value?: string | null; + } + + /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ + export interface NameValueListFormProperties { + + /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + name: FormControl, + + /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + value: FormControl, + } + export function CreateNameValueListFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + export interface CorrectiveRecommendations { + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + productRecommendation?: ProductRecommendation; + + /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ + aspectRecommendations?: Array; + } + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + export interface CorrectiveRecommendationsFormProperties { + } + export function CreateCorrectiveRecommendationsFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + export interface ProductRecommendation { + + /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ + epid?: string | null; + } + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + export interface ProductRecommendationFormProperties { + + /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ + epid: FormControl, + } + export function CreateProductRecommendationFormGroup() { + return new FormGroup({ + epid: new FormControl(undefined), + }); + + } + + + /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ + export interface ComplianceSummary { + + /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ + violationSummaries?: Array; + } + + /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ + export interface ComplianceSummaryFormProperties { + } + export function CreateComplianceSummaryFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ + export interface ComplianceSummaryInfo { + + /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + listingCount?: number | null; + } + + /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ + export interface ComplianceSummaryInfoFormProperties { + + /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ + complianceType: FormControl, + + /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** + * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + listingCount: FormControl, + } + export function CreateComplianceSummaryInfoFormGroup() { + return new FormGroup({ + complianceType: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + listingCount: new FormControl(undefined), + }); + + } + + + /** This type is used by each listing violation that is returned under the listingViolations container. */ + export interface ComplianceViolation { + + /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ + listingId?: string | null; + + /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ + sku?: string | null; + + /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ + offerId?: string | null; + + /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ + violations?: Array; + } + + /** This type is used by each listing violation that is returned under the listingViolations container. */ + export interface ComplianceViolationFormProperties { + + /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ + complianceType: FormControl, + + /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ + listingId: FormControl, + + /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ + sku: FormControl, + + /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ + offerId: FormControl, + } + export function CreateComplianceViolationFormGroup() { + return new FormGroup({ + complianceType: new FormControl(undefined), + listingId: new FormControl(undefined), + sku: new FormControl(undefined), + offerId: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + /** This type defines the fields that can be returned in an error. */ + export interface ErrorFormProperties { + + /** Identifies the type of erro. */ + category: FormControl, + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain: FormControl, + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A more detailed explanation of the error. */ + longMessage: FormControl, + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message: FormControl, + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + export interface ErrorParameterFormProperties { + + /** The object of the error. */ + name: FormControl, + + /** The value of the object. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is the base response type of the getListingViolations method. */ + export interface PagedComplianceViolationCollection { + + /** + * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI of the getListingViolations call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ + next?: string | null; + + /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ + prev?: string | null; + + /** + * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ + listingViolations?: Array; + } + + /** This type is the base response type of the getListingViolations method. */ + export interface PagedComplianceViolationCollectionFormProperties { + + /** + * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI of the getListingViolations call request that produced the current page of the result set. */ + href: FormControl, + + /** + * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + + /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ + next: FormControl, + + /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ + prev: FormControl, + + /** + * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + } + export function CreatePagedComplianceViolationCollectionFormGroup() { + return new FormGroup({ + offset: new FormControl(undefined), + href: new FormControl(undefined), + total: new FormControl(undefined), + next: new FormControl(undefined), + prev: new FormControl(undefined), + limit: new FormControl(undefined), + }); + + } + + + /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ + export interface SuppressViolationRequest { + + /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ + listingId?: string | null; + } + + /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ + export interface SuppressViolationRequestFormProperties { + + /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ + complianceType: FormControl, + + /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ + listingId: FormControl, + } + export function CreateSuppressViolationRequestFormGroup() { + return new FormGroup({ + complianceType: new FormControl(undefined), + listingId: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * Get listing_violation_summary + * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * @return {void} Success + */ + GetListingViolationsSummary(compliance_type: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. + * Get listing_violation + * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. + * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) + * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. + * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 + * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} + * @return {void} Success + */ + GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. + * Post suppress_listing_violation + * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. + * @return {void} + */ + SuppressViolation(requestBody: SuppressViolationRequest): Observable> { + return this.http.post(this.baseUri + 'suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_finances.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_finances.ts similarity index 99% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_finances.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_finances.ts index ed9690e6..4f872429 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_finances.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_finances.ts @@ -1,765 +1,765 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - export interface Amount { - - /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ - value?: string | null; - } - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - export interface AmountFormProperties { - - /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ - currency: FormControl, - - /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ - value: FormControl, - } - export function CreateAmountFormGroup() { - return new FormGroup({ - currency: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - export interface Buyer { - - /** The eBay user ID of the order's buyer. */ - username?: string | null; - } - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - export interface BuyerFormProperties { - - /** The eBay user ID of the order's buyer. */ - username: FormControl, - } - export function CreateBuyerFormGroup() { - return new FormGroup({ - username: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - /** This type defines the fields that can be returned in an error. */ - export interface ErrorFormProperties { - - /** Identifies the type of erro. */ - category: FormControl, - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain: FormControl, - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A more detailed explanation of the error. */ - longMessage: FormControl, - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message: FormControl, - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - export interface ErrorParameterFormProperties { - - /** The object of the error. */ - name: FormControl, - - /** The value of the object. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ - export interface Payout { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ - payoutDate?: string | null; - - /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ - payoutId?: string | null; - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - payoutInstrument?: PayoutInstrument; - - /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ - payoutStatus?: string | null; - - /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ - payoutStatusDescription?: string | null; - - /** - * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ - export interface PayoutFormProperties { - - /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ - payoutDate: FormControl, - - /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ - payoutId: FormControl, - - /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ - payoutStatus: FormControl, - - /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ - payoutStatusDescription: FormControl, - - /** - * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount: FormControl, - } - export function CreatePayoutFormGroup() { - return new FormGroup({ - payoutDate: new FormControl(undefined), - payoutId: new FormControl(undefined), - payoutStatus: new FormControl(undefined), - payoutStatusDescription: new FormControl(undefined), - transactionCount: new FormControl(undefined), - }); - - } - - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - export interface PayoutInstrument { - - /** This string value is the last four digits of the seller's account number. */ - accountLastFourDigits?: string | null; - - /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ - instrumentType?: string | null; - - /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ - nickname?: string | null; - } - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - export interface PayoutInstrumentFormProperties { - - /** This string value is the last four digits of the seller's account number. */ - accountLastFourDigits: FormControl, - - /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ - instrumentType: FormControl, - - /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ - nickname: FormControl, - } - export function CreatePayoutInstrumentFormGroup() { - return new FormGroup({ - accountLastFourDigits: new FormControl(undefined), - instrumentType: new FormControl(undefined), - nickname: new FormControl(undefined), - }); - - } - - - /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ - export interface PayoutSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** - * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - payoutCount?: number | null; - - /** - * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ - export interface PayoutSummaryResponseFormProperties { - - /** - * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - payoutCount: FormControl, - - /** - * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount: FormControl, - } - export function CreatePayoutSummaryResponseFormGroup() { - return new FormGroup({ - payoutCount: new FormControl(undefined), - transactionCount: new FormControl(undefined), - }); - - } - - - /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ - export interface Payouts { - - /** The URI of the getPayouts call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ - payouts?: Array; - - /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ - export interface PayoutsFormProperties { - - /** The URI of the getPayouts call request that produced the current page of the result set. */ - href: FormControl, - - /** - * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next: FormControl, - - /** - * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev: FormControl, - - /** - * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreatePayoutsFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ - export interface SellerFundsSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - availableFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - fundsOnHold?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - processingFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - totalFunds?: Amount; - } - - /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ - export interface SellerFundsSummaryResponseFormProperties { - } - export function CreateSellerFundsSummaryResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ - export interface Transaction { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ - bookingEntry?: string | null; - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - buyer?: Buyer; - - /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ - orderId?: string | null; - - /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ - payoutId?: string | null; - - /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ - salesRecordReference?: string | null; - - /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ - transactionDate?: string | null; - - /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ - transactionId?: string | null; - - /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ - transactionMemo?: string | null; - - /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ - transactionStatus?: string | null; - - /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ - transactionType?: string | null; - } - - /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ - export interface TransactionFormProperties { - - /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ - bookingEntry: FormControl, - - /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ - orderId: FormControl, - - /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ - payoutId: FormControl, - - /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ - salesRecordReference: FormControl, - - /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ - transactionDate: FormControl, - - /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ - transactionId: FormControl, - - /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ - transactionMemo: FormControl, - - /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ - transactionStatus: FormControl, - - /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ - transactionType: FormControl, - } - export function CreateTransactionFormGroup() { - return new FormGroup({ - bookingEntry: new FormControl(undefined), - orderId: new FormControl(undefined), - payoutId: new FormControl(undefined), - salesRecordReference: new FormControl(undefined), - transactionDate: new FormControl(undefined), - transactionId: new FormControl(undefined), - transactionMemo: new FormControl(undefined), - transactionStatus: new FormControl(undefined), - transactionType: new FormControl(undefined), - }); - - } - - - /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ - export interface TransactionSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - creditAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ - creditBookingEntry?: string | null; - - /** - * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - creditCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - disputeAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ - disputeBookingEntry?: string | null; - - /** - * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - disputeCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - onHoldAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ - onHoldBookingEntry?: string | null; - - /** - * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - onHoldCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - refundAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ - refundBookingEntry?: string | null; - - /** - * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - refundCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - shippingLabelAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ - shippingLabelBookingEntry?: string | null; - - /** - * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - shippingLabelCount?: number | null; - } - - /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ - export interface TransactionSummaryResponseFormProperties { - - /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ - creditBookingEntry: FormControl, - - /** - * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - creditCount: FormControl, - - /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ - disputeBookingEntry: FormControl, - - /** - * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - disputeCount: FormControl, - - /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ - onHoldBookingEntry: FormControl, - - /** - * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - onHoldCount: FormControl, - - /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ - refundBookingEntry: FormControl, - - /** - * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - refundCount: FormControl, - - /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ - shippingLabelBookingEntry: FormControl, - - /** - * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - shippingLabelCount: FormControl, - } - export function CreateTransactionSummaryResponseFormGroup() { - return new FormGroup({ - creditBookingEntry: new FormControl(undefined), - creditCount: new FormControl(undefined), - disputeBookingEntry: new FormControl(undefined), - disputeCount: new FormControl(undefined), - onHoldBookingEntry: new FormControl(undefined), - onHoldCount: new FormControl(undefined), - refundBookingEntry: new FormControl(undefined), - refundCount: new FormControl(undefined), - shippingLabelBookingEntry: new FormControl(undefined), - shippingLabelCount: new FormControl(undefined), - }); - - } - - - /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ - export interface Transactions { - - /** The URI of the getTransactions method request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ - transactions?: Array; - } - - /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ - export interface TransactionsFormProperties { - - /** The URI of the getTransactions method request that produced the current page of the result set. */ - href: FormControl, - - /** - * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next: FormControl, - - /** - * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev: FormControl, - - /** - * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateTransactionsFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. - * Get payout/{payout_Id} - * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. - * @return {Payout} Success - */ - GetPayout(payout_Id: string): Observable { - return this.http.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}); - } - - /** - * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. - * Get payout - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) - * @return {Payouts} Success - */ - GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. - * Get payout_summary - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {PayoutSummaryResponse} Success - */ - GetPayoutSummary(filter: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. - * Get transaction - * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * @return {Transactions} Success - */ - GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). - * Get transaction_summary - * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {TransactionSummaryResponse} Success - */ - GetTransactionSummary(filter: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. - * Get seller_funds_summary - * @return {SellerFundsSummaryResponse} Success - */ - GetSellerFundsSummary(): Observable { - return this.http.get(this.baseUri + 'seller_funds_summary', {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + export interface Amount { + + /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ + value?: string | null; + } + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + export interface AmountFormProperties { + + /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ + currency: FormControl, + + /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ + value: FormControl, + } + export function CreateAmountFormGroup() { + return new FormGroup({ + currency: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + export interface Buyer { + + /** The eBay user ID of the order's buyer. */ + username?: string | null; + } + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + export interface BuyerFormProperties { + + /** The eBay user ID of the order's buyer. */ + username: FormControl, + } + export function CreateBuyerFormGroup() { + return new FormGroup({ + username: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + /** This type defines the fields that can be returned in an error. */ + export interface ErrorFormProperties { + + /** Identifies the type of erro. */ + category: FormControl, + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain: FormControl, + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A more detailed explanation of the error. */ + longMessage: FormControl, + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message: FormControl, + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + export interface ErrorParameterFormProperties { + + /** The object of the error. */ + name: FormControl, + + /** The value of the object. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ + export interface Payout { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ + payoutDate?: string | null; + + /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ + payoutId?: string | null; + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + payoutInstrument?: PayoutInstrument; + + /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ + payoutStatus?: string | null; + + /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ + payoutStatusDescription?: string | null; + + /** + * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ + export interface PayoutFormProperties { + + /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ + payoutDate: FormControl, + + /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ + payoutId: FormControl, + + /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ + payoutStatus: FormControl, + + /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ + payoutStatusDescription: FormControl, + + /** + * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount: FormControl, + } + export function CreatePayoutFormGroup() { + return new FormGroup({ + payoutDate: new FormControl(undefined), + payoutId: new FormControl(undefined), + payoutStatus: new FormControl(undefined), + payoutStatusDescription: new FormControl(undefined), + transactionCount: new FormControl(undefined), + }); + + } + + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + export interface PayoutInstrument { + + /** This string value is the last four digits of the seller's account number. */ + accountLastFourDigits?: string | null; + + /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ + instrumentType?: string | null; + + /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ + nickname?: string | null; + } + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + export interface PayoutInstrumentFormProperties { + + /** This string value is the last four digits of the seller's account number. */ + accountLastFourDigits: FormControl, + + /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ + instrumentType: FormControl, + + /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ + nickname: FormControl, + } + export function CreatePayoutInstrumentFormGroup() { + return new FormGroup({ + accountLastFourDigits: new FormControl(undefined), + instrumentType: new FormControl(undefined), + nickname: new FormControl(undefined), + }); + + } + + + /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ + export interface PayoutSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** + * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + payoutCount?: number | null; + + /** + * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ + export interface PayoutSummaryResponseFormProperties { + + /** + * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + payoutCount: FormControl, + + /** + * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount: FormControl, + } + export function CreatePayoutSummaryResponseFormGroup() { + return new FormGroup({ + payoutCount: new FormControl(undefined), + transactionCount: new FormControl(undefined), + }); + + } + + + /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ + export interface Payouts { + + /** The URI of the getPayouts call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ + payouts?: Array; + + /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ + export interface PayoutsFormProperties { + + /** The URI of the getPayouts call request that produced the current page of the result set. */ + href: FormControl, + + /** + * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next: FormControl, + + /** + * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev: FormControl, + + /** + * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreatePayoutsFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ + export interface SellerFundsSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + availableFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + fundsOnHold?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + processingFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + totalFunds?: Amount; + } + + /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ + export interface SellerFundsSummaryResponseFormProperties { + } + export function CreateSellerFundsSummaryResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ + export interface Transaction { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ + bookingEntry?: string | null; + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + buyer?: Buyer; + + /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ + orderId?: string | null; + + /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ + payoutId?: string | null; + + /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ + salesRecordReference?: string | null; + + /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ + transactionDate?: string | null; + + /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ + transactionId?: string | null; + + /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ + transactionMemo?: string | null; + + /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ + transactionStatus?: string | null; + + /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ + transactionType?: string | null; + } + + /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ + export interface TransactionFormProperties { + + /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ + bookingEntry: FormControl, + + /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ + orderId: FormControl, + + /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ + payoutId: FormControl, + + /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ + salesRecordReference: FormControl, + + /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ + transactionDate: FormControl, + + /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ + transactionId: FormControl, + + /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ + transactionMemo: FormControl, + + /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ + transactionStatus: FormControl, + + /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ + transactionType: FormControl, + } + export function CreateTransactionFormGroup() { + return new FormGroup({ + bookingEntry: new FormControl(undefined), + orderId: new FormControl(undefined), + payoutId: new FormControl(undefined), + salesRecordReference: new FormControl(undefined), + transactionDate: new FormControl(undefined), + transactionId: new FormControl(undefined), + transactionMemo: new FormControl(undefined), + transactionStatus: new FormControl(undefined), + transactionType: new FormControl(undefined), + }); + + } + + + /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ + export interface TransactionSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + creditAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ + creditBookingEntry?: string | null; + + /** + * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + creditCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + disputeAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ + disputeBookingEntry?: string | null; + + /** + * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + disputeCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + onHoldAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ + onHoldBookingEntry?: string | null; + + /** + * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + onHoldCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + refundAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ + refundBookingEntry?: string | null; + + /** + * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + refundCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + shippingLabelAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ + shippingLabelBookingEntry?: string | null; + + /** + * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + shippingLabelCount?: number | null; + } + + /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ + export interface TransactionSummaryResponseFormProperties { + + /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ + creditBookingEntry: FormControl, + + /** + * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + creditCount: FormControl, + + /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ + disputeBookingEntry: FormControl, + + /** + * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + disputeCount: FormControl, + + /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ + onHoldBookingEntry: FormControl, + + /** + * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + onHoldCount: FormControl, + + /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ + refundBookingEntry: FormControl, + + /** + * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + refundCount: FormControl, + + /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ + shippingLabelBookingEntry: FormControl, + + /** + * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + shippingLabelCount: FormControl, + } + export function CreateTransactionSummaryResponseFormGroup() { + return new FormGroup({ + creditBookingEntry: new FormControl(undefined), + creditCount: new FormControl(undefined), + disputeBookingEntry: new FormControl(undefined), + disputeCount: new FormControl(undefined), + onHoldBookingEntry: new FormControl(undefined), + onHoldCount: new FormControl(undefined), + refundBookingEntry: new FormControl(undefined), + refundCount: new FormControl(undefined), + shippingLabelBookingEntry: new FormControl(undefined), + shippingLabelCount: new FormControl(undefined), + }); + + } + + + /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ + export interface Transactions { + + /** The URI of the getTransactions method request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ + transactions?: Array; + } + + /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ + export interface TransactionsFormProperties { + + /** The URI of the getTransactions method request that produced the current page of the result set. */ + href: FormControl, + + /** + * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next: FormControl, + + /** + * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev: FormControl, + + /** + * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateTransactionsFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. + * Get payout/{payout_Id} + * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. + * @return {Payout} Success + */ + GetPayout(payout_Id: string): Observable { + return this.http.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}); + } + + /** + * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. + * Get payout + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) + * @return {Payouts} Success + */ + GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. + * Get payout_summary + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {PayoutSummaryResponse} Success + */ + GetPayoutSummary(filter: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. + * Get transaction + * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * @return {Transactions} Success + */ + GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). + * Get transaction_summary + * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {TransactionSummaryResponse} Success + */ + GetTransactionSummary(filter: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. + * Get seller_funds_summary + * @return {SellerFundsSummaryResponse} Success + */ + GetSellerFundsSummary(): Observable { + return this.http.get(this.baseUri + 'seller_funds_summary', {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_inventory.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_inventory.ts similarity index 99% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_inventory.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_inventory.ts index 983c4289..9e2b61a7 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_inventory.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_inventory.ts @@ -1,3455 +1,3455 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** This type is used to define the physical address of an inventory location. */ - export interface Address { - - /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine1?: string | null; - - /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine2?: string | null; - - /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ - city?: string | null; - - /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ - country?: string | null; - - /** The county in which the address resides. This field is returned if defined for an inventory location. */ - county?: string | null; - - /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ - postalCode?: string | null; - - /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ - stateOrProvince?: string | null; - } - - /** This type is used to define the physical address of an inventory location. */ - export interface AddressFormProperties { - - /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine1: FormControl, - - /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine2: FormControl, - - /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ - city: FormControl, - - /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ - country: FormControl, - - /** The county in which the address resides. This field is returned if defined for an inventory location. */ - county: FormControl, - - /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ - postalCode: FormControl, - - /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ - stateOrProvince: FormControl, - } - export function CreateAddressFormGroup() { - return new FormGroup({ - addressLine1: new FormControl(undefined), - addressLine2: new FormControl(undefined), - city: new FormControl(undefined), - country: new FormControl(undefined), - county: new FormControl(undefined), - postalCode: new FormControl(undefined), - stateOrProvince: new FormControl(undefined), - }); - - } - - - /** This type is used to express a dollar value and the applicable currency. */ - export interface Amount { - - /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ - currency?: string | null; - - /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ - value?: string | null; - } - - /** This type is used to express a dollar value and the applicable currency. */ - export interface AmountFormProperties { - - /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ - currency: FormControl, - - /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ - value: FormControl, - } - export function CreateAmountFormGroup() { - return new FormGroup({ - currency: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - export interface Availability { - - /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - pickupAtLocationAvailability?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - } - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - export interface AvailabilityFormProperties { - } - export function CreateAvailabilityFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ - export interface PickupAtLocationAvailability { - - /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ - availabilityType?: string | null; - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - fulfillmentTime?: TimeDuration; - - /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ - merchantLocationKey?: string | null; - - /** - * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ - export interface PickupAtLocationAvailabilityFormProperties { - - /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ - availabilityType: FormControl, - - /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ - merchantLocationKey: FormControl, - - /** - * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity: FormControl, - } - export function CreatePickupAtLocationAvailabilityFormGroup() { - return new FormGroup({ - availabilityType: new FormControl(undefined), - merchantLocationKey: new FormControl(undefined), - quantity: new FormControl(undefined), - }); - - } - - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - export interface TimeDuration { - - /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - export interface TimeDurationFormProperties { - - /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** - * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value: FormControl, - } - export function CreateTimeDurationFormGroup() { - return new FormGroup({ - unit: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - export interface ShipToLocationAvailability { - - /** - * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - export interface ShipToLocationAvailabilityFormProperties { - - /** - * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity: FormControl, - } - export function CreateShipToLocationAvailabilityFormGroup() { - return new FormGroup({ - quantity: new FormControl(undefined), - }); - - } - - - /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ - export interface BaseResponse { - - /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ - warnings?: Array; - } - - /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ - export interface BaseResponseFormProperties { - } - export function CreateBaseResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ - export interface Error { - - /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ - category?: string | null; - - /** The name of the domain in which the error or warning occurred. */ - domain?: string | null; - - /** - * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ - longMessage?: string | null; - - /** A description of the condition that caused the error or warning. */ - message?: string | null; - - /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ - outputRefIds?: Array; - - /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. */ - subdomain?: string | null; - } - - /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ - export interface ErrorFormProperties { - - /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ - category: FormControl, - - /** The name of the domain in which the error or warning occurred. */ - domain: FormControl, - - /** - * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ - longMessage: FormControl, - - /** A description of the condition that caused the error or warning. */ - message: FormControl, - - /** The name of the subdomain in which the error or warning occurred. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - - /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ - export interface ErrorParameter { - - /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ - name?: string | null; - - /** This is the actual value that was passed in for the element specified in the name field. */ - value?: string | null; - } - - /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ - export interface ErrorParameterFormProperties { - - /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ - name: FormControl, - - /** This is the actual value that was passed in for the element specified in the name field. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - export interface BestOffer { - - /** This type is used to express a dollar value and the applicable currency. */ - autoAcceptPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - autoDeclinePrice?: Amount; - - /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ - bestOfferEnabled?: boolean | null; - } - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - export interface BestOfferFormProperties { - - /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ - bestOfferEnabled: FormControl, - } - export function CreateBestOfferFormGroup() { - return new FormGroup({ - bestOfferEnabled: new FormControl(undefined), - }); - - } - - - /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ - export interface BulkEbayOfferDetailsWithKeys { - - /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ - requests?: Array; - } - - /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ - export interface BulkEbayOfferDetailsWithKeysFormProperties { - } - export function CreateBulkEbayOfferDetailsWithKeysFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ - export interface EbayOfferDetailsWithKeys { - - /** - * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ - export interface EbayOfferDetailsWithKeysFormProperties { - - /** - * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity: FormControl, - - /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ - categoryId: FormControl, - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ - format: FormControl, - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription: FormControl, - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration: FormControl, - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize: FormControl, - - /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey: FormControl, - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer: FormControl, - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku: FormControl, - } - export function CreateEbayOfferDetailsWithKeysFormGroup() { - return new FormGroup({ - availableQuantity: new FormControl(undefined), - categoryId: new FormControl(undefined), - format: new FormControl(undefined), - listingDescription: new FormControl(undefined), - listingDuration: new FormControl(undefined), - lotSize: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - merchantLocationKey: new FormControl(undefined), - quantityLimitPerBuyer: new FormControl(undefined), - sku: new FormControl(undefined), - }); - - } - - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - - /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ - donationPercentage?: string | null; - } - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface CharityFormProperties { - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId: FormControl, - - /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ - donationPercentage: FormControl, - } - export function CreateCharityFormGroup() { - return new FormGroup({ - charityId: new FormControl(undefined), - donationPercentage: new FormControl(undefined), - }); - - } - - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - export interface ListingPolicies { - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - bestOfferTerms?: BestOffer; - - /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - eBayPlusIfEligible?: boolean | null; - - /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - fulfillmentPolicyId?: string | null; - - /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - paymentPolicyId?: string | null; - - /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - returnPolicyId?: string | null; - - /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ - shippingCostOverrides?: Array; - } - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - export interface ListingPoliciesFormProperties { - - /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - eBayPlusIfEligible: FormControl, - - /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - fulfillmentPolicyId: FormControl, - - /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - paymentPolicyId: FormControl, - - /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - returnPolicyId: FormControl, - } - export function CreateListingPoliciesFormGroup() { - return new FormGroup({ - eBayPlusIfEligible: new FormControl(undefined), - fulfillmentPolicyId: new FormControl(undefined), - paymentPolicyId: new FormControl(undefined), - returnPolicyId: new FormControl(undefined), - }); - - } - - - /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ - export interface ShippingCostOverride { - - /** This type is used to express a dollar value and the applicable currency. */ - additionalShippingCost?: Amount; - - /** - * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - priority?: number | null; - - /** This type is used to express a dollar value and the applicable currency. */ - shippingCost?: Amount; - - /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ - shippingServiceType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - surcharge?: Amount; - } - - /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ - export interface ShippingCostOverrideFormProperties { - - /** - * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - priority: FormControl, - - /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ - shippingServiceType: FormControl, - } - export function CreateShippingCostOverrideFormGroup() { - return new FormGroup({ - priority: new FormControl(undefined), - shippingServiceType: new FormControl(undefined), - }); - - } - - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - export interface PricingSummary { - - /** This type is used to express a dollar value and the applicable currency. */ - minimumAdvertisedPrice?: Amount; - - /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - originallySoldForRetailPriceOn?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - originalRetailPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - - /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - pricingVisibility?: string | null; - } - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - export interface PricingSummaryFormProperties { - - /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - originallySoldForRetailPriceOn: FormControl, - - /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - pricingVisibility: FormControl, - } - export function CreatePricingSummaryFormGroup() { - return new FormGroup({ - originallySoldForRetailPriceOn: new FormControl(undefined), - pricingVisibility: new FormControl(undefined), - }); - - } - - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - export interface Tax { - - /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ - applyTax?: boolean | null; - - /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ - thirdPartyTaxCategory?: string | null; - - /** - * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. - * Type: double - */ - vatPercentage?: number | null; - } - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - export interface TaxFormProperties { - - /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ - applyTax: FormControl, - - /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ - thirdPartyTaxCategory: FormControl, - - /** - * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. - * Type: double - */ - vatPercentage: FormControl, - } - export function CreateTaxFormGroup() { - return new FormGroup({ - applyTax: new FormControl(undefined), - thirdPartyTaxCategory: new FormControl(undefined), - vatPercentage: new FormControl(undefined), - }); - - } - - - /** This type is used by the base request of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItem { - - /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ - requests?: Array; - } - - /** This type is used by the base request of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemFormProperties { - } - export function CreateBulkGetInventoryItemFormGroup() { - return new FormGroup({ - }); - - } - - - /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ - export interface GetInventoryItem { - - /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ - sku?: string | null; - } - - /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ - export interface GetInventoryItemFormProperties { - - /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ - sku: FormControl, - } - export function CreateGetInventoryItemFormGroup() { - return new FormGroup({ - sku: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemResponse { - - /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ - responses?: Array; - } - - /** This type is used by the base response of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemResponseFormProperties { - } - export function CreateBulkGetInventoryItemResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ - export interface GetInventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ - errors?: Array; - - /** This type is used to provide details about each retrieved inventory item record. */ - inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ - warnings?: Array; - } - - /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ - export interface GetInventoryItemResponseFormProperties { - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku: FormControl, - - /** - * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateGetInventoryItemResponseFormGroup() { - return new FormGroup({ - sku: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type is used to provide details about each retrieved inventory item record. */ - export interface InventoryItemWithSkuLocaleGroupKeys { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - /** This type is used to provide details about each retrieved inventory item record. */ - export interface InventoryItemWithSkuLocaleGroupKeysFormProperties { - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition: FormControl, - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ - conditionDescription: FormControl, - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale: FormControl, - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku: FormControl, - } - export function CreateInventoryItemWithSkuLocaleGroupKeysFormGroup() { - return new FormGroup({ - condition: new FormControl(undefined), - conditionDescription: new FormControl(undefined), - locale: new FormControl(undefined), - sku: new FormControl(undefined), - }); - - } - - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface PackageWeightAndSize { - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - dimensions?: Dimension; - - /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ - packageType?: string | null; - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - weight?: Weight; - } - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface PackageWeightAndSizeFormProperties { - - /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ - packageType: FormControl, - } - export function CreatePackageWeightAndSizeFormGroup() { - return new FormGroup({ - packageType: new FormControl(undefined), - }); - - } - - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Dimension { - - /** - * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - height?: number | null; - - /** - * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - length?: number | null; - - /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - width?: number | null; - } - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - export interface DimensionFormProperties { - - /** - * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - height: FormControl, - - /** - * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - length: FormControl, - - /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** - * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - width: FormControl, - } - export function CreateDimensionFormGroup() { - return new FormGroup({ - height: new FormControl(undefined), - length: new FormControl(undefined), - unit: new FormControl(undefined), - width: new FormControl(undefined), - }); - - } - - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Weight { - - /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } - * Type: double - */ - value?: number | null; - } - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface WeightFormProperties { - - /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** - * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } - * Type: double - */ - value: FormControl, - } - export function CreateWeightFormGroup() { - return new FormGroup({ - unit: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - export interface Product { - - /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ - aspects?: Array; - - /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ - brand?: string | null; - - /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ - description?: string | null; - - /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ - ean?: Array; - - /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ - epid?: string | null; - - /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ - imageUrls?: Array; - - /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ - isbn?: Array; - - /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ - mpn?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ - title?: string | null; - - /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ - upc?: Array; - } - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - export interface ProductFormProperties { - - /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ - brand: FormControl, - - /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ - description: FormControl, - - /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ - epid: FormControl, - - /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ - mpn: FormControl, - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle: FormControl, - - /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ - title: FormControl, - } - export function CreateProductFormGroup() { - return new FormGroup({ - brand: new FormControl(undefined), - description: new FormControl(undefined), - epid: new FormControl(undefined), - mpn: new FormControl(undefined), - subtitle: new FormControl(undefined), - title: new FormControl(undefined), - }); - - } - - - /** The base request of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItem { - - /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ - requests?: Array; - } - - /** The base request of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemFormProperties { - } - export function CreateBulkInventoryItemFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ - export interface InventoryItemWithSkuLocale { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - } - - /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ - export interface InventoryItemWithSkuLocaleFormProperties { - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition: FormControl, - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription: FormControl, - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale: FormControl, - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku: FormControl, - } - export function CreateInventoryItemWithSkuLocaleFormGroup() { - return new FormGroup({ - condition: new FormControl(undefined), - conditionDescription: new FormControl(undefined), - locale: new FormControl(undefined), - sku: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemResponse { - - /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ - responses?: Array; - } - - /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemResponseFormProperties { - } - export function CreateBulkInventoryItemResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ - export interface InventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ - errors?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ - warnings?: Array; - } - - /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ - export interface InventoryItemResponseFormProperties { - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale: FormControl, - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku: FormControl, - - /** - * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateInventoryItemResponseFormGroup() { - return new FormGroup({ - locale: new FormControl(undefined), - sku: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type is used by the base container of the bulkMigrateListings request payload. */ - export interface BulkMigrateListing { - - /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ - requests?: Array; - } - - /** This type is used by the base container of the bulkMigrateListings request payload. */ - export interface BulkMigrateListingFormProperties { - } - export function CreateBulkMigrateListingFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ - export interface MigrateListing { - - /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ - listingId?: string | null; - } - - /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ - export interface MigrateListingFormProperties { - - /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ - listingId: FormControl, - } - export function CreateMigrateListingFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - }); - - } - - - /** This type is used by the response payload of the bulkMigrateListings call. */ - export interface BulkMigrateListingResponse { - - /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ - responses?: Array; - } - - /** This type is used by the response payload of the bulkMigrateListings call. */ - export interface BulkMigrateListingResponseFormProperties { - } - export function CreateBulkMigrateListingResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to display the results of each listing that the seller attempted to migrate. */ - export interface MigrateListingResponse { - - /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ - errors?: Array; - - /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ - inventoryItemGroupKey?: string | null; - - /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ - inventoryItems?: Array; - - /** The unique identifier of the eBay listing that the seller attempted to migrate. */ - listingId?: string | null; - - /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ - warnings?: Array; - } - - /** This type is used to display the results of each listing that the seller attempted to migrate. */ - export interface MigrateListingResponseFormProperties { - - /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ - inventoryItemGroupKey: FormControl, - - /** The unique identifier of the eBay listing that the seller attempted to migrate. */ - listingId: FormControl, - - /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** - * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateMigrateListingResponseFormGroup() { - return new FormGroup({ - inventoryItemGroupKey: new FormControl(undefined), - listingId: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ - export interface InventoryItemListing { - - /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ - offerId?: string | null; - - /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ - sku?: string | null; - } - - /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ - export interface InventoryItemListingFormProperties { - - /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ - offerId: FormControl, - - /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ - sku: FormControl, - } - export function CreateInventoryItemListingFormGroup() { - return new FormGroup({ - offerId: new FormControl(undefined), - sku: new FormControl(undefined), - }); - - } - - - /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ - export interface BulkOffer { - - /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ - requests?: Array; - } - - /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ - export interface BulkOfferFormProperties { - } - export function CreateBulkOfferFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ - export interface OfferKeyWithId { - - /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ - offerId?: string | null; - } - - /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ - export interface OfferKeyWithIdFormProperties { - - /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ - offerId: FormControl, - } - export function CreateOfferKeyWithIdFormGroup() { - return new FormGroup({ - offerId: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response of the bulkCreateOffer method. */ - export interface BulkOfferResponse { - - /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ - responses?: Array; - } - - /** This type is used by the base response of the bulkCreateOffer method. */ - export interface BulkOfferResponseFormProperties { - } - export function CreateBulkOfferResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ - export interface OfferSkuResponse { - - /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ - errors?: Array; - - /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ - offerId?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ - sku?: string | null; - - /** - * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ - warnings?: Array; - } - - /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ - export interface OfferSkuResponseFormProperties { - - /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format: FormControl, - - /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ - offerId: FormControl, - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ - sku: FormControl, - - /** - * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateOfferSkuResponseFormGroup() { - return new FormGroup({ - format: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - offerId: new FormControl(undefined), - sku: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - export interface BulkPriceQuantity { - - /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - requests?: Array; - } - - /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - export interface BulkPriceQuantityFormProperties { - } - export function CreateBulkPriceQuantityFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ - export interface PriceQuantity { - - /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ - offers?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - - /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ - sku?: string | null; - } - - /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ - export interface PriceQuantityFormProperties { - - /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ - sku: FormControl, - } - export function CreatePriceQuantityFormGroup() { - return new FormGroup({ - sku: new FormControl(undefined), - }); - - } - - - /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ - export interface OfferPriceQuantity { - - /** - * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ - offerId?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - } - - /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ - export interface OfferPriceQuantityFormProperties { - - /** - * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity: FormControl, - - /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ - offerId: FormControl, - } - export function CreateOfferPriceQuantityFormGroup() { - return new FormGroup({ - availableQuantity: new FormControl(undefined), - offerId: new FormControl(undefined), - }); - - } - - - /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - export interface BulkPriceQuantityResponse { - - /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - responses?: Array; - } - - /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - export interface BulkPriceQuantityResponseFormProperties { - } - export function CreateBulkPriceQuantityResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ - export interface PriceQuantityResponse { - - /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ - errors?: Array; - - /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ - offerId?: string | null; - - /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ - sku?: string | null; - - /** - * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ - warnings?: Array; - } - - /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ - export interface PriceQuantityResponseFormProperties { - - /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ - offerId: FormControl, - - /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ - sku: FormControl, - - /** - * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreatePriceQuantityResponseFormGroup() { - return new FormGroup({ - offerId: new FormControl(undefined), - sku: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response of the bulkPublishOffer method. */ - export interface BulkPublishResponse { - - /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ - responses?: Array; - } - - /** This type is used by the base response of the bulkPublishOffer method. */ - export interface BulkPublishResponseFormProperties { - } - export function CreateBulkPublishResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ - export interface OfferResponseWithListingId { - - /** This container will be returned if there were one or more errors associated with publishing the offer. */ - errors?: Array; - - /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ - listingId?: string | null; - - /** The unique identifier of the offer that the seller published (or attempted to publish). */ - offerId?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with publishing the offer. */ - warnings?: Array; - } - - /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ - export interface OfferResponseWithListingIdFormProperties { - - /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ - listingId: FormControl, - - /** The unique identifier of the offer that the seller published (or attempted to publish). */ - offerId: FormControl, - - /** - * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateOfferResponseWithListingIdFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - offerId: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ - export interface Compatibility { - - /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ - compatibleProducts?: Array; - - /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ - sku?: string | null; - } - - /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ - export interface CompatibilityFormProperties { - - /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ - sku: FormControl, - } - export function CreateCompatibilityFormGroup() { - return new FormGroup({ - sku: new FormControl(undefined), - }); - - } - - - /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ - export interface CompatibleProduct { - - /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ - compatibilityProperties?: Array; - - /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ - notes?: string | null; - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - productFamilyProperties?: ProductFamilyProperties; - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - productIdentifier?: ProductIdentifier; - } - - /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ - export interface CompatibleProductFormProperties { - - /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ - notes: FormControl, - } - export function CreateCompatibleProductFormGroup() { - return new FormGroup({ - notes: new FormControl(undefined), - }); - - } - - - /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ - export interface NameValueList { - - /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ - name?: string | null; - - /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ - value?: string | null; - } - - /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ - export interface NameValueListFormProperties { - - /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ - name: FormControl, - - /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ - value: FormControl, - } - export function CreateNameValueListFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - export interface ProductFamilyProperties { - - /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ - engine?: string | null; - - /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ - make?: string | null; - - /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ - model?: string | null; - - /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ - trim?: string | null; - - /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ - year?: string | null; - } - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - export interface ProductFamilyPropertiesFormProperties { - - /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ - engine: FormControl, - - /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ - make: FormControl, - - /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ - model: FormControl, - - /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ - trim: FormControl, - - /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ - year: FormControl, - } - export function CreateProductFamilyPropertiesFormGroup() { - return new FormGroup({ - engine: new FormControl(undefined), - make: new FormControl(undefined), - model: new FormControl(undefined), - trim: new FormControl(undefined), - year: new FormControl(undefined), - }); - - } - - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - export interface ProductIdentifier { - - /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ - epid?: string | null; - - /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ - gtin?: string | null; - - /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ - ktype?: string | null; - } - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - export interface ProductIdentifierFormProperties { - - /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ - epid: FormControl, - - /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ - gtin: FormControl, - - /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ - ktype: FormControl, - } - export function CreateProductIdentifierFormGroup() { - return new FormGroup({ - epid: new FormControl(undefined), - gtin: new FormControl(undefined), - ktype: new FormControl(undefined), - }); - - } - - - /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ - export interface EbayOfferDetailsWithAll { - - /** - * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - listing?: ListingDetails; - - /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ - merchantLocationKey?: string | null; - - /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ - offerId?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ - sku?: string | null; - - /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ - export interface EbayOfferDetailsWithAllFormProperties { - - /** - * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity: FormControl, - - /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ - categoryId: FormControl, - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format: FormControl, - - /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ - listingDescription: FormControl, - - /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ - listingDuration: FormControl, - - /** - * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize: FormControl, - - /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ - merchantLocationKey: FormControl, - - /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ - offerId: FormControl, - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer: FormControl, - - /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ - sku: FormControl, - - /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ - status: FormControl, - } - export function CreateEbayOfferDetailsWithAllFormGroup() { - return new FormGroup({ - availableQuantity: new FormControl(undefined), - categoryId: new FormControl(undefined), - format: new FormControl(undefined), - listingDescription: new FormControl(undefined), - listingDuration: new FormControl(undefined), - lotSize: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - merchantLocationKey: new FormControl(undefined), - offerId: new FormControl(undefined), - quantityLimitPerBuyer: new FormControl(undefined), - sku: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - export interface ListingDetails { - - /** The unique identifier of the eBay listing that is associated with the published offer. */ - listingId?: string | null; - - /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ - listingStatus?: string | null; - - /** - * This integer value indicates the quantity of the product that has been sold for the published offer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - soldQuantity?: number | null; - } - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - export interface ListingDetailsFormProperties { - - /** The unique identifier of the eBay listing that is associated with the published offer. */ - listingId: FormControl, - - /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ - listingStatus: FormControl, - - /** - * This integer value indicates the quantity of the product that has been sold for the published offer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - soldQuantity: FormControl, - } - export function CreateListingDetailsFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - listingStatus: new FormControl(undefined), - soldQuantity: new FormControl(undefined), - }); - - } - - - /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ - export interface EbayOfferDetailsWithId { - - /** - * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ - export interface EbayOfferDetailsWithIdFormProperties { - - /** - * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity: FormControl, - - /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ - categoryId: FormControl, - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription: FormControl, - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration: FormControl, - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize: FormControl, - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey: FormControl, - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer: FormControl, - } - export function CreateEbayOfferDetailsWithIdFormGroup() { - return new FormGroup({ - availableQuantity: new FormControl(undefined), - categoryId: new FormControl(undefined), - listingDescription: new FormControl(undefined), - listingDuration: new FormControl(undefined), - lotSize: new FormControl(undefined), - merchantLocationKey: new FormControl(undefined), - quantityLimitPerBuyer: new FormControl(undefined), - }); - - } - - - /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ - export interface Fee { - - /** This type is used to express a dollar value and the applicable currency. */ - amount?: Amount; - - /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - feeType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - promotionalDiscount?: Amount; - } - - /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ - export interface FeeFormProperties { - - /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - feeType: FormControl, - } - export function CreateFeeFormGroup() { - return new FormGroup({ - feeType: new FormControl(undefined), - }); - - } - - - /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ - export interface FeeSummary { - - /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - fees?: Array; - - /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ - export interface FeeSummaryFormProperties { - - /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - } - export function CreateFeeSummaryFormGroup() { - return new FormGroup({ - marketplaceId: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response payload for the getListingFees call. */ - export interface FeesSummaryResponse { - - /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ - feeSummaries?: Array; - } - - /** This type is used by the base response payload for the getListingFees call. */ - export interface FeesSummaryResponseFormProperties { - } - export function CreateFeesSummaryResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - export interface GeoCoordinates { - - /** - * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - longitude?: number | null; - } - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - export interface GeoCoordinatesFormProperties { - - /** - * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - latitude: FormControl, - - /** - * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - longitude: FormControl, - } - export function CreateGeoCoordinatesFormGroup() { - return new FormGroup({ - latitude: new FormControl(undefined), - longitude: new FormControl(undefined), - }); - - } - - - /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ - export interface Interval { - - /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - close?: string | null; - - /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - open?: string | null; - } - - /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ - export interface IntervalFormProperties { - - /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - close: FormControl, - - /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - open: FormControl, - } - export function CreateIntervalFormGroup() { - return new FormGroup({ - close: new FormControl(undefined), - open: new FormControl(undefined), - }); - - } - - - /** This type is used to provide detailed information about an inventory item. */ - export interface InventoryItem { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - } - - /** This type is used to provide detailed information about an inventory item. */ - export interface InventoryItemFormProperties { - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition: FormControl, - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription: FormControl, - } - export function CreateInventoryItemFormGroup() { - return new FormGroup({ - condition: new FormControl(undefined), - conditionDescription: new FormControl(undefined), - }); - - } - - - /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ - export interface InventoryItemGroup { - - /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ - aspects?: Array; - - /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ - description?: string | null; - - /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ - imageUrls?: Array; - - /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ - inventoryItemGroupKey?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ - title?: string | null; - - /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ - variantSKUs?: Array; - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - variesBy?: VariesBy; - } - - /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ - export interface InventoryItemGroupFormProperties { - - /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ - description: FormControl, - - /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ - inventoryItemGroupKey: FormControl, - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle: FormControl, - - /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ - title: FormControl, - } - export function CreateInventoryItemGroupFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - inventoryItemGroupKey: new FormControl(undefined), - subtitle: new FormControl(undefined), - title: new FormControl(undefined), - }); - - } - - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - export interface VariesBy { - - /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ - aspectsImageVariesBy?: Array; - - /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ - specifications?: Array; - } - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - export interface VariesByFormProperties { - } - export function CreateVariesByFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ - export interface Specification { - - /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ - name?: string | null; - - /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ - values?: Array; - } - - /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ - export interface SpecificationFormProperties { - - /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ - name: FormControl, - } - export function CreateSpecificationFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - }); - - } - - export interface InventoryItemWithSkuLocaleGroupid { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ - groupIds?: Array; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - export interface InventoryItemWithSkuLocaleGroupidFormProperties { - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition: FormControl, - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ - conditionDescription: FormControl, - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale: FormControl, - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku: FormControl, - } - export function CreateInventoryItemWithSkuLocaleGroupidFormGroup() { - return new FormGroup({ - condition: new FormControl(undefined), - conditionDescription: new FormControl(undefined), - locale: new FormControl(undefined), - sku: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response payload of getInventoryItems call. */ - export interface InventoryItems { - - /** This is the URL to the current page of inventory items. */ - href?: string | null; - - /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ - inventoryItems?: Array; - - /** - * This integer value is the number of inventory items that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ - next?: string | null; - - /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ - prev?: string | null; - - /** - * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type is used by the base response payload of getInventoryItems call. */ - export interface InventoryItemsFormProperties { - - /** This is the URL to the current page of inventory items. */ - href: FormControl, - - /** - * This integer value is the number of inventory items that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ - next: FormControl, - - /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ - prev: FormControl, - - /** - * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size: FormControl, - - /** - * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateInventoryItemsFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - prev: new FormControl(undefined), - size: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ - export interface InventoryLocation { - - /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ - locationInstructions?: string | null; - - /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ - locationWebUrl?: string | null; - - /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ - name?: string | null; - - /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ - operatingHours?: Array; - - /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ - phone?: string | null; - - /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ - specialHours?: Array; - } - - /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ - export interface InventoryLocationFormProperties { - - /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ - locationAdditionalInformation: FormControl, - - /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ - locationInstructions: FormControl, - - /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ - locationWebUrl: FormControl, - - /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ - name: FormControl, - - /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ - phone: FormControl, - } - export function CreateInventoryLocationFormGroup() { - return new FormGroup({ - locationAdditionalInformation: new FormControl(undefined), - locationInstructions: new FormControl(undefined), - locationWebUrl: new FormControl(undefined), - name: new FormControl(undefined), - phone: new FormControl(undefined), - }); - - } - - - /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ - export interface OperatingHours { - - /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ - dayOfWeekEnum?: string | null; - - /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ - intervals?: Array; - } - - /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ - export interface OperatingHoursFormProperties { - - /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ - dayOfWeekEnum: FormControl, - } - export function CreateOperatingHoursFormGroup() { - return new FormGroup({ - dayOfWeekEnum: new FormControl(undefined), - }); - - } - - - /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ - export interface SpecialHours { - - /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ - date?: string | null; - - /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ - intervals?: Array; - } - - /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ - export interface SpecialHoursFormProperties { - - /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ - date: FormControl, - } - export function CreateSpecialHoursFormGroup() { - return new FormGroup({ - date: new FormControl(undefined), - }); - - } - - - /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ - export interface InventoryLocationFull { - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - location?: LocationDetails; - - /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ - locationInstructions?: string | null; - - /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ - locationTypes?: Array; - - /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ - phone?: string | null; - - /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ - specialHours?: Array; - } - - /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ - export interface InventoryLocationFullFormProperties { - - /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ - locationAdditionalInformation: FormControl, - - /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ - locationInstructions: FormControl, - - /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ - locationWebUrl: FormControl, - - /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ - merchantLocationStatus: FormControl, - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ - name: FormControl, - - /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ - phone: FormControl, - } - export function CreateInventoryLocationFullFormGroup() { - return new FormGroup({ - locationAdditionalInformation: new FormControl(undefined), - locationInstructions: new FormControl(undefined), - locationWebUrl: new FormControl(undefined), - merchantLocationStatus: new FormControl(undefined), - name: new FormControl(undefined), - phone: new FormControl(undefined), - }); - - } - - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - export interface LocationDetails { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - } - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - export interface LocationDetailsFormProperties { - } - export function CreateLocationDetailsFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ - export interface InventoryLocationResponse { - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - location?: Location; - - /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ - locationInstructions?: string | null; - - /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ - locationTypes?: Array; - - /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ - phone?: string | null; - - /** This container shows the special operating hours for a store location on a specific date or dates. */ - specialHours?: Array; - } - - /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ - export interface InventoryLocationResponseFormProperties { - - /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ - locationAdditionalInformation: FormControl, - - /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ - locationInstructions: FormControl, - - /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ - locationWebUrl: FormControl, - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ - merchantLocationKey: FormControl, - - /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ - merchantLocationStatus: FormControl, - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ - name: FormControl, - - /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ - phone: FormControl, - } - export function CreateInventoryLocationResponseFormGroup() { - return new FormGroup({ - locationAdditionalInformation: new FormControl(undefined), - locationInstructions: new FormControl(undefined), - locationWebUrl: new FormControl(undefined), - merchantLocationKey: new FormControl(undefined), - merchantLocationStatus: new FormControl(undefined), - name: new FormControl(undefined), - phone: new FormControl(undefined), - }); - - } - - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - export interface Location { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - - /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ - locationId?: string | null; - } - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - export interface LocationFormProperties { - - /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ - locationId: FormControl, - } - export function CreateLocationFormGroup() { - return new FormGroup({ - locationId: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response payload for the getInventoryLocations call. */ - export interface LocationResponse { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of one or more of the merchant's inventory locations. */ - locations?: Array; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type is used by the base response payload for the getInventoryLocations call. */ - export interface LocationResponseFormProperties { - - /** The URI of the current page of results from the result set. */ - href: FormControl, - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next: FormControl, - - /** - * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev: FormControl, - - /** - * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateLocationResponseFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type is used by the base request payload of the getListingFees call. */ - export interface OfferKeysWithId { - - /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ - offers?: Array; - } - - /** This type is used by the base request payload of the getListingFees call. */ - export interface OfferKeysWithIdFormProperties { - } - export function CreateOfferKeysWithIdFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ - export interface OfferResponse { - - /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ - offerId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ - export interface OfferResponseFormProperties { - - /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ - offerId: FormControl, - } - export function CreateOfferResponseFormGroup() { - return new FormGroup({ - offerId: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ - export interface Offers { - - /** This is the URL to the current page of offers. */ - href?: string | null; - - /** - * This integer value is the number of offers that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ - next?: string | null; - - /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ - offers?: Array; - - /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ - prev?: string | null; - - /** - * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ - export interface OffersFormProperties { - - /** This is the URL to the current page of offers. */ - href: FormControl, - - /** - * This integer value is the number of offers that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ - next: FormControl, - - /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ - prev: FormControl, - - /** - * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size: FormControl, - - /** - * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateOffersFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - prev: new FormControl(undefined), - size: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ - export interface PublishByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ - export interface PublishByInventoryItemGroupRequestFormProperties { - - /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ - inventoryItemGroupKey: FormControl, - - /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - } - export function CreatePublishByInventoryItemGroupRequestFormGroup() { - return new FormGroup({ - inventoryItemGroupKey: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - }); - - } - - - /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ - export interface PublishResponse { - - /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ - listingId?: string | null; - - /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ - warnings?: Array; - } - - /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ - export interface PublishResponseFormProperties { - - /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ - listingId: FormControl, - } - export function CreatePublishResponseFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - }); - - } - - - /** This type is used to show the version number and instance of the service or API. */ - export interface Version { - - /** This type is used to show the version number and instance of the service or API. */ - instance?: Version; - - /** The version number of the service or API. */ - version?: string | null; - } - - /** This type is used to show the version number and instance of the service or API. */ - export interface VersionFormProperties { - - /** The version number of the service or API. */ - version: FormControl, - } - export function CreateVersionFormGroup() { - return new FormGroup({ - version: new FormControl(undefined), - }); - - } - - - /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ - export interface WithdrawByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ - export interface WithdrawByInventoryItemGroupRequestFormProperties { - - /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ - inventoryItemGroupKey: FormControl, - - /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - } - export function CreateWithdrawByInventoryItemGroupRequestFormGroup() { - return new FormGroup({ - inventoryItemGroupKey: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - }); - - } - - - /** The base response of the withdrawOffer call. */ - export interface WithdrawResponse { - - /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ - listingId?: string | null; - - /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ - warnings?: Array; - } - - /** The base response of the withdrawOffer call. */ - export interface WithdrawResponseFormProperties { - - /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ - listingId: FormControl, - } - export function CreateWithdrawResponseFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 - * @return {InventoryLocationResponse} Success - */ - GetInventoryLocation(merchantLocationKey: string): Observable { - return this.http.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}); - } - - /** - * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 - * @param {InventoryLocationFull} requestBody Inventory Location details - * @return {void} - */ - CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Observable> { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. - * Delete location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 - * @return {void} - */ - DeleteInventoryLocation(merchantLocationKey: string): Observable> { - return this.http.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/disable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 - * @return {string} Success - */ - DisableInventoryLocation(merchantLocationKey: string): Observable { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, { responseType: 'text' }); - } - - /** - * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/enable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 - * @return {string} Success - */ - EnableInventoryLocation(merchantLocationKey: string): Observable { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, { responseType: 'text' }); - } - - /** - * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 - * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {LocationResponse} Success - */ - GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey}/update_location_details - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 - * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). - * @return {void} - */ - UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Observable> { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Get inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. - * @return {InventoryItemWithSkuLocaleGroupid} Success - */ - GetInventoryItem(sku: string): Observable { - return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. - * Put inventory_item/{sku} - * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. - * @param {InventoryItem} requestBody Details of the inventory item record. - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Observable { - return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Delete inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. - * @return {void} - */ - DeleteInventoryItem(sku: string): Observable> { - return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. - * Get inventory_item - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {InventoryItems} Success - */ - GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Post bulk_update_price_quantity - * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace - * @return {BulkPriceQuantityResponse} Success - */ - BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Observable { - return this.http.post(this.baseUri + 'bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. - * Post bulk_create_or_replace_inventory_item - * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkInventoryItemResponse} Success - */ - BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Observable { - return this.http.post(this.baseUri + 'bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Post bulk_get_inventory_item - * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkGetInventoryItemResponse} Success - */ - BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Observable { - return this.http.post(this.baseUri + 'bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Get inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {Compatibility} Success - */ - GetProductCompatibility(sku: string): Observable { - return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}); - } - - /** - * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @param {Compatibility} requestBody Details of the compatibility - * @return {BaseResponse} Success - */ - CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Observable { - return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Delete inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {void} - */ - DeleteProductCompatibility(sku: string): Observable> { - return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer - * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. - * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. - * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {Offers} Success - */ - GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. - * Post offer - * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {void} - */ - CreateOffer(requestBody: EbayOfferDetailsWithKeys): Observable> { - return this.http.post(this.baseUri + 'offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is to be retrieved. - * @return {EbayOfferDetailsWithAll} Success - */ - GetOffer(offerId: string): Observable { - return this.http.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}); - } - - /** - * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. - * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel - * @return {OfferResponse} Success - */ - UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Observable { - return this.http.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. - * Delete offer/{offerId} - * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. - * @return {void} - */ - DeleteOffer(offerId: string): Observable> { - return this.http.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post offer/{offerId}/publish/ - * @param {string} offerId The unique identifier of the offer that is to be published. - * @return {PublishResponse} Success - */ - PublishOffer(offerId: string): Observable { - return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. - * Post offer/publish_by_inventory_item_group/ - * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. - * @return {PublishResponse} Success - */ - PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Observable { - return this.http.post(this.baseUri + 'offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. - * Post offer/withdraw_by_inventory_item_group - * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. - * @return {void} - */ - WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Observable> { - return this.http.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. - * Post offer/get_listing_fees - * @param {OfferKeysWithId} requestBody List of offers that needs fee information - * @return {FeesSummaryResponse} Success - */ - GetListingFees(requestBody: OfferKeysWithId): Observable { - return this.http.post(this.baseUri + 'offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. - * Post bulk_create_offer - * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {BulkOfferResponse} Success - */ - BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Observable { - return this.http.post(this.baseUri + 'bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post bulk_publish_offer - * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. - * @return {BulkPublishResponse} Success - */ - BulkPublishOffer(requestBody: BulkOffer): Observable { - return this.http.post(this.baseUri + 'bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. - * Post offer/{offerId}/withdraw - * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. - * @return {WithdrawResponse} Success - */ - WithdrawOffer(offerId: string): Observable { - return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}); - } - - /** - * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. - * Get inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. - * @return {InventoryItemGroup} Success - */ - GetInventoryItemGroup(inventoryItemGroupKey: string): Observable { - return this.http.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}); - } - - /** - * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. - * @param {InventoryItemGroup} requestBody Details of the inventory Item Group - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Observable { - return this.http.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call deletes the inventory item group for a given inventoryItemGroupKey value. - * Delete inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. - * @return {void} - */ - DeleteInventoryItemGroup(inventoryItemGroupKey: string): Observable> { - return this.http.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. - * Post bulk_migrate_listing - * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory - * @return {BulkMigrateListingResponse} Success - */ - BulkMigrateListing(requestBody: BulkMigrateListing): Observable { - return this.http.post(this.baseUri + 'bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** This type is used to define the physical address of an inventory location. */ + export interface Address { + + /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine1?: string | null; + + /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine2?: string | null; + + /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ + city?: string | null; + + /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ + country?: string | null; + + /** The county in which the address resides. This field is returned if defined for an inventory location. */ + county?: string | null; + + /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ + postalCode?: string | null; + + /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ + stateOrProvince?: string | null; + } + + /** This type is used to define the physical address of an inventory location. */ + export interface AddressFormProperties { + + /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine1: FormControl, + + /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine2: FormControl, + + /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ + city: FormControl, + + /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ + country: FormControl, + + /** The county in which the address resides. This field is returned if defined for an inventory location. */ + county: FormControl, + + /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ + postalCode: FormControl, + + /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ + stateOrProvince: FormControl, + } + export function CreateAddressFormGroup() { + return new FormGroup({ + addressLine1: new FormControl(undefined), + addressLine2: new FormControl(undefined), + city: new FormControl(undefined), + country: new FormControl(undefined), + county: new FormControl(undefined), + postalCode: new FormControl(undefined), + stateOrProvince: new FormControl(undefined), + }); + + } + + + /** This type is used to express a dollar value and the applicable currency. */ + export interface Amount { + + /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ + currency?: string | null; + + /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ + value?: string | null; + } + + /** This type is used to express a dollar value and the applicable currency. */ + export interface AmountFormProperties { + + /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ + currency: FormControl, + + /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ + value: FormControl, + } + export function CreateAmountFormGroup() { + return new FormGroup({ + currency: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + export interface Availability { + + /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + pickupAtLocationAvailability?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + } + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + export interface AvailabilityFormProperties { + } + export function CreateAvailabilityFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ + export interface PickupAtLocationAvailability { + + /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ + availabilityType?: string | null; + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + fulfillmentTime?: TimeDuration; + + /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ + merchantLocationKey?: string | null; + + /** + * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ + export interface PickupAtLocationAvailabilityFormProperties { + + /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ + availabilityType: FormControl, + + /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ + merchantLocationKey: FormControl, + + /** + * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity: FormControl, + } + export function CreatePickupAtLocationAvailabilityFormGroup() { + return new FormGroup({ + availabilityType: new FormControl(undefined), + merchantLocationKey: new FormControl(undefined), + quantity: new FormControl(undefined), + }); + + } + + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + export interface TimeDuration { + + /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + export interface TimeDurationFormProperties { + + /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** + * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value: FormControl, + } + export function CreateTimeDurationFormGroup() { + return new FormGroup({ + unit: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + export interface ShipToLocationAvailability { + + /** + * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + export interface ShipToLocationAvailabilityFormProperties { + + /** + * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity: FormControl, + } + export function CreateShipToLocationAvailabilityFormGroup() { + return new FormGroup({ + quantity: new FormControl(undefined), + }); + + } + + + /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ + export interface BaseResponse { + + /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ + warnings?: Array; + } + + /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ + export interface BaseResponseFormProperties { + } + export function CreateBaseResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ + export interface Error { + + /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ + category?: string | null; + + /** The name of the domain in which the error or warning occurred. */ + domain?: string | null; + + /** + * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ + longMessage?: string | null; + + /** A description of the condition that caused the error or warning. */ + message?: string | null; + + /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ + outputRefIds?: Array; + + /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. */ + subdomain?: string | null; + } + + /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ + export interface ErrorFormProperties { + + /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ + category: FormControl, + + /** The name of the domain in which the error or warning occurred. */ + domain: FormControl, + + /** + * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ + longMessage: FormControl, + + /** A description of the condition that caused the error or warning. */ + message: FormControl, + + /** The name of the subdomain in which the error or warning occurred. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + + /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ + export interface ErrorParameter { + + /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ + name?: string | null; + + /** This is the actual value that was passed in for the element specified in the name field. */ + value?: string | null; + } + + /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ + export interface ErrorParameterFormProperties { + + /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ + name: FormControl, + + /** This is the actual value that was passed in for the element specified in the name field. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + export interface BestOffer { + + /** This type is used to express a dollar value and the applicable currency. */ + autoAcceptPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + autoDeclinePrice?: Amount; + + /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ + bestOfferEnabled?: boolean | null; + } + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + export interface BestOfferFormProperties { + + /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ + bestOfferEnabled: FormControl, + } + export function CreateBestOfferFormGroup() { + return new FormGroup({ + bestOfferEnabled: new FormControl(undefined), + }); + + } + + + /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ + export interface BulkEbayOfferDetailsWithKeys { + + /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ + requests?: Array; + } + + /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ + export interface BulkEbayOfferDetailsWithKeysFormProperties { + } + export function CreateBulkEbayOfferDetailsWithKeysFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ + export interface EbayOfferDetailsWithKeys { + + /** + * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ + export interface EbayOfferDetailsWithKeysFormProperties { + + /** + * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity: FormControl, + + /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ + categoryId: FormControl, + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ + format: FormControl, + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription: FormControl, + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration: FormControl, + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize: FormControl, + + /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey: FormControl, + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer: FormControl, + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku: FormControl, + } + export function CreateEbayOfferDetailsWithKeysFormGroup() { + return new FormGroup({ + availableQuantity: new FormControl(undefined), + categoryId: new FormControl(undefined), + format: new FormControl(undefined), + listingDescription: new FormControl(undefined), + listingDuration: new FormControl(undefined), + lotSize: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + merchantLocationKey: new FormControl(undefined), + quantityLimitPerBuyer: new FormControl(undefined), + sku: new FormControl(undefined), + }); + + } + + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + + /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ + donationPercentage?: string | null; + } + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface CharityFormProperties { + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId: FormControl, + + /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ + donationPercentage: FormControl, + } + export function CreateCharityFormGroup() { + return new FormGroup({ + charityId: new FormControl(undefined), + donationPercentage: new FormControl(undefined), + }); + + } + + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + export interface ListingPolicies { + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + bestOfferTerms?: BestOffer; + + /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + eBayPlusIfEligible?: boolean | null; + + /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + fulfillmentPolicyId?: string | null; + + /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + paymentPolicyId?: string | null; + + /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + returnPolicyId?: string | null; + + /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ + shippingCostOverrides?: Array; + } + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + export interface ListingPoliciesFormProperties { + + /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + eBayPlusIfEligible: FormControl, + + /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + fulfillmentPolicyId: FormControl, + + /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + paymentPolicyId: FormControl, + + /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + returnPolicyId: FormControl, + } + export function CreateListingPoliciesFormGroup() { + return new FormGroup({ + eBayPlusIfEligible: new FormControl(undefined), + fulfillmentPolicyId: new FormControl(undefined), + paymentPolicyId: new FormControl(undefined), + returnPolicyId: new FormControl(undefined), + }); + + } + + + /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ + export interface ShippingCostOverride { + + /** This type is used to express a dollar value and the applicable currency. */ + additionalShippingCost?: Amount; + + /** + * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + priority?: number | null; + + /** This type is used to express a dollar value and the applicable currency. */ + shippingCost?: Amount; + + /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ + shippingServiceType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + surcharge?: Amount; + } + + /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ + export interface ShippingCostOverrideFormProperties { + + /** + * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + priority: FormControl, + + /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ + shippingServiceType: FormControl, + } + export function CreateShippingCostOverrideFormGroup() { + return new FormGroup({ + priority: new FormControl(undefined), + shippingServiceType: new FormControl(undefined), + }); + + } + + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + export interface PricingSummary { + + /** This type is used to express a dollar value and the applicable currency. */ + minimumAdvertisedPrice?: Amount; + + /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + originallySoldForRetailPriceOn?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + originalRetailPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + + /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + pricingVisibility?: string | null; + } + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + export interface PricingSummaryFormProperties { + + /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + originallySoldForRetailPriceOn: FormControl, + + /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + pricingVisibility: FormControl, + } + export function CreatePricingSummaryFormGroup() { + return new FormGroup({ + originallySoldForRetailPriceOn: new FormControl(undefined), + pricingVisibility: new FormControl(undefined), + }); + + } + + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + export interface Tax { + + /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ + applyTax?: boolean | null; + + /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ + thirdPartyTaxCategory?: string | null; + + /** + * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. + * Type: double + */ + vatPercentage?: number | null; + } + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + export interface TaxFormProperties { + + /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ + applyTax: FormControl, + + /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ + thirdPartyTaxCategory: FormControl, + + /** + * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. + * Type: double + */ + vatPercentage: FormControl, + } + export function CreateTaxFormGroup() { + return new FormGroup({ + applyTax: new FormControl(undefined), + thirdPartyTaxCategory: new FormControl(undefined), + vatPercentage: new FormControl(undefined), + }); + + } + + + /** This type is used by the base request of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItem { + + /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ + requests?: Array; + } + + /** This type is used by the base request of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemFormProperties { + } + export function CreateBulkGetInventoryItemFormGroup() { + return new FormGroup({ + }); + + } + + + /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ + export interface GetInventoryItem { + + /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ + sku?: string | null; + } + + /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ + export interface GetInventoryItemFormProperties { + + /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ + sku: FormControl, + } + export function CreateGetInventoryItemFormGroup() { + return new FormGroup({ + sku: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemResponse { + + /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ + responses?: Array; + } + + /** This type is used by the base response of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemResponseFormProperties { + } + export function CreateBulkGetInventoryItemResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ + export interface GetInventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ + errors?: Array; + + /** This type is used to provide details about each retrieved inventory item record. */ + inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ + warnings?: Array; + } + + /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ + export interface GetInventoryItemResponseFormProperties { + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku: FormControl, + + /** + * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateGetInventoryItemResponseFormGroup() { + return new FormGroup({ + sku: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type is used to provide details about each retrieved inventory item record. */ + export interface InventoryItemWithSkuLocaleGroupKeys { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + /** This type is used to provide details about each retrieved inventory item record. */ + export interface InventoryItemWithSkuLocaleGroupKeysFormProperties { + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition: FormControl, + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ + conditionDescription: FormControl, + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale: FormControl, + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku: FormControl, + } + export function CreateInventoryItemWithSkuLocaleGroupKeysFormGroup() { + return new FormGroup({ + condition: new FormControl(undefined), + conditionDescription: new FormControl(undefined), + locale: new FormControl(undefined), + sku: new FormControl(undefined), + }); + + } + + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface PackageWeightAndSize { + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + dimensions?: Dimension; + + /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ + packageType?: string | null; + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + weight?: Weight; + } + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface PackageWeightAndSizeFormProperties { + + /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ + packageType: FormControl, + } + export function CreatePackageWeightAndSizeFormGroup() { + return new FormGroup({ + packageType: new FormControl(undefined), + }); + + } + + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Dimension { + + /** + * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + height?: number | null; + + /** + * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + length?: number | null; + + /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + width?: number | null; + } + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + export interface DimensionFormProperties { + + /** + * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + height: FormControl, + + /** + * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + length: FormControl, + + /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** + * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + width: FormControl, + } + export function CreateDimensionFormGroup() { + return new FormGroup({ + height: new FormControl(undefined), + length: new FormControl(undefined), + unit: new FormControl(undefined), + width: new FormControl(undefined), + }); + + } + + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Weight { + + /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } + * Type: double + */ + value?: number | null; + } + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface WeightFormProperties { + + /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** + * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } + * Type: double + */ + value: FormControl, + } + export function CreateWeightFormGroup() { + return new FormGroup({ + unit: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + export interface Product { + + /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ + aspects?: Array; + + /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ + brand?: string | null; + + /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ + description?: string | null; + + /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ + ean?: Array; + + /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ + epid?: string | null; + + /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ + imageUrls?: Array; + + /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ + isbn?: Array; + + /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ + mpn?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ + title?: string | null; + + /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ + upc?: Array; + } + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + export interface ProductFormProperties { + + /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ + brand: FormControl, + + /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ + description: FormControl, + + /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ + epid: FormControl, + + /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ + mpn: FormControl, + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle: FormControl, + + /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ + title: FormControl, + } + export function CreateProductFormGroup() { + return new FormGroup({ + brand: new FormControl(undefined), + description: new FormControl(undefined), + epid: new FormControl(undefined), + mpn: new FormControl(undefined), + subtitle: new FormControl(undefined), + title: new FormControl(undefined), + }); + + } + + + /** The base request of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItem { + + /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ + requests?: Array; + } + + /** The base request of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemFormProperties { + } + export function CreateBulkInventoryItemFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ + export interface InventoryItemWithSkuLocale { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + } + + /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ + export interface InventoryItemWithSkuLocaleFormProperties { + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition: FormControl, + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription: FormControl, + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale: FormControl, + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku: FormControl, + } + export function CreateInventoryItemWithSkuLocaleFormGroup() { + return new FormGroup({ + condition: new FormControl(undefined), + conditionDescription: new FormControl(undefined), + locale: new FormControl(undefined), + sku: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemResponse { + + /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ + responses?: Array; + } + + /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemResponseFormProperties { + } + export function CreateBulkInventoryItemResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ + export interface InventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ + errors?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ + warnings?: Array; + } + + /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ + export interface InventoryItemResponseFormProperties { + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale: FormControl, + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku: FormControl, + + /** + * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateInventoryItemResponseFormGroup() { + return new FormGroup({ + locale: new FormControl(undefined), + sku: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type is used by the base container of the bulkMigrateListings request payload. */ + export interface BulkMigrateListing { + + /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ + requests?: Array; + } + + /** This type is used by the base container of the bulkMigrateListings request payload. */ + export interface BulkMigrateListingFormProperties { + } + export function CreateBulkMigrateListingFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ + export interface MigrateListing { + + /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ + listingId?: string | null; + } + + /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ + export interface MigrateListingFormProperties { + + /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ + listingId: FormControl, + } + export function CreateMigrateListingFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + }); + + } + + + /** This type is used by the response payload of the bulkMigrateListings call. */ + export interface BulkMigrateListingResponse { + + /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ + responses?: Array; + } + + /** This type is used by the response payload of the bulkMigrateListings call. */ + export interface BulkMigrateListingResponseFormProperties { + } + export function CreateBulkMigrateListingResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to display the results of each listing that the seller attempted to migrate. */ + export interface MigrateListingResponse { + + /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ + errors?: Array; + + /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ + inventoryItemGroupKey?: string | null; + + /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ + inventoryItems?: Array; + + /** The unique identifier of the eBay listing that the seller attempted to migrate. */ + listingId?: string | null; + + /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ + warnings?: Array; + } + + /** This type is used to display the results of each listing that the seller attempted to migrate. */ + export interface MigrateListingResponseFormProperties { + + /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ + inventoryItemGroupKey: FormControl, + + /** The unique identifier of the eBay listing that the seller attempted to migrate. */ + listingId: FormControl, + + /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** + * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateMigrateListingResponseFormGroup() { + return new FormGroup({ + inventoryItemGroupKey: new FormControl(undefined), + listingId: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ + export interface InventoryItemListing { + + /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ + offerId?: string | null; + + /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ + sku?: string | null; + } + + /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ + export interface InventoryItemListingFormProperties { + + /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ + offerId: FormControl, + + /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ + sku: FormControl, + } + export function CreateInventoryItemListingFormGroup() { + return new FormGroup({ + offerId: new FormControl(undefined), + sku: new FormControl(undefined), + }); + + } + + + /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ + export interface BulkOffer { + + /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ + requests?: Array; + } + + /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ + export interface BulkOfferFormProperties { + } + export function CreateBulkOfferFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ + export interface OfferKeyWithId { + + /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ + offerId?: string | null; + } + + /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ + export interface OfferKeyWithIdFormProperties { + + /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ + offerId: FormControl, + } + export function CreateOfferKeyWithIdFormGroup() { + return new FormGroup({ + offerId: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response of the bulkCreateOffer method. */ + export interface BulkOfferResponse { + + /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ + responses?: Array; + } + + /** This type is used by the base response of the bulkCreateOffer method. */ + export interface BulkOfferResponseFormProperties { + } + export function CreateBulkOfferResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ + export interface OfferSkuResponse { + + /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ + errors?: Array; + + /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ + offerId?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ + sku?: string | null; + + /** + * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ + warnings?: Array; + } + + /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ + export interface OfferSkuResponseFormProperties { + + /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format: FormControl, + + /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ + offerId: FormControl, + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ + sku: FormControl, + + /** + * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateOfferSkuResponseFormGroup() { + return new FormGroup({ + format: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + offerId: new FormControl(undefined), + sku: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + export interface BulkPriceQuantity { + + /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + requests?: Array; + } + + /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + export interface BulkPriceQuantityFormProperties { + } + export function CreateBulkPriceQuantityFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ + export interface PriceQuantity { + + /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ + offers?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + + /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ + sku?: string | null; + } + + /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ + export interface PriceQuantityFormProperties { + + /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ + sku: FormControl, + } + export function CreatePriceQuantityFormGroup() { + return new FormGroup({ + sku: new FormControl(undefined), + }); + + } + + + /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ + export interface OfferPriceQuantity { + + /** + * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ + offerId?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + } + + /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ + export interface OfferPriceQuantityFormProperties { + + /** + * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity: FormControl, + + /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ + offerId: FormControl, + } + export function CreateOfferPriceQuantityFormGroup() { + return new FormGroup({ + availableQuantity: new FormControl(undefined), + offerId: new FormControl(undefined), + }); + + } + + + /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + export interface BulkPriceQuantityResponse { + + /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + responses?: Array; + } + + /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + export interface BulkPriceQuantityResponseFormProperties { + } + export function CreateBulkPriceQuantityResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ + export interface PriceQuantityResponse { + + /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ + errors?: Array; + + /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ + offerId?: string | null; + + /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ + sku?: string | null; + + /** + * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ + warnings?: Array; + } + + /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ + export interface PriceQuantityResponseFormProperties { + + /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ + offerId: FormControl, + + /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ + sku: FormControl, + + /** + * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreatePriceQuantityResponseFormGroup() { + return new FormGroup({ + offerId: new FormControl(undefined), + sku: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response of the bulkPublishOffer method. */ + export interface BulkPublishResponse { + + /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ + responses?: Array; + } + + /** This type is used by the base response of the bulkPublishOffer method. */ + export interface BulkPublishResponseFormProperties { + } + export function CreateBulkPublishResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ + export interface OfferResponseWithListingId { + + /** This container will be returned if there were one or more errors associated with publishing the offer. */ + errors?: Array; + + /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ + listingId?: string | null; + + /** The unique identifier of the offer that the seller published (or attempted to publish). */ + offerId?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with publishing the offer. */ + warnings?: Array; + } + + /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ + export interface OfferResponseWithListingIdFormProperties { + + /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ + listingId: FormControl, + + /** The unique identifier of the offer that the seller published (or attempted to publish). */ + offerId: FormControl, + + /** + * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateOfferResponseWithListingIdFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + offerId: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ + export interface Compatibility { + + /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ + compatibleProducts?: Array; + + /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ + sku?: string | null; + } + + /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ + export interface CompatibilityFormProperties { + + /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ + sku: FormControl, + } + export function CreateCompatibilityFormGroup() { + return new FormGroup({ + sku: new FormControl(undefined), + }); + + } + + + /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ + export interface CompatibleProduct { + + /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ + compatibilityProperties?: Array; + + /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ + notes?: string | null; + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + productFamilyProperties?: ProductFamilyProperties; + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + productIdentifier?: ProductIdentifier; + } + + /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ + export interface CompatibleProductFormProperties { + + /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ + notes: FormControl, + } + export function CreateCompatibleProductFormGroup() { + return new FormGroup({ + notes: new FormControl(undefined), + }); + + } + + + /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ + export interface NameValueList { + + /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ + name?: string | null; + + /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ + value?: string | null; + } + + /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ + export interface NameValueListFormProperties { + + /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ + name: FormControl, + + /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ + value: FormControl, + } + export function CreateNameValueListFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + export interface ProductFamilyProperties { + + /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ + engine?: string | null; + + /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ + make?: string | null; + + /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ + model?: string | null; + + /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ + trim?: string | null; + + /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ + year?: string | null; + } + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + export interface ProductFamilyPropertiesFormProperties { + + /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ + engine: FormControl, + + /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ + make: FormControl, + + /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ + model: FormControl, + + /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ + trim: FormControl, + + /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ + year: FormControl, + } + export function CreateProductFamilyPropertiesFormGroup() { + return new FormGroup({ + engine: new FormControl(undefined), + make: new FormControl(undefined), + model: new FormControl(undefined), + trim: new FormControl(undefined), + year: new FormControl(undefined), + }); + + } + + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + export interface ProductIdentifier { + + /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ + epid?: string | null; + + /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ + gtin?: string | null; + + /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ + ktype?: string | null; + } + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + export interface ProductIdentifierFormProperties { + + /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ + epid: FormControl, + + /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ + gtin: FormControl, + + /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ + ktype: FormControl, + } + export function CreateProductIdentifierFormGroup() { + return new FormGroup({ + epid: new FormControl(undefined), + gtin: new FormControl(undefined), + ktype: new FormControl(undefined), + }); + + } + + + /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ + export interface EbayOfferDetailsWithAll { + + /** + * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + listing?: ListingDetails; + + /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ + merchantLocationKey?: string | null; + + /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ + offerId?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ + sku?: string | null; + + /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ + export interface EbayOfferDetailsWithAllFormProperties { + + /** + * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity: FormControl, + + /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ + categoryId: FormControl, + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format: FormControl, + + /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ + listingDescription: FormControl, + + /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ + listingDuration: FormControl, + + /** + * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize: FormControl, + + /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ + merchantLocationKey: FormControl, + + /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ + offerId: FormControl, + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer: FormControl, + + /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ + sku: FormControl, + + /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ + status: FormControl, + } + export function CreateEbayOfferDetailsWithAllFormGroup() { + return new FormGroup({ + availableQuantity: new FormControl(undefined), + categoryId: new FormControl(undefined), + format: new FormControl(undefined), + listingDescription: new FormControl(undefined), + listingDuration: new FormControl(undefined), + lotSize: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + merchantLocationKey: new FormControl(undefined), + offerId: new FormControl(undefined), + quantityLimitPerBuyer: new FormControl(undefined), + sku: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + export interface ListingDetails { + + /** The unique identifier of the eBay listing that is associated with the published offer. */ + listingId?: string | null; + + /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ + listingStatus?: string | null; + + /** + * This integer value indicates the quantity of the product that has been sold for the published offer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + soldQuantity?: number | null; + } + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + export interface ListingDetailsFormProperties { + + /** The unique identifier of the eBay listing that is associated with the published offer. */ + listingId: FormControl, + + /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ + listingStatus: FormControl, + + /** + * This integer value indicates the quantity of the product that has been sold for the published offer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + soldQuantity: FormControl, + } + export function CreateListingDetailsFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + listingStatus: new FormControl(undefined), + soldQuantity: new FormControl(undefined), + }); + + } + + + /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ + export interface EbayOfferDetailsWithId { + + /** + * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ + export interface EbayOfferDetailsWithIdFormProperties { + + /** + * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity: FormControl, + + /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ + categoryId: FormControl, + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription: FormControl, + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration: FormControl, + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize: FormControl, + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey: FormControl, + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer: FormControl, + } + export function CreateEbayOfferDetailsWithIdFormGroup() { + return new FormGroup({ + availableQuantity: new FormControl(undefined), + categoryId: new FormControl(undefined), + listingDescription: new FormControl(undefined), + listingDuration: new FormControl(undefined), + lotSize: new FormControl(undefined), + merchantLocationKey: new FormControl(undefined), + quantityLimitPerBuyer: new FormControl(undefined), + }); + + } + + + /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ + export interface Fee { + + /** This type is used to express a dollar value and the applicable currency. */ + amount?: Amount; + + /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + feeType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + promotionalDiscount?: Amount; + } + + /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ + export interface FeeFormProperties { + + /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + feeType: FormControl, + } + export function CreateFeeFormGroup() { + return new FormGroup({ + feeType: new FormControl(undefined), + }); + + } + + + /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ + export interface FeeSummary { + + /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + fees?: Array; + + /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ + export interface FeeSummaryFormProperties { + + /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + } + export function CreateFeeSummaryFormGroup() { + return new FormGroup({ + marketplaceId: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response payload for the getListingFees call. */ + export interface FeesSummaryResponse { + + /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ + feeSummaries?: Array; + } + + /** This type is used by the base response payload for the getListingFees call. */ + export interface FeesSummaryResponseFormProperties { + } + export function CreateFeesSummaryResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + export interface GeoCoordinates { + + /** + * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + longitude?: number | null; + } + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + export interface GeoCoordinatesFormProperties { + + /** + * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + latitude: FormControl, + + /** + * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + longitude: FormControl, + } + export function CreateGeoCoordinatesFormGroup() { + return new FormGroup({ + latitude: new FormControl(undefined), + longitude: new FormControl(undefined), + }); + + } + + + /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ + export interface Interval { + + /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + close?: string | null; + + /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + open?: string | null; + } + + /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ + export interface IntervalFormProperties { + + /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + close: FormControl, + + /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + open: FormControl, + } + export function CreateIntervalFormGroup() { + return new FormGroup({ + close: new FormControl(undefined), + open: new FormControl(undefined), + }); + + } + + + /** This type is used to provide detailed information about an inventory item. */ + export interface InventoryItem { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + } + + /** This type is used to provide detailed information about an inventory item. */ + export interface InventoryItemFormProperties { + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition: FormControl, + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription: FormControl, + } + export function CreateInventoryItemFormGroup() { + return new FormGroup({ + condition: new FormControl(undefined), + conditionDescription: new FormControl(undefined), + }); + + } + + + /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ + export interface InventoryItemGroup { + + /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ + aspects?: Array; + + /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ + description?: string | null; + + /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ + imageUrls?: Array; + + /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ + inventoryItemGroupKey?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ + title?: string | null; + + /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ + variantSKUs?: Array; + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + variesBy?: VariesBy; + } + + /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ + export interface InventoryItemGroupFormProperties { + + /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ + description: FormControl, + + /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ + inventoryItemGroupKey: FormControl, + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle: FormControl, + + /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ + title: FormControl, + } + export function CreateInventoryItemGroupFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + inventoryItemGroupKey: new FormControl(undefined), + subtitle: new FormControl(undefined), + title: new FormControl(undefined), + }); + + } + + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + export interface VariesBy { + + /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ + aspectsImageVariesBy?: Array; + + /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ + specifications?: Array; + } + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + export interface VariesByFormProperties { + } + export function CreateVariesByFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ + export interface Specification { + + /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ + name?: string | null; + + /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ + values?: Array; + } + + /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ + export interface SpecificationFormProperties { + + /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ + name: FormControl, + } + export function CreateSpecificationFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + }); + + } + + export interface InventoryItemWithSkuLocaleGroupid { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ + groupIds?: Array; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + export interface InventoryItemWithSkuLocaleGroupidFormProperties { + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition: FormControl, + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ + conditionDescription: FormControl, + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale: FormControl, + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku: FormControl, + } + export function CreateInventoryItemWithSkuLocaleGroupidFormGroup() { + return new FormGroup({ + condition: new FormControl(undefined), + conditionDescription: new FormControl(undefined), + locale: new FormControl(undefined), + sku: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response payload of getInventoryItems call. */ + export interface InventoryItems { + + /** This is the URL to the current page of inventory items. */ + href?: string | null; + + /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ + inventoryItems?: Array; + + /** + * This integer value is the number of inventory items that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ + next?: string | null; + + /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ + prev?: string | null; + + /** + * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type is used by the base response payload of getInventoryItems call. */ + export interface InventoryItemsFormProperties { + + /** This is the URL to the current page of inventory items. */ + href: FormControl, + + /** + * This integer value is the number of inventory items that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ + next: FormControl, + + /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ + prev: FormControl, + + /** + * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size: FormControl, + + /** + * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateInventoryItemsFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + prev: new FormControl(undefined), + size: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ + export interface InventoryLocation { + + /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ + locationInstructions?: string | null; + + /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ + locationWebUrl?: string | null; + + /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ + name?: string | null; + + /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ + operatingHours?: Array; + + /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ + phone?: string | null; + + /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ + specialHours?: Array; + } + + /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ + export interface InventoryLocationFormProperties { + + /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ + locationAdditionalInformation: FormControl, + + /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ + locationInstructions: FormControl, + + /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ + locationWebUrl: FormControl, + + /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ + name: FormControl, + + /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ + phone: FormControl, + } + export function CreateInventoryLocationFormGroup() { + return new FormGroup({ + locationAdditionalInformation: new FormControl(undefined), + locationInstructions: new FormControl(undefined), + locationWebUrl: new FormControl(undefined), + name: new FormControl(undefined), + phone: new FormControl(undefined), + }); + + } + + + /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ + export interface OperatingHours { + + /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ + dayOfWeekEnum?: string | null; + + /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ + intervals?: Array; + } + + /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ + export interface OperatingHoursFormProperties { + + /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ + dayOfWeekEnum: FormControl, + } + export function CreateOperatingHoursFormGroup() { + return new FormGroup({ + dayOfWeekEnum: new FormControl(undefined), + }); + + } + + + /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ + export interface SpecialHours { + + /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ + date?: string | null; + + /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ + intervals?: Array; + } + + /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ + export interface SpecialHoursFormProperties { + + /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ + date: FormControl, + } + export function CreateSpecialHoursFormGroup() { + return new FormGroup({ + date: new FormControl(undefined), + }); + + } + + + /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ + export interface InventoryLocationFull { + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + location?: LocationDetails; + + /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ + locationInstructions?: string | null; + + /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ + locationTypes?: Array; + + /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ + phone?: string | null; + + /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ + specialHours?: Array; + } + + /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ + export interface InventoryLocationFullFormProperties { + + /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ + locationAdditionalInformation: FormControl, + + /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ + locationInstructions: FormControl, + + /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ + locationWebUrl: FormControl, + + /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ + merchantLocationStatus: FormControl, + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ + name: FormControl, + + /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ + phone: FormControl, + } + export function CreateInventoryLocationFullFormGroup() { + return new FormGroup({ + locationAdditionalInformation: new FormControl(undefined), + locationInstructions: new FormControl(undefined), + locationWebUrl: new FormControl(undefined), + merchantLocationStatus: new FormControl(undefined), + name: new FormControl(undefined), + phone: new FormControl(undefined), + }); + + } + + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + export interface LocationDetails { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + } + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + export interface LocationDetailsFormProperties { + } + export function CreateLocationDetailsFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ + export interface InventoryLocationResponse { + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + location?: Location; + + /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ + locationInstructions?: string | null; + + /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ + locationTypes?: Array; + + /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ + phone?: string | null; + + /** This container shows the special operating hours for a store location on a specific date or dates. */ + specialHours?: Array; + } + + /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ + export interface InventoryLocationResponseFormProperties { + + /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ + locationAdditionalInformation: FormControl, + + /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ + locationInstructions: FormControl, + + /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ + locationWebUrl: FormControl, + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ + merchantLocationKey: FormControl, + + /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ + merchantLocationStatus: FormControl, + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ + name: FormControl, + + /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ + phone: FormControl, + } + export function CreateInventoryLocationResponseFormGroup() { + return new FormGroup({ + locationAdditionalInformation: new FormControl(undefined), + locationInstructions: new FormControl(undefined), + locationWebUrl: new FormControl(undefined), + merchantLocationKey: new FormControl(undefined), + merchantLocationStatus: new FormControl(undefined), + name: new FormControl(undefined), + phone: new FormControl(undefined), + }); + + } + + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + export interface Location { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + + /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ + locationId?: string | null; + } + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + export interface LocationFormProperties { + + /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ + locationId: FormControl, + } + export function CreateLocationFormGroup() { + return new FormGroup({ + locationId: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response payload for the getInventoryLocations call. */ + export interface LocationResponse { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of one or more of the merchant's inventory locations. */ + locations?: Array; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type is used by the base response payload for the getInventoryLocations call. */ + export interface LocationResponseFormProperties { + + /** The URI of the current page of results from the result set. */ + href: FormControl, + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next: FormControl, + + /** + * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev: FormControl, + + /** + * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateLocationResponseFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type is used by the base request payload of the getListingFees call. */ + export interface OfferKeysWithId { + + /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ + offers?: Array; + } + + /** This type is used by the base request payload of the getListingFees call. */ + export interface OfferKeysWithIdFormProperties { + } + export function CreateOfferKeysWithIdFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ + export interface OfferResponse { + + /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ + offerId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ + export interface OfferResponseFormProperties { + + /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ + offerId: FormControl, + } + export function CreateOfferResponseFormGroup() { + return new FormGroup({ + offerId: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ + export interface Offers { + + /** This is the URL to the current page of offers. */ + href?: string | null; + + /** + * This integer value is the number of offers that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ + next?: string | null; + + /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ + offers?: Array; + + /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ + prev?: string | null; + + /** + * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ + export interface OffersFormProperties { + + /** This is the URL to the current page of offers. */ + href: FormControl, + + /** + * This integer value is the number of offers that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ + next: FormControl, + + /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ + prev: FormControl, + + /** + * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size: FormControl, + + /** + * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateOffersFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + prev: new FormControl(undefined), + size: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ + export interface PublishByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ + export interface PublishByInventoryItemGroupRequestFormProperties { + + /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ + inventoryItemGroupKey: FormControl, + + /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + } + export function CreatePublishByInventoryItemGroupRequestFormGroup() { + return new FormGroup({ + inventoryItemGroupKey: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + }); + + } + + + /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ + export interface PublishResponse { + + /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ + listingId?: string | null; + + /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ + warnings?: Array; + } + + /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ + export interface PublishResponseFormProperties { + + /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ + listingId: FormControl, + } + export function CreatePublishResponseFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + }); + + } + + + /** This type is used to show the version number and instance of the service or API. */ + export interface Version { + + /** This type is used to show the version number and instance of the service or API. */ + instance?: Version; + + /** The version number of the service or API. */ + version?: string | null; + } + + /** This type is used to show the version number and instance of the service or API. */ + export interface VersionFormProperties { + + /** The version number of the service or API. */ + version: FormControl, + } + export function CreateVersionFormGroup() { + return new FormGroup({ + version: new FormControl(undefined), + }); + + } + + + /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ + export interface WithdrawByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ + export interface WithdrawByInventoryItemGroupRequestFormProperties { + + /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ + inventoryItemGroupKey: FormControl, + + /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + } + export function CreateWithdrawByInventoryItemGroupRequestFormGroup() { + return new FormGroup({ + inventoryItemGroupKey: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + }); + + } + + + /** The base response of the withdrawOffer call. */ + export interface WithdrawResponse { + + /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ + listingId?: string | null; + + /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ + warnings?: Array; + } + + /** The base response of the withdrawOffer call. */ + export interface WithdrawResponseFormProperties { + + /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ + listingId: FormControl, + } + export function CreateWithdrawResponseFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 + * @return {InventoryLocationResponse} Success + */ + GetInventoryLocation(merchantLocationKey: string): Observable { + return this.http.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}); + } + + /** + * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 + * @param {InventoryLocationFull} requestBody Inventory Location details + * @return {void} + */ + CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Observable> { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. + * Delete location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 + * @return {void} + */ + DeleteInventoryLocation(merchantLocationKey: string): Observable> { + return this.http.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/disable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 + * @return {string} Success + */ + DisableInventoryLocation(merchantLocationKey: string): Observable { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, { responseType: 'text' }); + } + + /** + * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/enable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 + * @return {string} Success + */ + EnableInventoryLocation(merchantLocationKey: string): Observable { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, { responseType: 'text' }); + } + + /** + * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 + * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {LocationResponse} Success + */ + GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey}/update_location_details + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 + * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). + * @return {void} + */ + UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Observable> { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Get inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. + * @return {InventoryItemWithSkuLocaleGroupid} Success + */ + GetInventoryItem(sku: string): Observable { + return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. + * Put inventory_item/{sku} + * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. + * @param {InventoryItem} requestBody Details of the inventory item record. + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Observable { + return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Delete inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. + * @return {void} + */ + DeleteInventoryItem(sku: string): Observable> { + return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. + * Get inventory_item + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {InventoryItems} Success + */ + GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Post bulk_update_price_quantity + * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace + * @return {BulkPriceQuantityResponse} Success + */ + BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Observable { + return this.http.post(this.baseUri + 'bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. + * Post bulk_create_or_replace_inventory_item + * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkInventoryItemResponse} Success + */ + BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Observable { + return this.http.post(this.baseUri + 'bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Post bulk_get_inventory_item + * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkGetInventoryItemResponse} Success + */ + BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Observable { + return this.http.post(this.baseUri + 'bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Get inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {Compatibility} Success + */ + GetProductCompatibility(sku: string): Observable { + return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}); + } + + /** + * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @param {Compatibility} requestBody Details of the compatibility + * @return {BaseResponse} Success + */ + CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Observable { + return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Delete inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {void} + */ + DeleteProductCompatibility(sku: string): Observable> { + return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer + * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. + * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. + * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {Offers} Success + */ + GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. + * Post offer + * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {void} + */ + CreateOffer(requestBody: EbayOfferDetailsWithKeys): Observable> { + return this.http.post(this.baseUri + 'offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is to be retrieved. + * @return {EbayOfferDetailsWithAll} Success + */ + GetOffer(offerId: string): Observable { + return this.http.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}); + } + + /** + * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. + * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel + * @return {OfferResponse} Success + */ + UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Observable { + return this.http.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. + * Delete offer/{offerId} + * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. + * @return {void} + */ + DeleteOffer(offerId: string): Observable> { + return this.http.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post offer/{offerId}/publish/ + * @param {string} offerId The unique identifier of the offer that is to be published. + * @return {PublishResponse} Success + */ + PublishOffer(offerId: string): Observable { + return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. + * Post offer/publish_by_inventory_item_group/ + * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. + * @return {PublishResponse} Success + */ + PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Observable { + return this.http.post(this.baseUri + 'offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. + * Post offer/withdraw_by_inventory_item_group + * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. + * @return {void} + */ + WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Observable> { + return this.http.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. + * Post offer/get_listing_fees + * @param {OfferKeysWithId} requestBody List of offers that needs fee information + * @return {FeesSummaryResponse} Success + */ + GetListingFees(requestBody: OfferKeysWithId): Observable { + return this.http.post(this.baseUri + 'offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. + * Post bulk_create_offer + * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {BulkOfferResponse} Success + */ + BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Observable { + return this.http.post(this.baseUri + 'bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post bulk_publish_offer + * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. + * @return {BulkPublishResponse} Success + */ + BulkPublishOffer(requestBody: BulkOffer): Observable { + return this.http.post(this.baseUri + 'bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. + * Post offer/{offerId}/withdraw + * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. + * @return {WithdrawResponse} Success + */ + WithdrawOffer(offerId: string): Observable { + return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}); + } + + /** + * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. + * Get inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. + * @return {InventoryItemGroup} Success + */ + GetInventoryItemGroup(inventoryItemGroupKey: string): Observable { + return this.http.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}); + } + + /** + * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. + * @param {InventoryItemGroup} requestBody Details of the inventory Item Group + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Observable { + return this.http.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call deletes the inventory item group for a given inventoryItemGroupKey value. + * Delete inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. + * @return {void} + */ + DeleteInventoryItemGroup(inventoryItemGroupKey: string): Observable> { + return this.http.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. + * Post bulk_migrate_listing + * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory + * @return {BulkMigrateListingResponse} Success + */ + BulkMigrateListing(requestBody: BulkMigrateListing): Observable { + return this.http.post(this.baseUri + 'bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_listing.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_listing.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_listing.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_listing.ts index b1ca6b8a..f7de802e 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_listing.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_listing.ts @@ -1,359 +1,359 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** The type that defines the fields for the currency and a monetary amount. */ - export interface Amount { - - /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. */ - value?: string | null; - } - - /** The type that defines the fields for the currency and a monetary amount. */ - export interface AmountFormProperties { - - /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ - currency: FormControl, - - /** The monetary amount, in the currency specified by the currency field. */ - value: FormControl, - } - export function CreateAmountFormGroup() { - return new FormGroup({ - currency: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** The type that defines the fields for the item aspects. */ - export interface Aspect { - - /** The name of an aspect, such and Brand. */ - name?: string | null; - - /** A list of potential values for this aspect. */ - values?: Array; - } - - /** The type that defines the fields for the item aspects. */ - export interface AspectFormProperties { - - /** The name of an aspect, such and Brand. */ - name: FormControl, - } - export function CreateAspectFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - }); - - } - - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ - donationPercentage?: string | null; - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - } - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface CharityFormProperties { - - /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ - donationPercentage: FormControl, - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId: FormControl, - } - export function CreateCharityFormGroup() { - return new FormGroup({ - donationPercentage: new FormControl(undefined), - charityId: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - /** This type defines the fields that can be returned in an error. */ - export interface ErrorFormProperties { - - /** Identifies the type of erro. */ - category: FormControl, - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain: FormControl, - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A more detailed explanation of the error. */ - longMessage: FormControl, - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message: FormControl, - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - export interface ErrorParameterFormProperties { - - /** The object of the error. */ - name: FormControl, - - /** The value of the object. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** The type that defines the fields for the listing details. */ - export interface ItemDraft { - - /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - categoryId?: string | null; - - /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The type that defines the fields for the price details for an item. */ - pricingSummary?: PricingSummary; - - /** The type that defines the fields for the aspects of a product. */ - product?: Product; - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - } - - /** The type that defines the fields for the listing details. */ - export interface ItemDraftFormProperties { - - /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - categoryId: FormControl, - - /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ - condition: FormControl, - - /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ - format: FormControl, - } - export function CreateItemDraftFormGroup() { - return new FormGroup({ - categoryId: new FormControl(undefined), - condition: new FormControl(undefined), - format: new FormControl(undefined), - }); - - } - - - /** The type that defines the fields for the price details for an item. */ - export interface PricingSummary { - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionReservePrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionStartPrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - price?: Amount; - } - - /** The type that defines the fields for the price details for an item. */ - export interface PricingSummaryFormProperties { - } - export function CreatePricingSummaryFormGroup() { - return new FormGroup({ - }); - - } - - - /** The type that defines the fields for the aspects of a product. */ - export interface Product { - - /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ - aspects?: Array; - - /** The name brand of the item, such as Nike, Apple, etc. */ - brand?: string | null; - - /** The description of the item that was created by the seller. This can be plain text or rich content. */ - description?: string | null; - - /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - epid?: string | null; - - /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ - imageUrls?: Array; - - /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ - title?: string | null; - } - - /** The type that defines the fields for the aspects of a product. */ - export interface ProductFormProperties { - - /** The name brand of the item, such as Nike, Apple, etc. */ - brand: FormControl, - - /** The description of the item that was created by the seller. This can be plain text or rich content. */ - description: FormControl, - - /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - epid: FormControl, - - /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ - title: FormControl, - } - export function CreateProductFormGroup() { - return new FormGroup({ - brand: new FormControl(undefined), - description: new FormControl(undefined), - epid: new FormControl(undefined), - title: new FormControl(undefined), - }); - - } - - - /** The type that defines the field for the createItemDraft response. */ - export interface ItemDraftResponse { - - /** The eBay generated ID of the listing draft. */ - itemDraftId?: string | null; - - /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ - sellFlowNativeUri?: string | null; - - /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ - sellFlowUrl?: string | null; - } - - /** The type that defines the field for the createItemDraft response. */ - export interface ItemDraftResponseFormProperties { - - /** The eBay generated ID of the listing draft. */ - itemDraftId: FormControl, - - /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ - sellFlowNativeUri: FormControl, - - /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ - sellFlowUrl: FormControl, - } - export function CreateItemDraftResponseFormGroup() { - return new FormGroup({ - itemDraftId: new FormControl(undefined), - sellFlowNativeUri: new FormControl(undefined), - sellFlowUrl: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. - * Post item_draft/ - * @return {void} - */ - CreateItemDraft(requestBody: ItemDraft): Observable> { - return this.http.post(this.baseUri + 'item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** The type that defines the fields for the currency and a monetary amount. */ + export interface Amount { + + /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. */ + value?: string | null; + } + + /** The type that defines the fields for the currency and a monetary amount. */ + export interface AmountFormProperties { + + /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ + currency: FormControl, + + /** The monetary amount, in the currency specified by the currency field. */ + value: FormControl, + } + export function CreateAmountFormGroup() { + return new FormGroup({ + currency: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** The type that defines the fields for the item aspects. */ + export interface Aspect { + + /** The name of an aspect, such and Brand. */ + name?: string | null; + + /** A list of potential values for this aspect. */ + values?: Array; + } + + /** The type that defines the fields for the item aspects. */ + export interface AspectFormProperties { + + /** The name of an aspect, such and Brand. */ + name: FormControl, + } + export function CreateAspectFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + }); + + } + + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ + donationPercentage?: string | null; + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + } + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface CharityFormProperties { + + /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ + donationPercentage: FormControl, + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId: FormControl, + } + export function CreateCharityFormGroup() { + return new FormGroup({ + donationPercentage: new FormControl(undefined), + charityId: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + /** This type defines the fields that can be returned in an error. */ + export interface ErrorFormProperties { + + /** Identifies the type of erro. */ + category: FormControl, + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain: FormControl, + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A more detailed explanation of the error. */ + longMessage: FormControl, + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message: FormControl, + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + export interface ErrorParameterFormProperties { + + /** The object of the error. */ + name: FormControl, + + /** The value of the object. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** The type that defines the fields for the listing details. */ + export interface ItemDraft { + + /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + categoryId?: string | null; + + /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The type that defines the fields for the price details for an item. */ + pricingSummary?: PricingSummary; + + /** The type that defines the fields for the aspects of a product. */ + product?: Product; + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + } + + /** The type that defines the fields for the listing details. */ + export interface ItemDraftFormProperties { + + /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + categoryId: FormControl, + + /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ + condition: FormControl, + + /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ + format: FormControl, + } + export function CreateItemDraftFormGroup() { + return new FormGroup({ + categoryId: new FormControl(undefined), + condition: new FormControl(undefined), + format: new FormControl(undefined), + }); + + } + + + /** The type that defines the fields for the price details for an item. */ + export interface PricingSummary { + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionReservePrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionStartPrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + price?: Amount; + } + + /** The type that defines the fields for the price details for an item. */ + export interface PricingSummaryFormProperties { + } + export function CreatePricingSummaryFormGroup() { + return new FormGroup({ + }); + + } + + + /** The type that defines the fields for the aspects of a product. */ + export interface Product { + + /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ + aspects?: Array; + + /** The name brand of the item, such as Nike, Apple, etc. */ + brand?: string | null; + + /** The description of the item that was created by the seller. This can be plain text or rich content. */ + description?: string | null; + + /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + epid?: string | null; + + /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ + imageUrls?: Array; + + /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ + title?: string | null; + } + + /** The type that defines the fields for the aspects of a product. */ + export interface ProductFormProperties { + + /** The name brand of the item, such as Nike, Apple, etc. */ + brand: FormControl, + + /** The description of the item that was created by the seller. This can be plain text or rich content. */ + description: FormControl, + + /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + epid: FormControl, + + /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ + title: FormControl, + } + export function CreateProductFormGroup() { + return new FormGroup({ + brand: new FormControl(undefined), + description: new FormControl(undefined), + epid: new FormControl(undefined), + title: new FormControl(undefined), + }); + + } + + + /** The type that defines the field for the createItemDraft response. */ + export interface ItemDraftResponse { + + /** The eBay generated ID of the listing draft. */ + itemDraftId?: string | null; + + /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ + sellFlowNativeUri?: string | null; + + /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ + sellFlowUrl?: string | null; + } + + /** The type that defines the field for the createItemDraft response. */ + export interface ItemDraftResponseFormProperties { + + /** The eBay generated ID of the listing draft. */ + itemDraftId: FormControl, + + /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ + sellFlowNativeUri: FormControl, + + /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ + sellFlowUrl: FormControl, + } + export function CreateItemDraftResponseFormGroup() { + return new FormGroup({ + itemDraftId: new FormControl(undefined), + sellFlowNativeUri: new FormControl(undefined), + sellFlowUrl: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. + * Post item_draft/ + * @return {void} + */ + CreateItemDraft(requestBody: ItemDraft): Observable> { + return this.http.post(this.baseUri + 'item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_logistics.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_logistics.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_logistics.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_logistics.ts index c8bb738e..7530e71e 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_logistics.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_logistics.ts @@ -1,941 +1,941 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ - export interface AdditionalOption { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalCost?: Amount; - - /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ - optionType?: string | null; - } - - /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ - export interface AdditionalOptionFormProperties { - - /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ - optionType: FormControl, - } - export function CreateAdditionalOptionFormGroup() { - return new FormGroup({ - optionType: new FormControl(undefined), - }); - - } - - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface AmountFormProperties { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency: FormControl, - - /** The value of the monetary amount in the specified currency. */ - value: FormControl, - } - export function CreateAmountFormGroup() { - return new FormGroup({ - currency: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This complex type contains contact information for an individual buyer or seller. */ - export interface Contact { - - /** The company name with which the contact is associated. */ - companyName?: string | null; - - /** This complex type specifies the details of a geographical address. */ - contactAddress?: ContactAddress; - - /** The contact's full name. */ - fullName?: string | null; - - /** This complex type contains a string field representing a telephone number. */ - primaryPhone?: PhoneNumber; - } - - /** This complex type contains contact information for an individual buyer or seller. */ - export interface ContactFormProperties { - - /** The company name with which the contact is associated. */ - companyName: FormControl, - - /** The contact's full name. */ - fullName: FormControl, - } - export function CreateContactFormGroup() { - return new FormGroup({ - companyName: new FormControl(undefined), - fullName: new FormControl(undefined), - }); - - } - - - /** This complex type specifies the details of a geographical address. */ - export interface ContactAddress { - - /** The first line of the street address. */ - addressLine1?: string | null; - - /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ - addressLine2?: string | null; - - /** The city in which the address is located. */ - city?: string | null; - - /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ - county?: string | null; - - /** The postal code of the address. */ - postalCode?: string | null; - - /** The state or province in which the address is located. States and provinces often contain multiple counties. */ - stateOrProvince?: string | null; - } - - /** This complex type specifies the details of a geographical address. */ - export interface ContactAddressFormProperties { - - /** The first line of the street address. */ - addressLine1: FormControl, - - /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ - addressLine2: FormControl, - - /** The city in which the address is located. */ - city: FormControl, - - /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ - countryCode: FormControl, - - /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ - county: FormControl, - - /** The postal code of the address. */ - postalCode: FormControl, - - /** The state or province in which the address is located. States and provinces often contain multiple counties. */ - stateOrProvince: FormControl, - } - export function CreateContactAddressFormGroup() { - return new FormGroup({ - addressLine1: new FormControl(undefined), - addressLine2: new FormControl(undefined), - city: new FormControl(undefined), - countryCode: new FormControl(undefined), - county: new FormControl(undefined), - postalCode: new FormControl(undefined), - stateOrProvince: new FormControl(undefined), - }); - - } - - - /** This complex type contains a string field representing a telephone number. */ - export interface PhoneNumber { - - /** A telephone number. */ - phoneNumber?: string | null; - } - - /** This complex type contains a string field representing a telephone number. */ - export interface PhoneNumberFormProperties { - - /** A telephone number. */ - phoneNumber: FormControl, - } - export function CreatePhoneNumberFormGroup() { - return new FormGroup({ - phoneNumber: new FormControl(undefined), - }); - - } - - - /** This complex type contains the request payload for the createFromShippingQuote method. */ - export interface CreateShipmentFromQuoteRequest { - - /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ - additionalOptions?: Array; - - /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ - labelCustomMessage?: string | null; - - /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ - labelSize?: string | null; - - /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ - rateId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ - shippingQuoteId?: string | null; - } - - /** This complex type contains the request payload for the createFromShippingQuote method. */ - export interface CreateShipmentFromQuoteRequestFormProperties { - - /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ - labelCustomMessage: FormControl, - - /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ - labelSize: FormControl, - - /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ - rateId: FormControl, - - /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ - shippingQuoteId: FormControl, - } - export function CreateCreateShipmentFromQuoteRequestFormGroup() { - return new FormGroup({ - labelCustomMessage: new FormControl(undefined), - labelSize: new FormControl(undefined), - rateId: new FormControl(undefined), - shippingQuoteId: new FormControl(undefined), - }); - - } - - - /** This complex type defines the dimensions of a package to be shipped. */ - export interface Dimensions { - - /** The numeric value of the height of the package. */ - height?: string | null; - - /** The numeric value of the length of the package. */ - length?: string | null; - - /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the width of the package. */ - width?: string | null; - } - - /** This complex type defines the dimensions of a package to be shipped. */ - export interface DimensionsFormProperties { - - /** The numeric value of the height of the package. */ - height: FormControl, - - /** The numeric value of the length of the package. */ - length: FormControl, - - /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** The numeric value of the width of the package. */ - width: FormControl, - } - export function CreateDimensionsFormGroup() { - return new FormGroup({ - height: new FormControl(undefined), - length: new FormControl(undefined), - unit: new FormControl(undefined), - width: new FormControl(undefined), - }); - - } - - - /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ - export interface Order { - - /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ - channel?: string | null; - - /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ - orderId?: string | null; - } - - /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ - export interface OrderFormProperties { - - /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ - channel: FormControl, - - /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ - orderId: FormControl, - } - export function CreateOrderFormGroup() { - return new FormGroup({ - channel: new FormControl(undefined), - orderId: new FormControl(undefined), - }); - - } - - - /** This complex type specifies the dimensions and weight of a package. */ - export interface PackageSpecification { - - /** This complex type defines the dimensions of a package to be shipped. */ - dimensions?: Dimensions; - - /** This complex type contains information about the weight of an object such as a shipping package. */ - weight?: Weight; - } - - /** This complex type specifies the dimensions and weight of a package. */ - export interface PackageSpecificationFormProperties { - } - export function CreatePackageSpecificationFormGroup() { - return new FormGroup({ - }); - - } - - - /** This complex type contains information about the weight of an object such as a shipping package. */ - export interface Weight { - - /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the weight of the package, as measured by the value of unit. */ - value?: string | null; - } - - /** This complex type contains information about the weight of an object such as a shipping package. */ - export interface WeightFormProperties { - - /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** The numeric value of the weight of the package, as measured by the value of unit. */ - value: FormControl, - } - export function CreateWeightFormGroup() { - return new FormGroup({ - unit: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This complex type defines a time window for the pickup of a package. */ - export interface PickupSlot { - - /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ - pickupSlotEndTime?: string | null; - - /** Seller-defined name for the pickup slot. */ - pickupSlotId?: string | null; - - /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ - pickupSlotStartTime?: string | null; - - /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ - pickupSlotTimeZone?: string | null; - } - - /** This complex type defines a time window for the pickup of a package. */ - export interface PickupSlotFormProperties { - - /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ - pickupSlotEndTime: FormControl, - - /** Seller-defined name for the pickup slot. */ - pickupSlotId: FormControl, - - /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ - pickupSlotStartTime: FormControl, - - /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ - pickupSlotTimeZone: FormControl, - } - export function CreatePickupSlotFormGroup() { - return new FormGroup({ - pickupSlotEndTime: new FormControl(undefined), - pickupSlotId: new FormControl(undefined), - pickupSlotStartTime: new FormControl(undefined), - pickupSlotTimeZone: new FormControl(undefined), - }); - - } - - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - export interface PurchasedRate { - - /** An list of additional, optional features that have been purchased for the shipment. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ - destinationTimeZone?: string | null; - - /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - maxEstimatedDeliveryDate?: string | null; - - /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ - pickupSlotId?: string | null; - - /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ - rateId?: string | null; - - /** The ID code for the carrier that was selected for the package shipment. */ - shippingCarrierCode?: string | null; - - /** The name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ - shippingQuoteId?: string | null; - - /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ - shippingServiceCode?: string | null; - - /** The name of the shipping service. */ - shippingServiceName?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - totalShippingCost?: Amount; - } - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - export interface PurchasedRateFormProperties { - - /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ - destinationTimeZone: FormControl, - - /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - maxEstimatedDeliveryDate: FormControl, - - /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - minEstimatedDeliveryDate: FormControl, - - /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ - pickupSlotId: FormControl, - - /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ - pickupType: FormControl, - - /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ - rateId: FormControl, - - /** The ID code for the carrier that was selected for the package shipment. */ - shippingCarrierCode: FormControl, - - /** The name of the shipping carrier. */ - shippingCarrierName: FormControl, - - /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ - shippingQuoteId: FormControl, - - /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ - shippingServiceCode: FormControl, - - /** The name of the shipping service. */ - shippingServiceName: FormControl, - } - export function CreatePurchasedRateFormGroup() { - return new FormGroup({ - destinationTimeZone: new FormControl(undefined), - maxEstimatedDeliveryDate: new FormControl(undefined), - minEstimatedDeliveryDate: new FormControl(undefined), - pickupSlotId: new FormControl(undefined), - pickupType: new FormControl(undefined), - rateId: new FormControl(undefined), - shippingCarrierCode: new FormControl(undefined), - shippingCarrierName: new FormControl(undefined), - shippingQuoteId: new FormControl(undefined), - shippingServiceCode: new FormControl(undefined), - shippingServiceName: new FormControl(undefined), - }); - - } - - - /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ - export interface Rate { - - /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ - destinationTimeZone?: string | null; - - /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ - maxEstimatedDeliveryDate?: string | null; - - /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** A list of available pickup slots for the package. */ - pickupSlots?: Array; - - /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The unique eBay-assigned ID for this shipping rate. */ - rateId?: string | null; - - /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ - rateRecommendation?: Array; - - /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ - shippingCarrierCode?: string | null; - - /** The common name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ - shippingServiceCode?: string | null; - - /** The common name of the shipping service. */ - shippingServiceName?: string | null; - } - - /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ - export interface RateFormProperties { - - /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ - destinationTimeZone: FormControl, - - /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ - maxEstimatedDeliveryDate: FormControl, - - /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - minEstimatedDeliveryDate: FormControl, - - /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ - pickupType: FormControl, - - /** The unique eBay-assigned ID for this shipping rate. */ - rateId: FormControl, - - /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ - shippingCarrierCode: FormControl, - - /** The common name of the shipping carrier. */ - shippingCarrierName: FormControl, - - /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ - shippingServiceCode: FormControl, - - /** The common name of the shipping service. */ - shippingServiceName: FormControl, - } - export function CreateRateFormGroup() { - return new FormGroup({ - destinationTimeZone: new FormControl(undefined), - maxEstimatedDeliveryDate: new FormControl(undefined), - minEstimatedDeliveryDate: new FormControl(undefined), - pickupType: new FormControl(undefined), - rateId: new FormControl(undefined), - shippingCarrierCode: new FormControl(undefined), - shippingCarrierName: new FormControl(undefined), - shippingServiceCode: new FormControl(undefined), - shippingServiceName: new FormControl(undefined), - }); - - } - - - /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ - export interface Shipment { - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - cancellation?: ShipmentCancellation; - - /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - creationDate?: string | null; - - /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ - labelCustomMessage?: string | null; - - /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ - labelDownloadUrl?: string | null; - - /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ - labelSize?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - rate?: PurchasedRate; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ - shipmentId?: string | null; - - /** A unique carrier-assigned ID string that can be used to track the shipment. */ - shipmentTrackingNumber?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ - export interface ShipmentFormProperties { - - /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - creationDate: FormControl, - - /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ - labelCustomMessage: FormControl, - - /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ - labelDownloadUrl: FormControl, - - /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ - labelSize: FormControl, - - /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ - shipmentId: FormControl, - - /** A unique carrier-assigned ID string that can be used to track the shipment. */ - shipmentTrackingNumber: FormControl, - } - export function CreateShipmentFormGroup() { - return new FormGroup({ - creationDate: new FormControl(undefined), - labelCustomMessage: new FormControl(undefined), - labelDownloadUrl: new FormControl(undefined), - labelSize: new FormControl(undefined), - shipmentId: new FormControl(undefined), - shipmentTrackingNumber: new FormControl(undefined), - }); - - } - - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - export interface ShipmentCancellation { - - /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ - cancellationRequestedDate?: string | null; - - /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ - cancellationStatus?: string | null; - } - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - export interface ShipmentCancellationFormProperties { - - /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ - cancellationRequestedDate: FormControl, - - /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ - cancellationStatus: FormControl, - } - export function CreateShipmentCancellationFormGroup() { - return new FormGroup({ - cancellationRequestedDate: new FormControl(undefined), - cancellationStatus: new FormControl(undefined), - }); - - } - - - /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ - export interface ShippingQuote { - - /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ - creationDate?: string | null; - - /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ - expirationDate?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ - rates?: Array; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ - shippingQuoteId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - - /** A list of any warnings triggered by the request. */ - warnings?: Array; - } - - /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ - export interface ShippingQuoteFormProperties { - - /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ - creationDate: FormControl, - - /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ - expirationDate: FormControl, - - /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ - shippingQuoteId: FormControl, - } - export function CreateShippingQuoteFormGroup() { - return new FormGroup({ - creationDate: new FormControl(undefined), - expirationDate: new FormControl(undefined), - shippingQuoteId: new FormControl(undefined), - }); - - } - - - /** A container that defines the elements of error and warning message. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - /** A container that defines the elements of error and warning message. */ - export interface ErrorFormProperties { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category: FormControl, - - /** Name of the domain containing the service or application. */ - domain: FormControl, - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage: FormControl, - - /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message: FormControl, - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - /** Container for an error parameter. */ - export interface ErrorParameterFormProperties { - - /** Name of the entity that threw the error. */ - name: FormControl, - - /** A description of the error. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ - export interface ShippingQuoteRequest { - - /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ - export interface ShippingQuoteRequestFormProperties { - } - export function CreateShippingQuoteRequestFormGroup() { - return new FormGroup({ - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. - * Post shipment/create_from_shipping_quote - * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. - * @return {void} - */ - CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Observable> { - return this.http.post(this.baseUri + 'shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. - * Get shipment/{shipmentId} - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - GetShipment(shipmentId: string): Observable { - return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}); - } - - /** - * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. - * Get shipment/{shipmentId}/download_label_file - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {void} Success - */ - DownloadLabelFile(shipmentId: string): Observable> { - return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { observe: 'response', responseType: 'text' }); - } - - /** - * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. - * Post shipment/{shipmentId}/cancel - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - CancelShipment(shipmentId: string): Observable { - return this.http.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}); - } - - /** - * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. - * Post shipping_quote - * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. - * @return {void} - */ - CreateShippingQuote(requestBody: ShippingQuoteRequest): Observable> { - return this.http.post(this.baseUri + 'shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. - * Get shipping_quote/{shippingQuoteId} - * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. - * @return {ShippingQuote} Success - */ - GetShippingQuote(shippingQuoteId: string): Observable { - return this.http.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ + export interface AdditionalOption { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalCost?: Amount; + + /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ + optionType?: string | null; + } + + /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ + export interface AdditionalOptionFormProperties { + + /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ + optionType: FormControl, + } + export function CreateAdditionalOptionFormGroup() { + return new FormGroup({ + optionType: new FormControl(undefined), + }); + + } + + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface AmountFormProperties { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency: FormControl, + + /** The value of the monetary amount in the specified currency. */ + value: FormControl, + } + export function CreateAmountFormGroup() { + return new FormGroup({ + currency: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This complex type contains contact information for an individual buyer or seller. */ + export interface Contact { + + /** The company name with which the contact is associated. */ + companyName?: string | null; + + /** This complex type specifies the details of a geographical address. */ + contactAddress?: ContactAddress; + + /** The contact's full name. */ + fullName?: string | null; + + /** This complex type contains a string field representing a telephone number. */ + primaryPhone?: PhoneNumber; + } + + /** This complex type contains contact information for an individual buyer or seller. */ + export interface ContactFormProperties { + + /** The company name with which the contact is associated. */ + companyName: FormControl, + + /** The contact's full name. */ + fullName: FormControl, + } + export function CreateContactFormGroup() { + return new FormGroup({ + companyName: new FormControl(undefined), + fullName: new FormControl(undefined), + }); + + } + + + /** This complex type specifies the details of a geographical address. */ + export interface ContactAddress { + + /** The first line of the street address. */ + addressLine1?: string | null; + + /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ + addressLine2?: string | null; + + /** The city in which the address is located. */ + city?: string | null; + + /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ + county?: string | null; + + /** The postal code of the address. */ + postalCode?: string | null; + + /** The state or province in which the address is located. States and provinces often contain multiple counties. */ + stateOrProvince?: string | null; + } + + /** This complex type specifies the details of a geographical address. */ + export interface ContactAddressFormProperties { + + /** The first line of the street address. */ + addressLine1: FormControl, + + /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ + addressLine2: FormControl, + + /** The city in which the address is located. */ + city: FormControl, + + /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ + countryCode: FormControl, + + /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ + county: FormControl, + + /** The postal code of the address. */ + postalCode: FormControl, + + /** The state or province in which the address is located. States and provinces often contain multiple counties. */ + stateOrProvince: FormControl, + } + export function CreateContactAddressFormGroup() { + return new FormGroup({ + addressLine1: new FormControl(undefined), + addressLine2: new FormControl(undefined), + city: new FormControl(undefined), + countryCode: new FormControl(undefined), + county: new FormControl(undefined), + postalCode: new FormControl(undefined), + stateOrProvince: new FormControl(undefined), + }); + + } + + + /** This complex type contains a string field representing a telephone number. */ + export interface PhoneNumber { + + /** A telephone number. */ + phoneNumber?: string | null; + } + + /** This complex type contains a string field representing a telephone number. */ + export interface PhoneNumberFormProperties { + + /** A telephone number. */ + phoneNumber: FormControl, + } + export function CreatePhoneNumberFormGroup() { + return new FormGroup({ + phoneNumber: new FormControl(undefined), + }); + + } + + + /** This complex type contains the request payload for the createFromShippingQuote method. */ + export interface CreateShipmentFromQuoteRequest { + + /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ + additionalOptions?: Array; + + /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ + labelCustomMessage?: string | null; + + /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ + labelSize?: string | null; + + /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ + rateId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ + shippingQuoteId?: string | null; + } + + /** This complex type contains the request payload for the createFromShippingQuote method. */ + export interface CreateShipmentFromQuoteRequestFormProperties { + + /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ + labelCustomMessage: FormControl, + + /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ + labelSize: FormControl, + + /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ + rateId: FormControl, + + /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ + shippingQuoteId: FormControl, + } + export function CreateCreateShipmentFromQuoteRequestFormGroup() { + return new FormGroup({ + labelCustomMessage: new FormControl(undefined), + labelSize: new FormControl(undefined), + rateId: new FormControl(undefined), + shippingQuoteId: new FormControl(undefined), + }); + + } + + + /** This complex type defines the dimensions of a package to be shipped. */ + export interface Dimensions { + + /** The numeric value of the height of the package. */ + height?: string | null; + + /** The numeric value of the length of the package. */ + length?: string | null; + + /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the width of the package. */ + width?: string | null; + } + + /** This complex type defines the dimensions of a package to be shipped. */ + export interface DimensionsFormProperties { + + /** The numeric value of the height of the package. */ + height: FormControl, + + /** The numeric value of the length of the package. */ + length: FormControl, + + /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** The numeric value of the width of the package. */ + width: FormControl, + } + export function CreateDimensionsFormGroup() { + return new FormGroup({ + height: new FormControl(undefined), + length: new FormControl(undefined), + unit: new FormControl(undefined), + width: new FormControl(undefined), + }); + + } + + + /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ + export interface Order { + + /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ + channel?: string | null; + + /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ + orderId?: string | null; + } + + /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ + export interface OrderFormProperties { + + /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ + channel: FormControl, + + /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ + orderId: FormControl, + } + export function CreateOrderFormGroup() { + return new FormGroup({ + channel: new FormControl(undefined), + orderId: new FormControl(undefined), + }); + + } + + + /** This complex type specifies the dimensions and weight of a package. */ + export interface PackageSpecification { + + /** This complex type defines the dimensions of a package to be shipped. */ + dimensions?: Dimensions; + + /** This complex type contains information about the weight of an object such as a shipping package. */ + weight?: Weight; + } + + /** This complex type specifies the dimensions and weight of a package. */ + export interface PackageSpecificationFormProperties { + } + export function CreatePackageSpecificationFormGroup() { + return new FormGroup({ + }); + + } + + + /** This complex type contains information about the weight of an object such as a shipping package. */ + export interface Weight { + + /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the weight of the package, as measured by the value of unit. */ + value?: string | null; + } + + /** This complex type contains information about the weight of an object such as a shipping package. */ + export interface WeightFormProperties { + + /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** The numeric value of the weight of the package, as measured by the value of unit. */ + value: FormControl, + } + export function CreateWeightFormGroup() { + return new FormGroup({ + unit: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This complex type defines a time window for the pickup of a package. */ + export interface PickupSlot { + + /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ + pickupSlotEndTime?: string | null; + + /** Seller-defined name for the pickup slot. */ + pickupSlotId?: string | null; + + /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ + pickupSlotStartTime?: string | null; + + /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ + pickupSlotTimeZone?: string | null; + } + + /** This complex type defines a time window for the pickup of a package. */ + export interface PickupSlotFormProperties { + + /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ + pickupSlotEndTime: FormControl, + + /** Seller-defined name for the pickup slot. */ + pickupSlotId: FormControl, + + /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ + pickupSlotStartTime: FormControl, + + /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ + pickupSlotTimeZone: FormControl, + } + export function CreatePickupSlotFormGroup() { + return new FormGroup({ + pickupSlotEndTime: new FormControl(undefined), + pickupSlotId: new FormControl(undefined), + pickupSlotStartTime: new FormControl(undefined), + pickupSlotTimeZone: new FormControl(undefined), + }); + + } + + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + export interface PurchasedRate { + + /** An list of additional, optional features that have been purchased for the shipment. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ + destinationTimeZone?: string | null; + + /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + maxEstimatedDeliveryDate?: string | null; + + /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ + pickupSlotId?: string | null; + + /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ + rateId?: string | null; + + /** The ID code for the carrier that was selected for the package shipment. */ + shippingCarrierCode?: string | null; + + /** The name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ + shippingQuoteId?: string | null; + + /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ + shippingServiceCode?: string | null; + + /** The name of the shipping service. */ + shippingServiceName?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + totalShippingCost?: Amount; + } + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + export interface PurchasedRateFormProperties { + + /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ + destinationTimeZone: FormControl, + + /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + maxEstimatedDeliveryDate: FormControl, + + /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + minEstimatedDeliveryDate: FormControl, + + /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ + pickupSlotId: FormControl, + + /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ + pickupType: FormControl, + + /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ + rateId: FormControl, + + /** The ID code for the carrier that was selected for the package shipment. */ + shippingCarrierCode: FormControl, + + /** The name of the shipping carrier. */ + shippingCarrierName: FormControl, + + /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ + shippingQuoteId: FormControl, + + /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ + shippingServiceCode: FormControl, + + /** The name of the shipping service. */ + shippingServiceName: FormControl, + } + export function CreatePurchasedRateFormGroup() { + return new FormGroup({ + destinationTimeZone: new FormControl(undefined), + maxEstimatedDeliveryDate: new FormControl(undefined), + minEstimatedDeliveryDate: new FormControl(undefined), + pickupSlotId: new FormControl(undefined), + pickupType: new FormControl(undefined), + rateId: new FormControl(undefined), + shippingCarrierCode: new FormControl(undefined), + shippingCarrierName: new FormControl(undefined), + shippingQuoteId: new FormControl(undefined), + shippingServiceCode: new FormControl(undefined), + shippingServiceName: new FormControl(undefined), + }); + + } + + + /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ + export interface Rate { + + /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ + destinationTimeZone?: string | null; + + /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ + maxEstimatedDeliveryDate?: string | null; + + /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** A list of available pickup slots for the package. */ + pickupSlots?: Array; + + /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The unique eBay-assigned ID for this shipping rate. */ + rateId?: string | null; + + /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ + rateRecommendation?: Array; + + /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ + shippingCarrierCode?: string | null; + + /** The common name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ + shippingServiceCode?: string | null; + + /** The common name of the shipping service. */ + shippingServiceName?: string | null; + } + + /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ + export interface RateFormProperties { + + /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ + destinationTimeZone: FormControl, + + /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ + maxEstimatedDeliveryDate: FormControl, + + /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + minEstimatedDeliveryDate: FormControl, + + /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ + pickupType: FormControl, + + /** The unique eBay-assigned ID for this shipping rate. */ + rateId: FormControl, + + /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ + shippingCarrierCode: FormControl, + + /** The common name of the shipping carrier. */ + shippingCarrierName: FormControl, + + /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ + shippingServiceCode: FormControl, + + /** The common name of the shipping service. */ + shippingServiceName: FormControl, + } + export function CreateRateFormGroup() { + return new FormGroup({ + destinationTimeZone: new FormControl(undefined), + maxEstimatedDeliveryDate: new FormControl(undefined), + minEstimatedDeliveryDate: new FormControl(undefined), + pickupType: new FormControl(undefined), + rateId: new FormControl(undefined), + shippingCarrierCode: new FormControl(undefined), + shippingCarrierName: new FormControl(undefined), + shippingServiceCode: new FormControl(undefined), + shippingServiceName: new FormControl(undefined), + }); + + } + + + /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ + export interface Shipment { + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + cancellation?: ShipmentCancellation; + + /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + creationDate?: string | null; + + /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ + labelCustomMessage?: string | null; + + /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ + labelDownloadUrl?: string | null; + + /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ + labelSize?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + rate?: PurchasedRate; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ + shipmentId?: string | null; + + /** A unique carrier-assigned ID string that can be used to track the shipment. */ + shipmentTrackingNumber?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ + export interface ShipmentFormProperties { + + /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + creationDate: FormControl, + + /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ + labelCustomMessage: FormControl, + + /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ + labelDownloadUrl: FormControl, + + /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ + labelSize: FormControl, + + /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ + shipmentId: FormControl, + + /** A unique carrier-assigned ID string that can be used to track the shipment. */ + shipmentTrackingNumber: FormControl, + } + export function CreateShipmentFormGroup() { + return new FormGroup({ + creationDate: new FormControl(undefined), + labelCustomMessage: new FormControl(undefined), + labelDownloadUrl: new FormControl(undefined), + labelSize: new FormControl(undefined), + shipmentId: new FormControl(undefined), + shipmentTrackingNumber: new FormControl(undefined), + }); + + } + + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + export interface ShipmentCancellation { + + /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ + cancellationRequestedDate?: string | null; + + /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ + cancellationStatus?: string | null; + } + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + export interface ShipmentCancellationFormProperties { + + /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ + cancellationRequestedDate: FormControl, + + /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ + cancellationStatus: FormControl, + } + export function CreateShipmentCancellationFormGroup() { + return new FormGroup({ + cancellationRequestedDate: new FormControl(undefined), + cancellationStatus: new FormControl(undefined), + }); + + } + + + /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ + export interface ShippingQuote { + + /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ + creationDate?: string | null; + + /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ + expirationDate?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ + rates?: Array; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ + shippingQuoteId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + + /** A list of any warnings triggered by the request. */ + warnings?: Array; + } + + /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ + export interface ShippingQuoteFormProperties { + + /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ + creationDate: FormControl, + + /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ + expirationDate: FormControl, + + /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ + shippingQuoteId: FormControl, + } + export function CreateShippingQuoteFormGroup() { + return new FormGroup({ + creationDate: new FormControl(undefined), + expirationDate: new FormControl(undefined), + shippingQuoteId: new FormControl(undefined), + }); + + } + + + /** A container that defines the elements of error and warning message. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + /** A container that defines the elements of error and warning message. */ + export interface ErrorFormProperties { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category: FormControl, + + /** Name of the domain containing the service or application. */ + domain: FormControl, + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage: FormControl, + + /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message: FormControl, + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + /** Container for an error parameter. */ + export interface ErrorParameterFormProperties { + + /** Name of the entity that threw the error. */ + name: FormControl, + + /** A description of the error. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ + export interface ShippingQuoteRequest { + + /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ + export interface ShippingQuoteRequestFormProperties { + } + export function CreateShippingQuoteRequestFormGroup() { + return new FormGroup({ + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. + * Post shipment/create_from_shipping_quote + * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. + * @return {void} + */ + CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Observable> { + return this.http.post(this.baseUri + 'shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. + * Get shipment/{shipmentId} + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + GetShipment(shipmentId: string): Observable { + return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}); + } + + /** + * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. + * Get shipment/{shipmentId}/download_label_file + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {void} Success + */ + DownloadLabelFile(shipmentId: string): Observable> { + return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { observe: 'response', responseType: 'text' }); + } + + /** + * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. + * Post shipment/{shipmentId}/cancel + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + CancelShipment(shipmentId: string): Observable { + return this.http.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}); + } + + /** + * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. + * Post shipping_quote + * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. + * @return {void} + */ + CreateShippingQuote(requestBody: ShippingQuoteRequest): Observable> { + return this.http.post(this.baseUri + 'shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. + * Get shipping_quote/{shippingQuoteId} + * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. + * @return {ShippingQuote} Success + */ + GetShippingQuote(shippingQuoteId: string): Observable { + return this.http.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_marketing.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_marketing.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_marketing.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_marketing.ts index 5ea8add3..a60d7fe7 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_marketing.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_marketing.ts @@ -1,3109 +1,3109 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** This type defines the fields for an ad. */ - export interface Ad { - - /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ - adId?: string | null; - - /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - /** This type defines the fields for an ad. */ - export interface AdFormProperties { - - /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ - adId: FormControl, - - /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage: FormControl, - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId: FormControl, - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType: FormControl, - - /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId: FormControl, - } - export function CreateAdFormGroup() { - return new FormGroup({ - adId: new FormControl(undefined), - bidPercentage: new FormControl(undefined), - inventoryReferenceId: new FormControl(undefined), - inventoryReferenceType: new FormControl(undefined), - listingId: new FormControl(undefined), - }); - - } - - - /** This type is a container for a list of ad IDs. */ - export interface AdIds { - - /** A list of ad ID's. */ - adIds?: Array; - } - - /** This type is a container for a list of ad IDs. */ - export interface AdIdsFormProperties { - } - export function CreateAdIdsFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface AdPagedCollection { - - /** A list of ads contained on this page from the paginated response. */ - ads?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface AdPagedCollectionFormProperties { - - /** The URI of the current page of results from the result set. */ - href: FormControl, - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next: FormControl, - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev: FormControl, - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateAdPagedCollectionFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type defines the fields for an ad ID and its associated URL. */ - export interface AdReference { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** The URI of an ad. You can use this URI to retrieve the ad. */ - href?: string | null; - } - - /** This type defines the fields for an ad ID and its associated URL. */ - export interface AdReferenceFormProperties { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId: FormControl, - - /** The URI of an ad. You can use this URI to retrieve the ad. */ - href: FormControl, - } - export function CreateAdReferenceFormGroup() { - return new FormGroup({ - adId: new FormControl(undefined), - href: new FormControl(undefined), - }); - - } - - - /** This type is a container for a list of ad IDs and their associated URIs. */ - export interface AdReferences { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - /** This type is a container for a list of ad IDs and their associated URIs. */ - export interface AdReferencesFormProperties { - } - export function CreateAdReferencesFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields returned in an ad response. */ - export interface AdResponse { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** An array of errors associated with the request. */ - errors?: Array; - - /** The URI that points to the ad. */ - href?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - /** This type defines the fields returned in an ad response. */ - export interface AdResponseFormProperties { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId: FormControl, - - /** The URI that points to the ad. */ - href: FormControl, - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId: FormControl, - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateAdResponseFormGroup() { - return new FormGroup({ - adId: new FormControl(undefined), - href: new FormControl(undefined), - listingId: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type defines the fields returned in an error condition. */ - export interface Error { - - /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** The name of the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ - longMessage?: string | null; - - /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ - message?: string | null; - - /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - /** This type defines the fields returned in an error condition. */ - export interface ErrorFormProperties { - - /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category: FormControl, - - /** The name of the primary system where the error occurred. This is relevant for application errors. */ - domain: FormControl, - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ - longMessage: FormControl, - - /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ - message: FormControl, - - /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - - /** A name/value pair that provides parameter details regarding a warning or error condition. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** The value that was set for the element specified in the name field. */ - value?: string | null; - } - - /** A name/value pair that provides parameter details regarding a warning or error condition. */ - export interface ErrorParameterFormProperties { - - /** Name of the entity that threw the error. */ - name: FormControl, - - /** The value that was set for the element specified in the name field. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type defines the container for an array of ads. */ - export interface Ads { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - /** This type defines the container for an array of ads. */ - export interface AdsFormProperties { - } - export function CreateAdsFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - export interface Amount { - - /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ - value?: string | null; - } - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - export interface AmountFormProperties { - - /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ - currency: FormControl, - - /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ - value: FormControl, - } - export function CreateAmountFormGroup() { - return new FormGroup({ - currency: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This type defines the fields for any warning error messages. */ - export interface BaseResponse { - - /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ - warnings?: Array; - } - - /** This type defines the fields for any warning error messages. */ - export interface BaseResponseFormProperties { - } - export function CreateBaseResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields for the create ads in bulk response. */ - export interface BulkAdResponse { - - /** A list of ads processed by the call. */ - responses?: Array; - } - - /** This type defines the fields for the create ads in bulk response. */ - export interface BulkAdResponseFormProperties { - } - export function CreateBulkAdResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields for the create ads in bulk by listing IDs. */ - export interface BulkCreateAdRequest { - - /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ - requests?: Array; - } - - /** This type defines the fields for the create ads in bulk by listing IDs. */ - export interface BulkCreateAdRequestFormProperties { - } - export function CreateBulkCreateAdRequestFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields for the create ad request. */ - export interface CreateAdRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - /** This type defines the fields for the create ad request. */ - export interface CreateAdRequestFormProperties { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage: FormControl, - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId: FormControl, - } - export function CreateCreateAdRequestFormGroup() { - return new FormGroup({ - bidPercentage: new FormControl(undefined), - listingId: new FormControl(undefined), - }); - - } - - - /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ - export interface BulkCreateAdsByInventoryReferenceRequest { - - /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ - requests?: Array; - } - - /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ - export interface BulkCreateAdsByInventoryReferenceRequestFormProperties { - } - export function CreateBulkCreateAdsByInventoryReferenceRequestFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields needed to create ads by inventory reference ID request. */ - export interface CreateAdsByInventoryReferenceRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - /** This type defines the fields needed to create ads by inventory reference ID request. */ - export interface CreateAdsByInventoryReferenceRequestFormProperties { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage: FormControl, - - /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId: FormControl, - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType: FormControl, - } - export function CreateCreateAdsByInventoryReferenceRequestFormGroup() { - return new FormGroup({ - bidPercentage: new FormControl(undefined), - inventoryReferenceId: new FormControl(undefined), - inventoryReferenceType: new FormControl(undefined), - }); - - } - - - /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ - export interface BulkCreateAdsByInventoryReferenceResponse { - - /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ - responses?: Array; - } - - /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ - export interface BulkCreateAdsByInventoryReferenceResponseFormProperties { - } - export function CreateBulkCreateAdsByInventoryReferenceResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields returned when you create an ad by inventory reference ID. */ - export interface CreateAdsByInventoryReferenceResponse { - - /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ - ads?: Array; - - /** An array of errors or warnings associated with the create-ads request. */ - errors?: Array; - - /** The seller's inventory reference ID that's associated with the ad. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - /** This type defines the fields returned when you create an ad by inventory reference ID. */ - export interface CreateAdsByInventoryReferenceResponseFormProperties { - - /** The seller's inventory reference ID that's associated with the ad. */ - inventoryReferenceId: FormControl, - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType: FormControl, - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateCreateAdsByInventoryReferenceResponseFormGroup() { - return new FormGroup({ - inventoryReferenceId: new FormControl(undefined), - inventoryReferenceType: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that the call uses to remove ads in bulk. */ - export interface BulkDeleteAdRequest { - - /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - requests?: Array; - } - - /** This type defines the fields that the call uses to remove ads in bulk. */ - export interface BulkDeleteAdRequestFormProperties { - } - export function CreateBulkDeleteAdRequestFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields used in a delete-ad request. */ - export interface DeleteAdRequest { - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - /** This type defines the fields used in a delete-ad request. */ - export interface DeleteAdRequestFormProperties { - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId: FormControl, - } - export function CreateDeleteAdRequestFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - }); - - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ - export interface BulkDeleteAdResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ - responses?: Array; - } - - /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ - export interface BulkDeleteAdResponseFormProperties { - } - export function CreateBulkDeleteAdResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields returned in a delete-ad response. */ - export interface DeleteAdResponse { - - /** The ID of the ad that was deleted. */ - adId?: string | null; - - /** An array of the errors or warnings associated with the request. */ - errors?: Array; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - /** This type defines the fields returned in a delete-ad response. */ - export interface DeleteAdResponseFormProperties { - - /** The ID of the ad that was deleted. */ - adId: FormControl, - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId: FormControl, - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateDeleteAdResponseFormGroup() { - return new FormGroup({ - adId: new FormControl(undefined), - listingId: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ - export interface BulkDeleteAdsByInventoryReferenceRequest { - - /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ - requests?: Array; - } - - /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ - export interface BulkDeleteAdsByInventoryReferenceRequestFormProperties { - } - export function CreateBulkDeleteAdsByInventoryReferenceRequestFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ - export interface DeleteAdsByInventoryReferenceRequest { - - /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ - export interface DeleteAdsByInventoryReferenceRequestFormProperties { - - /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId: FormControl, - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType: FormControl, - } - export function CreateDeleteAdsByInventoryReferenceRequestFormGroup() { - return new FormGroup({ - inventoryReferenceId: new FormControl(undefined), - inventoryReferenceType: new FormControl(undefined), - }); - - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ - export interface BulkDeleteAdsByInventoryReferenceResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ - responses?: Array; - } - - /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ - export interface BulkDeleteAdsByInventoryReferenceResponseFormProperties { - } - export function CreateBulkDeleteAdsByInventoryReferenceResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ - export interface DeleteAdsByInventoryReferenceResponse { - - /** The list of ad IDs that were removed from the campaign. */ - adIds?: Array; - - /** The container for the errors associated with the request. */ - errors?: Array; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ - export interface DeleteAdsByInventoryReferenceResponseFormProperties { - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId: FormControl, - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType: FormControl, - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode: FormControl, - } - export function CreateDeleteAdsByInventoryReferenceResponseFormGroup() { - return new FormGroup({ - inventoryReferenceId: new FormControl(undefined), - inventoryReferenceType: new FormControl(undefined), - statusCode: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that describe an ad campaign. */ - export interface Campaign { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ - campaignId?: string | null; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ - campaignStatus?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - /** This type defines the fields that describe an ad campaign. */ - export interface CampaignFormProperties { - - /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ - campaignId: FormControl, - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName: FormControl, - - /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ - campaignStatus: FormControl, - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate: FormControl, - - /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate: FormControl, - } - export function CreateCampaignFormGroup() { - return new FormGroup({ - campaignId: new FormControl(undefined), - campaignName: new FormControl(undefined), - campaignStatus: new FormControl(undefined), - endDate: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - export interface CampaignCriterion { - - /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ - criterionType?: string | null; - - /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ - selectionRules?: Array; - } - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - export interface CampaignCriterionFormProperties { - - /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ - autoSelectFutureInventory: FormControl, - - /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ - criterionType: FormControl, - } - export function CreateCampaignCriterionFormGroup() { - return new FormGroup({ - autoSelectFutureInventory: new FormControl(undefined), - criterionType: new FormControl(undefined), - }); - - } - - - /** This type specifies the selection rules used to create a campaign. */ - export interface SelectionRule { - - /** A list of the brands of the items to be included in the campaign. */ - brands?: Array; - - /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ - categoryIds?: Array; - - /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ - categoryScope?: string | null; - - /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ - listingConditionIds?: Array; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - maxPrice?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minPrice?: Amount; - } - - /** This type specifies the selection rules used to create a campaign. */ - export interface SelectionRuleFormProperties { - - /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ - categoryScope: FormControl, - } - export function CreateSelectionRuleFormGroup() { - return new FormGroup({ - categoryScope: new FormControl(undefined), - }); - - } - - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - export interface FundingStrategy { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ - fundingModel?: string | null; - } - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - export interface FundingStrategyFormProperties { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage: FormControl, - - /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ - fundingModel: FormControl, - } - export function CreateFundingStrategyFormGroup() { - return new FormGroup({ - bidPercentage: new FormControl(undefined), - fundingModel: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface CampaignPagedCollection { - - /** A list of campaigns contained on this page from the paginated response. */ - campaigns?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface CampaignPagedCollectionFormProperties { - - /** The URI of the current page of results from the result set. */ - href: FormControl, - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next: FormControl, - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev: FormControl, - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateCampaignPagedCollectionFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type contains a list of campaigns. */ - export interface Campaigns { - - /** An array of campaigns and their details. */ - campaigns?: Array; - } - - /** This type contains a list of campaigns. */ - export interface CampaignsFormProperties { - } - export function CreateCampaignsFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields needed for a clone-campaign request. */ - export interface CloneCampaignRequest { - - /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - /** This type defines the fields needed for a clone-campaign request. */ - export interface CloneCampaignRequestFormProperties { - - /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName: FormControl, - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate: FormControl, - - /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate: FormControl, - } - export function CreateCloneCampaignRequestFormGroup() { - return new FormGroup({ - campaignName: new FormControl(undefined), - endDate: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ - export interface CreateCampaignRequest { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ - export interface CreateCampaignRequestFormProperties { - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName: FormControl, - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate: FormControl, - - /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate: FormControl, - } - export function CreateCreateCampaignRequestFormGroup() { - return new FormGroup({ - campaignName: new FormControl(undefined), - endDate: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ - export interface CreateReportTask { - - /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ - dimensions?: Array; - - /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ - inventoryReferences?: Array; - - /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ - listingIds?: Array; - - /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ - metricKeys?: Array; - - /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ - export interface CreateReportTaskFormProperties { - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom: FormControl, - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo: FormControl, - - /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ - reportFormat: FormControl, - - /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ - reportType: FormControl, - } - export function CreateCreateReportTaskFormGroup() { - return new FormGroup({ - dateFrom: new FormControl(undefined), - dateTo: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - reportFormat: new FormControl(undefined), - reportType: new FormControl(undefined), - }); - - } - - - /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ - export interface Dimension { - - /** A list of annotations associated with the dimension of the report. */ - annotationKeys?: Array; - - /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ - dimensionKey?: string | null; - } - - /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ - export interface DimensionFormProperties { - - /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ - dimensionKey: FormControl, - } - export function CreateDimensionFormGroup() { - return new FormGroup({ - dimensionKey: new FormControl(undefined), - }); - - } - - - /** This type defines the fields contained in an inventory reference ID. */ - export interface InventoryReference { - - /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ - inventoryReferenceId?: string | null; - - /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - /** This type defines the fields contained in an inventory reference ID. */ - export interface InventoryReferenceFormProperties { - - /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ - inventoryReferenceId: FormControl, - - /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ - inventoryReferenceType: FormControl, - } - export function CreateInventoryReferenceFormGroup() { - return new FormGroup({ - inventoryReferenceId: new FormControl(undefined), - inventoryReferenceType: new FormControl(undefined), - }); - - } - - - /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ - export interface DimensionKeyAnnotation { - - /** An annotation key associated with the dimension. */ - annotationKey?: string | null; - - /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - } - - /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ - export interface DimensionKeyAnnotationFormProperties { - - /** An annotation key associated with the dimension. */ - annotationKey: FormControl, - - /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ - dataType: FormControl, - } - export function CreateDimensionKeyAnnotationFormGroup() { - return new FormGroup({ - annotationKey: new FormControl(undefined), - dataType: new FormControl(undefined), - }); - - } - - - /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ - export interface DimensionMetadata { - - /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the dimension used to create the report. */ - dimensionKey?: string | null; - - /** An list of annotation keys associated with the specified dimension of the report. */ - dimensionKeyAnnotations?: Array; - } - - /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ - export interface DimensionMetadataFormProperties { - - /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ - dataType: FormControl, - - /** The name of the dimension used to create the report. */ - dimensionKey: FormControl, - } - export function CreateDimensionMetadataFormGroup() { - return new FormGroup({ - dataType: new FormControl(undefined), - dimensionKey: new FormControl(undefined), - }); - - } - - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - export interface DiscountBenefit { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffItem?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffOrder?: Amount; - - /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ - percentageOffItem?: string | null; - - /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ - percentageOffOrder?: string | null; - } - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - export interface DiscountBenefitFormProperties { - - /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ - percentageOffItem: FormControl, - - /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ - percentageOffOrder: FormControl, - } - export function CreateDiscountBenefitFormGroup() { - return new FormGroup({ - percentageOffItem: new FormControl(undefined), - percentageOffOrder: new FormControl(undefined), - }); - - } - - - /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ - export interface DiscountRule { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountSpecification?: DiscountSpecification; - - /** - * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ - export interface DiscountRuleFormProperties { - - /** - * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder: FormControl, - } - export function CreateDiscountRuleFormGroup() { - return new FormGroup({ - ruleOrder: new FormControl(undefined), - }); - - } - - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - export interface DiscountSpecification { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - forEachAmount?: Amount; - - /** - * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - forEachQuantity?: number | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minAmount?: Amount; - - /** - * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - minQuantity?: number | null; - - /** - * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfDiscountedItems?: number | null; - } - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - export interface DiscountSpecificationFormProperties { - - /** - * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - forEachQuantity: FormControl, - - /** - * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - minQuantity: FormControl, - - /** - * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfDiscountedItems: FormControl, - } - export function CreateDiscountSpecificationFormGroup() { - return new FormGroup({ - forEachQuantity: new FormControl(undefined), - minQuantity: new FormControl(undefined), - numberOfDiscountedItems: new FormControl(undefined), - }); - - } - - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - export interface InventoryCriterion { - - /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ - inventoryCriterionType?: string | null; - - /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ - inventoryItems?: Array; - - /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ - listingIds?: Array; - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - ruleCriteria?: RuleCriteria; - } - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - export interface InventoryCriterionFormProperties { - - /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ - inventoryCriterionType: FormControl, - } - export function CreateInventoryCriterionFormGroup() { - return new FormGroup({ - inventoryCriterionType: new FormControl(undefined), - }); - - } - - - /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ - export interface InventoryItem { - - /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ - inventoryReferenceId?: string | null; - } - - /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ - export interface InventoryItemFormProperties { - - /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ - inventoryReferenceId: FormControl, - } - export function CreateInventoryItemFormGroup() { - return new FormGroup({ - inventoryReferenceId: new FormControl(undefined), - }); - - } - - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - export interface RuleCriteria { - - /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeInventoryItems?: Array; - - /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeListingIds?: Array; - - /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ - markupInventoryItems?: Array; - - /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ - markupListingIds?: Array; - - /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ - selectionRules?: Array; - } - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - export interface RuleCriteriaFormProperties { - } - export function CreateRuleCriteriaFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields used to describe an item price markdown promotion. */ - export interface ItemPriceMarkdown { - - /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ - applyFreeShipping?: boolean | null; - - /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ - blockPriceIncreaseInItemRevision?: boolean | null; - - /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ - selectedInventoryDiscounts?: Array; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - /** This type defines the fields used to describe an item price markdown promotion. */ - export interface ItemPriceMarkdownFormProperties { - - /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ - applyFreeShipping: FormControl, - - /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ - autoSelectFutureInventory: FormControl, - - /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ - blockPriceIncreaseInItemRevision: FormControl, - - /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ - description: FormControl, - - /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ - endDate: FormControl, - - /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name: FormControl, - - /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ - priority: FormControl, - - /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl: FormControl, - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus: FormControl, - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate: FormControl, - } - export function CreateItemPriceMarkdownFormGroup() { - return new FormGroup({ - applyFreeShipping: new FormControl(undefined), - autoSelectFutureInventory: new FormControl(undefined), - blockPriceIncreaseInItemRevision: new FormControl(undefined), - description: new FormControl(undefined), - endDate: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - priority: new FormControl(undefined), - promotionImageUrl: new FormControl(undefined), - promotionStatus: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ - export interface SelectedInventoryDiscount { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ - discountId?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** - * For markdown promotions, this field is reserved for future use. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ - export interface SelectedInventoryDiscountFormProperties { - - /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ - discountId: FormControl, - - /** - * For markdown promotions, this field is reserved for future use. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder: FormControl, - } - export function CreateSelectedInventoryDiscountFormGroup() { - return new FormGroup({ - discountId: new FormControl(undefined), - ruleOrder: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ - export interface ItemPromotion { - - /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ - export interface ItemPromotionFormProperties { - - /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly: FormControl, - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description: FormControl, - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate: FormControl, - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name: FormControl, - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority: FormControl, - - /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl: FormControl, - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus: FormControl, - - /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ - promotionType: FormControl, - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate: FormControl, - } - export function CreateItemPromotionFormGroup() { - return new FormGroup({ - applyDiscountToSingleItemOnly: new FormControl(undefined), - description: new FormControl(undefined), - endDate: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - priority: new FormControl(undefined), - promotionImageUrl: new FormControl(undefined), - promotionStatus: new FormControl(undefined), - promotionType: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** This complex type defines the fields returned for a promotion. */ - export interface ItemPromotionResponse { - - /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - /** This complex type defines the fields returned for a promotion. */ - export interface ItemPromotionResponseFormProperties { - - /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly: FormControl, - - /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description: FormControl, - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate: FormControl, - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name: FormControl, - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority: FormControl, - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId: FormControl, - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl: FormControl, - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus: FormControl, - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType: FormControl, - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate: FormControl, - } - export function CreateItemPromotionResponseFormGroup() { - return new FormGroup({ - applyDiscountToSingleItemOnly: new FormControl(undefined), - description: new FormControl(undefined), - endDate: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - priority: new FormControl(undefined), - promotionId: new FormControl(undefined), - promotionImageUrl: new FormControl(undefined), - promotionStatus: new FormControl(undefined), - promotionType: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** This type defines the name and data type of a metric. */ - export interface MetricMetadata { - - /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the metric. */ - metricKey?: string | null; - } - - /** This type defines the name and data type of a metric. */ - export interface MetricMetadataFormProperties { - - /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ - dataType: FormControl, - - /** The name of the metric. */ - metricKey: FormControl, - } - export function CreateMetricMetadataFormGroup() { - return new FormGroup({ - dataType: new FormControl(undefined), - metricKey: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ - export interface PromotionDetail { - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** The URI of the promotion details. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ - export interface PromotionDetailFormProperties { - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description: FormControl, - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate: FormControl, - - /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name: FormControl, - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority: FormControl, - - /** The URI of the promotion details. */ - promotionHref: FormControl, - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId: FormControl, - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl: FormControl, - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus: FormControl, - - /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType: FormControl, - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate: FormControl, - } - export function CreatePromotionDetailFormGroup() { - return new FormGroup({ - description: new FormControl(undefined), - endDate: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - name: new FormControl(undefined), - priority: new FormControl(undefined), - promotionHref: new FormControl(undefined), - promotionId: new FormControl(undefined), - promotionImageUrl: new FormControl(undefined), - promotionStatus: new FormControl(undefined), - promotionType: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - - /** This type defines the fields in a promotion-level report. */ - export interface PromotionReportDetail { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemRevenue?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderRevenue?: Amount; - - /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ - averageOrderSize?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** - * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemsSoldQuantity?: number | null; - - /** - * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfOrdersSold?: number | null; - - /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ - percentageSalesLift?: string | null; - - /** The URI of the promotion report. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ - promotionReportId?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - /** This type defines the fields in a promotion-level report. */ - export interface PromotionReportDetailFormProperties { - - /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ - averageOrderSize: FormControl, - - /** - * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemsSoldQuantity: FormControl, - - /** - * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfOrdersSold: FormControl, - - /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ - percentageSalesLift: FormControl, - - /** The URI of the promotion report. */ - promotionHref: FormControl, - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId: FormControl, - - /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ - promotionReportId: FormControl, - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType: FormControl, - } - export function CreatePromotionReportDetailFormGroup() { - return new FormGroup({ - averageOrderSize: new FormControl(undefined), - itemsSoldQuantity: new FormControl(undefined), - numberOfOrdersSold: new FormControl(undefined), - percentageSalesLift: new FormControl(undefined), - promotionHref: new FormControl(undefined), - promotionId: new FormControl(undefined), - promotionReportId: new FormControl(undefined), - promotionType: new FormControl(undefined), - }); - - } - - - /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ - promotions?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsPagedCollectionFormProperties { - - /** The URI of the current page of results. */ - href: FormControl, - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next: FormControl, - - /** - * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev: FormControl, - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreatePromotionsPagedCollectionFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsReportPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list of promotionReports contained in the paginated result set. */ - promotionReports?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsReportPagedCollectionFormProperties { - - /** The URI of the current page of results. */ - href: FormControl, - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next: FormControl, - - /** - * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev: FormControl, - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreatePromotionsReportPagedCollectionFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type defines the fields included in the report. */ - export interface ReportMetadata { - - /** A list containing the metadata for the dimension used in the report. */ - dimensionMetadata?: Array; - - /** - * The maximum number of dimensions that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfDimensionsToRequest?: number | null; - - /** - * The maximum number of metrics that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfMetricsToRequest?: number | null; - - /** A list containing the metadata for the metrics in the report. */ - metricMetadata?: Array; - - /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - /** This type defines the fields included in the report. */ - export interface ReportMetadataFormProperties { - - /** - * The maximum number of dimensions that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfDimensionsToRequest: FormControl, - - /** - * The maximum number of metrics that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfMetricsToRequest: FormControl, - - /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ - reportType: FormControl, - } - export function CreateReportMetadataFormGroup() { - return new FormGroup({ - maxNumberOfDimensionsToRequest: new FormControl(undefined), - maxNumberOfMetricsToRequest: new FormControl(undefined), - reportType: new FormControl(undefined), - }); - - } - - - /** This type defines the metadata used by the all report types. */ - export interface ReportMetadatas { - - /** A list of the metadata for the associated report type. */ - reportMetadata?: Array; - } - - /** This type defines the metadata used by the all report types. */ - export interface ReportMetadatasFormProperties { - } - export function CreateReportMetadatasFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type defines the fields in a report task. */ - export interface ReportTask { - - /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** A list containing the dimension in the report. */ - dimensions?: Array; - - /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ - inventoryReferences?: Array; - - /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingIds?: Array; - - /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A list of metrics for the report task. */ - metricKeys?: Array; - - /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportExpirationDate?: string | null; - - /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The URL of the generated report, which can be used to download the report once it has been generated. */ - reportHref?: string | null; - - /** A unique eBay-assigned ID for the report. */ - reportId?: string | null; - - /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ - reportName?: string | null; - - /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCompletionDate?: string | null; - - /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCreationDate?: string | null; - - /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskExpectedCompletionDate?: string | null; - - /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ - reportTaskId?: string | null; - - /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ - reportTaskStatus?: string | null; - - /** A status message with additional information about the report task. */ - reportTaskStatusMessage?: string | null; - - /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - /** This type defines the fields in a report task. */ - export interface ReportTaskFormProperties { - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom: FormControl, - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo: FormControl, - - /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ - marketplaceId: FormControl, - - /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportExpirationDate: FormControl, - - /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ - reportFormat: FormControl, - - /** The URL of the generated report, which can be used to download the report once it has been generated. */ - reportHref: FormControl, - - /** A unique eBay-assigned ID for the report. */ - reportId: FormControl, - - /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ - reportName: FormControl, - - /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCompletionDate: FormControl, - - /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCreationDate: FormControl, - - /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskExpectedCompletionDate: FormControl, - - /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ - reportTaskId: FormControl, - - /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ - reportTaskStatus: FormControl, - - /** A status message with additional information about the report task. */ - reportTaskStatusMessage: FormControl, - - /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ - reportType: FormControl, - } - export function CreateReportTaskFormGroup() { - return new FormGroup({ - dateFrom: new FormControl(undefined), - dateTo: new FormControl(undefined), - marketplaceId: new FormControl(undefined), - reportExpirationDate: new FormControl(undefined), - reportFormat: new FormControl(undefined), - reportHref: new FormControl(undefined), - reportId: new FormControl(undefined), - reportName: new FormControl(undefined), - reportTaskCompletionDate: new FormControl(undefined), - reportTaskCreationDate: new FormControl(undefined), - reportTaskExpectedCompletionDate: new FormControl(undefined), - reportTaskId: new FormControl(undefined), - reportTaskStatus: new FormControl(undefined), - reportTaskStatusMessage: new FormControl(undefined), - reportType: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface ReportTaskPagedCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** A list of report tasks contained on this page from the paginated response. */ - reportTasks?: Array; - } - - /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface ReportTaskPagedCollectionFormProperties { - - /** The URI of the current page of results from the result set. */ - href: FormControl, - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next: FormControl, - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev: FormControl, - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreateReportTaskPagedCollectionFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ - export interface SummaryReportResponse { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** The date the report was generated. */ - lastUpdated?: string | null; - - /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ - percentageSalesLift?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ - export interface SummaryReportResponseFormProperties { - - /** The date the report was generated. */ - lastUpdated: FormControl, - - /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ - percentageSalesLift: FormControl, - } - export function CreateSummaryReportResponseFormGroup() { - return new FormGroup({ - lastUpdated: new FormControl(undefined), - percentageSalesLift: new FormControl(undefined), - }); - - } - - - /** This type specifies the bid percentage for an ad campaign. */ - export interface UpdateBidPercentageRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - } - - /** This type specifies the bid percentage for an ad campaign. */ - export interface UpdateBidPercentageRequestFormProperties { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage: FormControl, - } - export function CreateUpdateBidPercentageRequestFormGroup() { - return new FormGroup({ - bidPercentage: new FormControl(undefined), - }); - - } - - - /** This type specifies the updated name, and start and end dates for an update-campaign request. */ - export interface UpdateCampaignIdentificationRequest { - - /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ - campaignName?: string | null; - - /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ - startDate?: string | null; - } - - /** This type specifies the updated name, and start and end dates for an update-campaign request. */ - export interface UpdateCampaignIdentificationRequestFormProperties { - - /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ - campaignName: FormControl, - - /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate: FormControl, - - /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ - startDate: FormControl, - } - export function CreateUpdateCampaignIdentificationRequestFormGroup() { - return new FormGroup({ - campaignName: new FormControl(undefined), - endDate: new FormControl(undefined), - startDate: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @return {BulkAdResponse} Success - */ - BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. - * @return {BulkDeleteAdsByInventoryReferenceResponse} Success - */ - BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. - * @return {BulkDeleteAdResponse} Success - */ - BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. - * @return {BulkAdResponse} Success - */ - BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {AdPagedCollection} Success - */ - GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. - * @return {void} - */ - CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. - * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. - * @return {void} - */ - CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. - * Get ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Ad} Success - */ - GetAd(ad_id: string, campaign_id: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}); - } - - /** - * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. - * Delete ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteAd(ad_id: string, campaign_id: string): Observable> { - return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. - * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. - * @return {AdIds} Success - */ - DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. - * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. - * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. - * @return {Ads} Success - */ - GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}); - } - - /** - * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. - * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid - * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. - * @return {void} - */ - UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). - * Post ad_campaign/{campaign_id}/clone - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. - * @return {void} - */ - CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign - * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name - * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status - * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. - * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. - * @return {CampaignPagedCollection} Success - */ - GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}); - } - - /** - * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. - * Post ad_campaign - * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. - * @return {void} - */ - CreateCampaign(requestBody: CreateCampaignRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Campaign} Success - */ - GetCampaign(campaign_id: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}); - } - - /** - * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Delete ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteCampaign(campaign_id: string): Observable> { - return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/end - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - EndCampaign(campaign_id: string): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/find_campaign_by_ad_reference - * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} listing_id Identifier of the eBay listing associated with the ad. - * @return {Campaigns} Success - */ - FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/get_campaign_by_name - * @param {string} campaign_name Name of the campaign. - * @return {Campaign} Success - */ - GetCampaignByName(campaign_name: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}); - } - - /** - * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/pause - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - PauseCampaign(campaign_id: string): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/resume - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - ResumeCampaign(campaign_id: string): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. - * Post ad_campaign/{campaign_id}/update_campaign_identification - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. - * @return {void} - */ - UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. - * Get ad_report/{report_id} - * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. - * @return {void} Success - */ - GetReport(report_id: string): Observable> { - return this.http.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. - * Get ad_report_metadata - * @return {ReportMetadatas} Success - */ - GetReportMetadata(): Observable { - return this.http.get(this.baseUri + 'ad_report_metadata', {}); - } - - /** - * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. - * Get ad_report_metadata/{report_type} - * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT - * @return {ReportMetadata} Success - */ - GetReportMetadataForReportType(report_type: string): Observable { - return this.http.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}); - } - - /** - * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. - * Get ad_report_task - * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 - * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED - * @return {ReportTaskPagedCollection} Success - */ - GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}); - } - - /** - * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. - * Post ad_report_task - * @param {CreateReportTask} requestBody The container for the fields that define the report task. - * @return {void} - */ - CreateReportTask(requestBody: CreateReportTask): Observable> { - return this.http.post(this.baseUri + 'ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Get ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {ReportTask} Success - */ - GetReportTask(report_task_id: string): Observable { - return this.http.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}); - } - - /** - * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Delete ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {void} - */ - DeleteReportTask(report_task_id: string): Observable> { - return this.http.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. - * Post item_price_markdown - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {void} - */ - CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Observable> { - return this.http.post(this.baseUri + 'item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPriceMarkdown} Success - */ - GetItemPriceMarkdownPromotion(promotion_id: string): Observable { - return this.http.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); - } - - /** - * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. - * Put item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {string} Success - */ - UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Observable { - return this.http.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. - * Delete item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPriceMarkdownPromotion(promotion_id: string): Observable> { - return this.http.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. - * Post item_promotion - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {void} - */ - CreateItemPromotion(requestBody: ItemPromotion): Observable> { - return this.http.post(this.baseUri + 'item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPromotionResponse} Success - */ - GetItemPromotion(promotion_id: string): Observable { - return this.http.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); - } - - /** - * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. - * Put item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {BaseResponse} Success - */ - UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Observable { - return this.http.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. - * Delete item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPromotion(promotion_id: string): Observable> { - return this.http.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 - * Get promotion/{promotion_id}/get_listing_set - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {string} q Reserved for future use. - * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html - * @return {void} - */ - GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 - * Get promotion - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 - * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @return {PromotionsPagedCollection} Success - */ - GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); - } - - /** - * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). - * Post promotion/{promotion_id}/pause - * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - PausePromotion(promotion_id: string): Observable> { - return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. - * Post promotion/{promotion_id}/resume - * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - ResumePromotion(promotion_id: string): Observable> { - return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. - * Get promotion_report - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 - * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @return {PromotionsReportPagedCollection} Success - */ - GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}); - } - - /** - * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. - * Get promotion_summary_report - * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @return {SummaryReportResponse} Success - */ - GetPromotionSummaryReport(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** This type defines the fields for an ad. */ + export interface Ad { + + /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ + adId?: string | null; + + /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + /** This type defines the fields for an ad. */ + export interface AdFormProperties { + + /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ + adId: FormControl, + + /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage: FormControl, + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId: FormControl, + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType: FormControl, + + /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId: FormControl, + } + export function CreateAdFormGroup() { + return new FormGroup({ + adId: new FormControl(undefined), + bidPercentage: new FormControl(undefined), + inventoryReferenceId: new FormControl(undefined), + inventoryReferenceType: new FormControl(undefined), + listingId: new FormControl(undefined), + }); + + } + + + /** This type is a container for a list of ad IDs. */ + export interface AdIds { + + /** A list of ad ID's. */ + adIds?: Array; + } + + /** This type is a container for a list of ad IDs. */ + export interface AdIdsFormProperties { + } + export function CreateAdIdsFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface AdPagedCollection { + + /** A list of ads contained on this page from the paginated response. */ + ads?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface AdPagedCollectionFormProperties { + + /** The URI of the current page of results from the result set. */ + href: FormControl, + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next: FormControl, + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev: FormControl, + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateAdPagedCollectionFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type defines the fields for an ad ID and its associated URL. */ + export interface AdReference { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** The URI of an ad. You can use this URI to retrieve the ad. */ + href?: string | null; + } + + /** This type defines the fields for an ad ID and its associated URL. */ + export interface AdReferenceFormProperties { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId: FormControl, + + /** The URI of an ad. You can use this URI to retrieve the ad. */ + href: FormControl, + } + export function CreateAdReferenceFormGroup() { + return new FormGroup({ + adId: new FormControl(undefined), + href: new FormControl(undefined), + }); + + } + + + /** This type is a container for a list of ad IDs and their associated URIs. */ + export interface AdReferences { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + /** This type is a container for a list of ad IDs and their associated URIs. */ + export interface AdReferencesFormProperties { + } + export function CreateAdReferencesFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields returned in an ad response. */ + export interface AdResponse { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** An array of errors associated with the request. */ + errors?: Array; + + /** The URI that points to the ad. */ + href?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + /** This type defines the fields returned in an ad response. */ + export interface AdResponseFormProperties { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId: FormControl, + + /** The URI that points to the ad. */ + href: FormControl, + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId: FormControl, + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateAdResponseFormGroup() { + return new FormGroup({ + adId: new FormControl(undefined), + href: new FormControl(undefined), + listingId: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type defines the fields returned in an error condition. */ + export interface Error { + + /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** The name of the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ + longMessage?: string | null; + + /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ + message?: string | null; + + /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + /** This type defines the fields returned in an error condition. */ + export interface ErrorFormProperties { + + /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category: FormControl, + + /** The name of the primary system where the error occurred. This is relevant for application errors. */ + domain: FormControl, + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ + longMessage: FormControl, + + /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ + message: FormControl, + + /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + + /** A name/value pair that provides parameter details regarding a warning or error condition. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** The value that was set for the element specified in the name field. */ + value?: string | null; + } + + /** A name/value pair that provides parameter details regarding a warning or error condition. */ + export interface ErrorParameterFormProperties { + + /** Name of the entity that threw the error. */ + name: FormControl, + + /** The value that was set for the element specified in the name field. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type defines the container for an array of ads. */ + export interface Ads { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + /** This type defines the container for an array of ads. */ + export interface AdsFormProperties { + } + export function CreateAdsFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + export interface Amount { + + /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ + value?: string | null; + } + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + export interface AmountFormProperties { + + /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ + currency: FormControl, + + /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ + value: FormControl, + } + export function CreateAmountFormGroup() { + return new FormGroup({ + currency: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This type defines the fields for any warning error messages. */ + export interface BaseResponse { + + /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ + warnings?: Array; + } + + /** This type defines the fields for any warning error messages. */ + export interface BaseResponseFormProperties { + } + export function CreateBaseResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields for the create ads in bulk response. */ + export interface BulkAdResponse { + + /** A list of ads processed by the call. */ + responses?: Array; + } + + /** This type defines the fields for the create ads in bulk response. */ + export interface BulkAdResponseFormProperties { + } + export function CreateBulkAdResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields for the create ads in bulk by listing IDs. */ + export interface BulkCreateAdRequest { + + /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ + requests?: Array; + } + + /** This type defines the fields for the create ads in bulk by listing IDs. */ + export interface BulkCreateAdRequestFormProperties { + } + export function CreateBulkCreateAdRequestFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields for the create ad request. */ + export interface CreateAdRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + /** This type defines the fields for the create ad request. */ + export interface CreateAdRequestFormProperties { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage: FormControl, + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId: FormControl, + } + export function CreateCreateAdRequestFormGroup() { + return new FormGroup({ + bidPercentage: new FormControl(undefined), + listingId: new FormControl(undefined), + }); + + } + + + /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ + export interface BulkCreateAdsByInventoryReferenceRequest { + + /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ + requests?: Array; + } + + /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ + export interface BulkCreateAdsByInventoryReferenceRequestFormProperties { + } + export function CreateBulkCreateAdsByInventoryReferenceRequestFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields needed to create ads by inventory reference ID request. */ + export interface CreateAdsByInventoryReferenceRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + /** This type defines the fields needed to create ads by inventory reference ID request. */ + export interface CreateAdsByInventoryReferenceRequestFormProperties { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage: FormControl, + + /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId: FormControl, + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType: FormControl, + } + export function CreateCreateAdsByInventoryReferenceRequestFormGroup() { + return new FormGroup({ + bidPercentage: new FormControl(undefined), + inventoryReferenceId: new FormControl(undefined), + inventoryReferenceType: new FormControl(undefined), + }); + + } + + + /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ + export interface BulkCreateAdsByInventoryReferenceResponse { + + /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ + responses?: Array; + } + + /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ + export interface BulkCreateAdsByInventoryReferenceResponseFormProperties { + } + export function CreateBulkCreateAdsByInventoryReferenceResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields returned when you create an ad by inventory reference ID. */ + export interface CreateAdsByInventoryReferenceResponse { + + /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ + ads?: Array; + + /** An array of errors or warnings associated with the create-ads request. */ + errors?: Array; + + /** The seller's inventory reference ID that's associated with the ad. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + /** This type defines the fields returned when you create an ad by inventory reference ID. */ + export interface CreateAdsByInventoryReferenceResponseFormProperties { + + /** The seller's inventory reference ID that's associated with the ad. */ + inventoryReferenceId: FormControl, + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType: FormControl, + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateCreateAdsByInventoryReferenceResponseFormGroup() { + return new FormGroup({ + inventoryReferenceId: new FormControl(undefined), + inventoryReferenceType: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that the call uses to remove ads in bulk. */ + export interface BulkDeleteAdRequest { + + /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + requests?: Array; + } + + /** This type defines the fields that the call uses to remove ads in bulk. */ + export interface BulkDeleteAdRequestFormProperties { + } + export function CreateBulkDeleteAdRequestFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields used in a delete-ad request. */ + export interface DeleteAdRequest { + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + /** This type defines the fields used in a delete-ad request. */ + export interface DeleteAdRequestFormProperties { + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId: FormControl, + } + export function CreateDeleteAdRequestFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + }); + + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ + export interface BulkDeleteAdResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ + responses?: Array; + } + + /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ + export interface BulkDeleteAdResponseFormProperties { + } + export function CreateBulkDeleteAdResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields returned in a delete-ad response. */ + export interface DeleteAdResponse { + + /** The ID of the ad that was deleted. */ + adId?: string | null; + + /** An array of the errors or warnings associated with the request. */ + errors?: Array; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + /** This type defines the fields returned in a delete-ad response. */ + export interface DeleteAdResponseFormProperties { + + /** The ID of the ad that was deleted. */ + adId: FormControl, + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId: FormControl, + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateDeleteAdResponseFormGroup() { + return new FormGroup({ + adId: new FormControl(undefined), + listingId: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ + export interface BulkDeleteAdsByInventoryReferenceRequest { + + /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ + requests?: Array; + } + + /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ + export interface BulkDeleteAdsByInventoryReferenceRequestFormProperties { + } + export function CreateBulkDeleteAdsByInventoryReferenceRequestFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ + export interface DeleteAdsByInventoryReferenceRequest { + + /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ + export interface DeleteAdsByInventoryReferenceRequestFormProperties { + + /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId: FormControl, + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType: FormControl, + } + export function CreateDeleteAdsByInventoryReferenceRequestFormGroup() { + return new FormGroup({ + inventoryReferenceId: new FormControl(undefined), + inventoryReferenceType: new FormControl(undefined), + }); + + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ + export interface BulkDeleteAdsByInventoryReferenceResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ + responses?: Array; + } + + /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ + export interface BulkDeleteAdsByInventoryReferenceResponseFormProperties { + } + export function CreateBulkDeleteAdsByInventoryReferenceResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ + export interface DeleteAdsByInventoryReferenceResponse { + + /** The list of ad IDs that were removed from the campaign. */ + adIds?: Array; + + /** The container for the errors associated with the request. */ + errors?: Array; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ + export interface DeleteAdsByInventoryReferenceResponseFormProperties { + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId: FormControl, + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType: FormControl, + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode: FormControl, + } + export function CreateDeleteAdsByInventoryReferenceResponseFormGroup() { + return new FormGroup({ + inventoryReferenceId: new FormControl(undefined), + inventoryReferenceType: new FormControl(undefined), + statusCode: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that describe an ad campaign. */ + export interface Campaign { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ + campaignId?: string | null; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ + campaignStatus?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + /** This type defines the fields that describe an ad campaign. */ + export interface CampaignFormProperties { + + /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ + campaignId: FormControl, + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName: FormControl, + + /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ + campaignStatus: FormControl, + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate: FormControl, + + /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate: FormControl, + } + export function CreateCampaignFormGroup() { + return new FormGroup({ + campaignId: new FormControl(undefined), + campaignName: new FormControl(undefined), + campaignStatus: new FormControl(undefined), + endDate: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + export interface CampaignCriterion { + + /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ + criterionType?: string | null; + + /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ + selectionRules?: Array; + } + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + export interface CampaignCriterionFormProperties { + + /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ + autoSelectFutureInventory: FormControl, + + /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ + criterionType: FormControl, + } + export function CreateCampaignCriterionFormGroup() { + return new FormGroup({ + autoSelectFutureInventory: new FormControl(undefined), + criterionType: new FormControl(undefined), + }); + + } + + + /** This type specifies the selection rules used to create a campaign. */ + export interface SelectionRule { + + /** A list of the brands of the items to be included in the campaign. */ + brands?: Array; + + /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ + categoryIds?: Array; + + /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ + categoryScope?: string | null; + + /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ + listingConditionIds?: Array; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + maxPrice?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minPrice?: Amount; + } + + /** This type specifies the selection rules used to create a campaign. */ + export interface SelectionRuleFormProperties { + + /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ + categoryScope: FormControl, + } + export function CreateSelectionRuleFormGroup() { + return new FormGroup({ + categoryScope: new FormControl(undefined), + }); + + } + + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + export interface FundingStrategy { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ + fundingModel?: string | null; + } + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + export interface FundingStrategyFormProperties { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage: FormControl, + + /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ + fundingModel: FormControl, + } + export function CreateFundingStrategyFormGroup() { + return new FormGroup({ + bidPercentage: new FormControl(undefined), + fundingModel: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface CampaignPagedCollection { + + /** A list of campaigns contained on this page from the paginated response. */ + campaigns?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface CampaignPagedCollectionFormProperties { + + /** The URI of the current page of results from the result set. */ + href: FormControl, + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next: FormControl, + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev: FormControl, + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateCampaignPagedCollectionFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type contains a list of campaigns. */ + export interface Campaigns { + + /** An array of campaigns and their details. */ + campaigns?: Array; + } + + /** This type contains a list of campaigns. */ + export interface CampaignsFormProperties { + } + export function CreateCampaignsFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields needed for a clone-campaign request. */ + export interface CloneCampaignRequest { + + /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + /** This type defines the fields needed for a clone-campaign request. */ + export interface CloneCampaignRequestFormProperties { + + /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName: FormControl, + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate: FormControl, + + /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate: FormControl, + } + export function CreateCloneCampaignRequestFormGroup() { + return new FormGroup({ + campaignName: new FormControl(undefined), + endDate: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ + export interface CreateCampaignRequest { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ + export interface CreateCampaignRequestFormProperties { + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName: FormControl, + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate: FormControl, + + /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate: FormControl, + } + export function CreateCreateCampaignRequestFormGroup() { + return new FormGroup({ + campaignName: new FormControl(undefined), + endDate: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ + export interface CreateReportTask { + + /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ + dimensions?: Array; + + /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ + inventoryReferences?: Array; + + /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ + listingIds?: Array; + + /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ + metricKeys?: Array; + + /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ + export interface CreateReportTaskFormProperties { + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom: FormControl, + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo: FormControl, + + /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ + reportFormat: FormControl, + + /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ + reportType: FormControl, + } + export function CreateCreateReportTaskFormGroup() { + return new FormGroup({ + dateFrom: new FormControl(undefined), + dateTo: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + reportFormat: new FormControl(undefined), + reportType: new FormControl(undefined), + }); + + } + + + /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ + export interface Dimension { + + /** A list of annotations associated with the dimension of the report. */ + annotationKeys?: Array; + + /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ + dimensionKey?: string | null; + } + + /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ + export interface DimensionFormProperties { + + /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ + dimensionKey: FormControl, + } + export function CreateDimensionFormGroup() { + return new FormGroup({ + dimensionKey: new FormControl(undefined), + }); + + } + + + /** This type defines the fields contained in an inventory reference ID. */ + export interface InventoryReference { + + /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ + inventoryReferenceId?: string | null; + + /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + /** This type defines the fields contained in an inventory reference ID. */ + export interface InventoryReferenceFormProperties { + + /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ + inventoryReferenceId: FormControl, + + /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ + inventoryReferenceType: FormControl, + } + export function CreateInventoryReferenceFormGroup() { + return new FormGroup({ + inventoryReferenceId: new FormControl(undefined), + inventoryReferenceType: new FormControl(undefined), + }); + + } + + + /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ + export interface DimensionKeyAnnotation { + + /** An annotation key associated with the dimension. */ + annotationKey?: string | null; + + /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + } + + /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ + export interface DimensionKeyAnnotationFormProperties { + + /** An annotation key associated with the dimension. */ + annotationKey: FormControl, + + /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ + dataType: FormControl, + } + export function CreateDimensionKeyAnnotationFormGroup() { + return new FormGroup({ + annotationKey: new FormControl(undefined), + dataType: new FormControl(undefined), + }); + + } + + + /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ + export interface DimensionMetadata { + + /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the dimension used to create the report. */ + dimensionKey?: string | null; + + /** An list of annotation keys associated with the specified dimension of the report. */ + dimensionKeyAnnotations?: Array; + } + + /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ + export interface DimensionMetadataFormProperties { + + /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ + dataType: FormControl, + + /** The name of the dimension used to create the report. */ + dimensionKey: FormControl, + } + export function CreateDimensionMetadataFormGroup() { + return new FormGroup({ + dataType: new FormControl(undefined), + dimensionKey: new FormControl(undefined), + }); + + } + + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + export interface DiscountBenefit { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffItem?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffOrder?: Amount; + + /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ + percentageOffItem?: string | null; + + /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ + percentageOffOrder?: string | null; + } + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + export interface DiscountBenefitFormProperties { + + /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ + percentageOffItem: FormControl, + + /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ + percentageOffOrder: FormControl, + } + export function CreateDiscountBenefitFormGroup() { + return new FormGroup({ + percentageOffItem: new FormControl(undefined), + percentageOffOrder: new FormControl(undefined), + }); + + } + + + /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ + export interface DiscountRule { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountSpecification?: DiscountSpecification; + + /** + * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ + export interface DiscountRuleFormProperties { + + /** + * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder: FormControl, + } + export function CreateDiscountRuleFormGroup() { + return new FormGroup({ + ruleOrder: new FormControl(undefined), + }); + + } + + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + export interface DiscountSpecification { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + forEachAmount?: Amount; + + /** + * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + forEachQuantity?: number | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minAmount?: Amount; + + /** + * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + minQuantity?: number | null; + + /** + * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfDiscountedItems?: number | null; + } + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + export interface DiscountSpecificationFormProperties { + + /** + * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + forEachQuantity: FormControl, + + /** + * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + minQuantity: FormControl, + + /** + * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfDiscountedItems: FormControl, + } + export function CreateDiscountSpecificationFormGroup() { + return new FormGroup({ + forEachQuantity: new FormControl(undefined), + minQuantity: new FormControl(undefined), + numberOfDiscountedItems: new FormControl(undefined), + }); + + } + + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + export interface InventoryCriterion { + + /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ + inventoryCriterionType?: string | null; + + /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ + inventoryItems?: Array; + + /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ + listingIds?: Array; + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + ruleCriteria?: RuleCriteria; + } + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + export interface InventoryCriterionFormProperties { + + /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ + inventoryCriterionType: FormControl, + } + export function CreateInventoryCriterionFormGroup() { + return new FormGroup({ + inventoryCriterionType: new FormControl(undefined), + }); + + } + + + /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ + export interface InventoryItem { + + /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ + inventoryReferenceId?: string | null; + } + + /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ + export interface InventoryItemFormProperties { + + /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ + inventoryReferenceId: FormControl, + } + export function CreateInventoryItemFormGroup() { + return new FormGroup({ + inventoryReferenceId: new FormControl(undefined), + }); + + } + + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + export interface RuleCriteria { + + /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeInventoryItems?: Array; + + /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeListingIds?: Array; + + /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ + markupInventoryItems?: Array; + + /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ + markupListingIds?: Array; + + /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ + selectionRules?: Array; + } + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + export interface RuleCriteriaFormProperties { + } + export function CreateRuleCriteriaFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields used to describe an item price markdown promotion. */ + export interface ItemPriceMarkdown { + + /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ + applyFreeShipping?: boolean | null; + + /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ + blockPriceIncreaseInItemRevision?: boolean | null; + + /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ + selectedInventoryDiscounts?: Array; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + /** This type defines the fields used to describe an item price markdown promotion. */ + export interface ItemPriceMarkdownFormProperties { + + /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ + applyFreeShipping: FormControl, + + /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ + autoSelectFutureInventory: FormControl, + + /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ + blockPriceIncreaseInItemRevision: FormControl, + + /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ + description: FormControl, + + /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ + endDate: FormControl, + + /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name: FormControl, + + /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ + priority: FormControl, + + /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl: FormControl, + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus: FormControl, + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate: FormControl, + } + export function CreateItemPriceMarkdownFormGroup() { + return new FormGroup({ + applyFreeShipping: new FormControl(undefined), + autoSelectFutureInventory: new FormControl(undefined), + blockPriceIncreaseInItemRevision: new FormControl(undefined), + description: new FormControl(undefined), + endDate: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + priority: new FormControl(undefined), + promotionImageUrl: new FormControl(undefined), + promotionStatus: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ + export interface SelectedInventoryDiscount { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ + discountId?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** + * For markdown promotions, this field is reserved for future use. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ + export interface SelectedInventoryDiscountFormProperties { + + /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ + discountId: FormControl, + + /** + * For markdown promotions, this field is reserved for future use. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder: FormControl, + } + export function CreateSelectedInventoryDiscountFormGroup() { + return new FormGroup({ + discountId: new FormControl(undefined), + ruleOrder: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ + export interface ItemPromotion { + + /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ + export interface ItemPromotionFormProperties { + + /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly: FormControl, + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description: FormControl, + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate: FormControl, + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name: FormControl, + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority: FormControl, + + /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl: FormControl, + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus: FormControl, + + /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ + promotionType: FormControl, + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate: FormControl, + } + export function CreateItemPromotionFormGroup() { + return new FormGroup({ + applyDiscountToSingleItemOnly: new FormControl(undefined), + description: new FormControl(undefined), + endDate: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + priority: new FormControl(undefined), + promotionImageUrl: new FormControl(undefined), + promotionStatus: new FormControl(undefined), + promotionType: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** This complex type defines the fields returned for a promotion. */ + export interface ItemPromotionResponse { + + /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + /** This complex type defines the fields returned for a promotion. */ + export interface ItemPromotionResponseFormProperties { + + /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly: FormControl, + + /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description: FormControl, + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate: FormControl, + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name: FormControl, + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority: FormControl, + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId: FormControl, + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl: FormControl, + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus: FormControl, + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType: FormControl, + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate: FormControl, + } + export function CreateItemPromotionResponseFormGroup() { + return new FormGroup({ + applyDiscountToSingleItemOnly: new FormControl(undefined), + description: new FormControl(undefined), + endDate: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + priority: new FormControl(undefined), + promotionId: new FormControl(undefined), + promotionImageUrl: new FormControl(undefined), + promotionStatus: new FormControl(undefined), + promotionType: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** This type defines the name and data type of a metric. */ + export interface MetricMetadata { + + /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the metric. */ + metricKey?: string | null; + } + + /** This type defines the name and data type of a metric. */ + export interface MetricMetadataFormProperties { + + /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ + dataType: FormControl, + + /** The name of the metric. */ + metricKey: FormControl, + } + export function CreateMetricMetadataFormGroup() { + return new FormGroup({ + dataType: new FormControl(undefined), + metricKey: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ + export interface PromotionDetail { + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** The URI of the promotion details. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ + export interface PromotionDetailFormProperties { + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description: FormControl, + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate: FormControl, + + /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name: FormControl, + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority: FormControl, + + /** The URI of the promotion details. */ + promotionHref: FormControl, + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId: FormControl, + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl: FormControl, + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus: FormControl, + + /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType: FormControl, + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate: FormControl, + } + export function CreatePromotionDetailFormGroup() { + return new FormGroup({ + description: new FormControl(undefined), + endDate: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + name: new FormControl(undefined), + priority: new FormControl(undefined), + promotionHref: new FormControl(undefined), + promotionId: new FormControl(undefined), + promotionImageUrl: new FormControl(undefined), + promotionStatus: new FormControl(undefined), + promotionType: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + + /** This type defines the fields in a promotion-level report. */ + export interface PromotionReportDetail { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemRevenue?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderRevenue?: Amount; + + /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ + averageOrderSize?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** + * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemsSoldQuantity?: number | null; + + /** + * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfOrdersSold?: number | null; + + /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ + percentageSalesLift?: string | null; + + /** The URI of the promotion report. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ + promotionReportId?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + /** This type defines the fields in a promotion-level report. */ + export interface PromotionReportDetailFormProperties { + + /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ + averageOrderSize: FormControl, + + /** + * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemsSoldQuantity: FormControl, + + /** + * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfOrdersSold: FormControl, + + /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ + percentageSalesLift: FormControl, + + /** The URI of the promotion report. */ + promotionHref: FormControl, + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId: FormControl, + + /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ + promotionReportId: FormControl, + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType: FormControl, + } + export function CreatePromotionReportDetailFormGroup() { + return new FormGroup({ + averageOrderSize: new FormControl(undefined), + itemsSoldQuantity: new FormControl(undefined), + numberOfOrdersSold: new FormControl(undefined), + percentageSalesLift: new FormControl(undefined), + promotionHref: new FormControl(undefined), + promotionId: new FormControl(undefined), + promotionReportId: new FormControl(undefined), + promotionType: new FormControl(undefined), + }); + + } + + + /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ + promotions?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsPagedCollectionFormProperties { + + /** The URI of the current page of results. */ + href: FormControl, + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next: FormControl, + + /** + * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev: FormControl, + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreatePromotionsPagedCollectionFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsReportPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list of promotionReports contained in the paginated result set. */ + promotionReports?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsReportPagedCollectionFormProperties { + + /** The URI of the current page of results. */ + href: FormControl, + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next: FormControl, + + /** + * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev: FormControl, + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreatePromotionsReportPagedCollectionFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type defines the fields included in the report. */ + export interface ReportMetadata { + + /** A list containing the metadata for the dimension used in the report. */ + dimensionMetadata?: Array; + + /** + * The maximum number of dimensions that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfDimensionsToRequest?: number | null; + + /** + * The maximum number of metrics that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfMetricsToRequest?: number | null; + + /** A list containing the metadata for the metrics in the report. */ + metricMetadata?: Array; + + /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + /** This type defines the fields included in the report. */ + export interface ReportMetadataFormProperties { + + /** + * The maximum number of dimensions that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfDimensionsToRequest: FormControl, + + /** + * The maximum number of metrics that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfMetricsToRequest: FormControl, + + /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ + reportType: FormControl, + } + export function CreateReportMetadataFormGroup() { + return new FormGroup({ + maxNumberOfDimensionsToRequest: new FormControl(undefined), + maxNumberOfMetricsToRequest: new FormControl(undefined), + reportType: new FormControl(undefined), + }); + + } + + + /** This type defines the metadata used by the all report types. */ + export interface ReportMetadatas { + + /** A list of the metadata for the associated report type. */ + reportMetadata?: Array; + } + + /** This type defines the metadata used by the all report types. */ + export interface ReportMetadatasFormProperties { + } + export function CreateReportMetadatasFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type defines the fields in a report task. */ + export interface ReportTask { + + /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** A list containing the dimension in the report. */ + dimensions?: Array; + + /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ + inventoryReferences?: Array; + + /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingIds?: Array; + + /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A list of metrics for the report task. */ + metricKeys?: Array; + + /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportExpirationDate?: string | null; + + /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The URL of the generated report, which can be used to download the report once it has been generated. */ + reportHref?: string | null; + + /** A unique eBay-assigned ID for the report. */ + reportId?: string | null; + + /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ + reportName?: string | null; + + /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCompletionDate?: string | null; + + /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCreationDate?: string | null; + + /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskExpectedCompletionDate?: string | null; + + /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ + reportTaskId?: string | null; + + /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ + reportTaskStatus?: string | null; + + /** A status message with additional information about the report task. */ + reportTaskStatusMessage?: string | null; + + /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + /** This type defines the fields in a report task. */ + export interface ReportTaskFormProperties { + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom: FormControl, + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo: FormControl, + + /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ + marketplaceId: FormControl, + + /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportExpirationDate: FormControl, + + /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ + reportFormat: FormControl, + + /** The URL of the generated report, which can be used to download the report once it has been generated. */ + reportHref: FormControl, + + /** A unique eBay-assigned ID for the report. */ + reportId: FormControl, + + /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ + reportName: FormControl, + + /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCompletionDate: FormControl, + + /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCreationDate: FormControl, + + /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskExpectedCompletionDate: FormControl, + + /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ + reportTaskId: FormControl, + + /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ + reportTaskStatus: FormControl, + + /** A status message with additional information about the report task. */ + reportTaskStatusMessage: FormControl, + + /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ + reportType: FormControl, + } + export function CreateReportTaskFormGroup() { + return new FormGroup({ + dateFrom: new FormControl(undefined), + dateTo: new FormControl(undefined), + marketplaceId: new FormControl(undefined), + reportExpirationDate: new FormControl(undefined), + reportFormat: new FormControl(undefined), + reportHref: new FormControl(undefined), + reportId: new FormControl(undefined), + reportName: new FormControl(undefined), + reportTaskCompletionDate: new FormControl(undefined), + reportTaskCreationDate: new FormControl(undefined), + reportTaskExpectedCompletionDate: new FormControl(undefined), + reportTaskId: new FormControl(undefined), + reportTaskStatus: new FormControl(undefined), + reportTaskStatusMessage: new FormControl(undefined), + reportType: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface ReportTaskPagedCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** A list of report tasks contained on this page from the paginated response. */ + reportTasks?: Array; + } + + /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface ReportTaskPagedCollectionFormProperties { + + /** The URI of the current page of results from the result set. */ + href: FormControl, + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next: FormControl, + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev: FormControl, + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreateReportTaskPagedCollectionFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ + export interface SummaryReportResponse { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** The date the report was generated. */ + lastUpdated?: string | null; + + /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ + percentageSalesLift?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ + export interface SummaryReportResponseFormProperties { + + /** The date the report was generated. */ + lastUpdated: FormControl, + + /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ + percentageSalesLift: FormControl, + } + export function CreateSummaryReportResponseFormGroup() { + return new FormGroup({ + lastUpdated: new FormControl(undefined), + percentageSalesLift: new FormControl(undefined), + }); + + } + + + /** This type specifies the bid percentage for an ad campaign. */ + export interface UpdateBidPercentageRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + } + + /** This type specifies the bid percentage for an ad campaign. */ + export interface UpdateBidPercentageRequestFormProperties { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage: FormControl, + } + export function CreateUpdateBidPercentageRequestFormGroup() { + return new FormGroup({ + bidPercentage: new FormControl(undefined), + }); + + } + + + /** This type specifies the updated name, and start and end dates for an update-campaign request. */ + export interface UpdateCampaignIdentificationRequest { + + /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ + campaignName?: string | null; + + /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ + startDate?: string | null; + } + + /** This type specifies the updated name, and start and end dates for an update-campaign request. */ + export interface UpdateCampaignIdentificationRequestFormProperties { + + /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ + campaignName: FormControl, + + /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate: FormControl, + + /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ + startDate: FormControl, + } + export function CreateUpdateCampaignIdentificationRequestFormGroup() { + return new FormGroup({ + campaignName: new FormControl(undefined), + endDate: new FormControl(undefined), + startDate: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @return {BulkAdResponse} Success + */ + BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. + * @return {BulkDeleteAdsByInventoryReferenceResponse} Success + */ + BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. + * @return {BulkDeleteAdResponse} Success + */ + BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. + * @return {BulkAdResponse} Success + */ + BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {AdPagedCollection} Success + */ + GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. + * @return {void} + */ + CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. + * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. + * @return {void} + */ + CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. + * Get ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Ad} Success + */ + GetAd(ad_id: string, campaign_id: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}); + } + + /** + * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. + * Delete ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteAd(ad_id: string, campaign_id: string): Observable> { + return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. + * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. + * @return {AdIds} Success + */ + DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. + * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. + * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. + * @return {Ads} Success + */ + GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}); + } + + /** + * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. + * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid + * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. + * @return {void} + */ + UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). + * Post ad_campaign/{campaign_id}/clone + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. + * @return {void} + */ + CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign + * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name + * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status + * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. + * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. + * @return {CampaignPagedCollection} Success + */ + GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}); + } + + /** + * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. + * Post ad_campaign + * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. + * @return {void} + */ + CreateCampaign(requestBody: CreateCampaignRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Campaign} Success + */ + GetCampaign(campaign_id: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}); + } + + /** + * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Delete ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteCampaign(campaign_id: string): Observable> { + return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/end + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + EndCampaign(campaign_id: string): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/find_campaign_by_ad_reference + * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} listing_id Identifier of the eBay listing associated with the ad. + * @return {Campaigns} Success + */ + FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/get_campaign_by_name + * @param {string} campaign_name Name of the campaign. + * @return {Campaign} Success + */ + GetCampaignByName(campaign_name: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}); + } + + /** + * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/pause + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + PauseCampaign(campaign_id: string): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/resume + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + ResumeCampaign(campaign_id: string): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. + * Post ad_campaign/{campaign_id}/update_campaign_identification + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. + * @return {void} + */ + UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. + * Get ad_report/{report_id} + * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. + * @return {void} Success + */ + GetReport(report_id: string): Observable> { + return this.http.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. + * Get ad_report_metadata + * @return {ReportMetadatas} Success + */ + GetReportMetadata(): Observable { + return this.http.get(this.baseUri + 'ad_report_metadata', {}); + } + + /** + * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. + * Get ad_report_metadata/{report_type} + * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT + * @return {ReportMetadata} Success + */ + GetReportMetadataForReportType(report_type: string): Observable { + return this.http.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}); + } + + /** + * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. + * Get ad_report_task + * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 + * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED + * @return {ReportTaskPagedCollection} Success + */ + GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}); + } + + /** + * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. + * Post ad_report_task + * @param {CreateReportTask} requestBody The container for the fields that define the report task. + * @return {void} + */ + CreateReportTask(requestBody: CreateReportTask): Observable> { + return this.http.post(this.baseUri + 'ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Get ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {ReportTask} Success + */ + GetReportTask(report_task_id: string): Observable { + return this.http.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}); + } + + /** + * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Delete ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {void} + */ + DeleteReportTask(report_task_id: string): Observable> { + return this.http.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. + * Post item_price_markdown + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {void} + */ + CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Observable> { + return this.http.post(this.baseUri + 'item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPriceMarkdown} Success + */ + GetItemPriceMarkdownPromotion(promotion_id: string): Observable { + return this.http.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); + } + + /** + * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. + * Put item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {string} Success + */ + UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Observable { + return this.http.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. + * Delete item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPriceMarkdownPromotion(promotion_id: string): Observable> { + return this.http.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. + * Post item_promotion + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {void} + */ + CreateItemPromotion(requestBody: ItemPromotion): Observable> { + return this.http.post(this.baseUri + 'item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPromotionResponse} Success + */ + GetItemPromotion(promotion_id: string): Observable { + return this.http.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); + } + + /** + * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. + * Put item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {BaseResponse} Success + */ + UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Observable { + return this.http.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. + * Delete item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPromotion(promotion_id: string): Observable> { + return this.http.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 + * Get promotion/{promotion_id}/get_listing_set + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {string} q Reserved for future use. + * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html + * @return {void} + */ + GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 + * Get promotion + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 + * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @return {PromotionsPagedCollection} Success + */ + GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); + } + + /** + * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). + * Post promotion/{promotion_id}/pause + * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + PausePromotion(promotion_id: string): Observable> { + return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. + * Post promotion/{promotion_id}/resume + * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + ResumePromotion(promotion_id: string): Observable> { + return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. + * Get promotion_report + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 + * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @return {PromotionsReportPagedCollection} Success + */ + GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}); + } + + /** + * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. + * Get promotion_summary_report + * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @return {SummaryReportResponse} Success + */ + GetPromotionSummaryReport(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_metadata.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_metadata.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_metadata.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_metadata.ts index f2d64953..0ef981e0 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_metadata.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_metadata.ts @@ -1,685 +1,685 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** A unique ID for a sales tax jurisdiction. */ - export interface SalesTaxJurisdiction { - - /** The unique ID for a sales tax jurisdiction. */ - salesTaxJurisdictionId?: string | null; - } - - /** A unique ID for a sales tax jurisdiction. */ - export interface SalesTaxJurisdictionFormProperties { - - /** The unique ID for a sales tax jurisdiction. */ - salesTaxJurisdictionId: FormControl, - } - export function CreateSalesTaxJurisdictionFormGroup() { - return new FormGroup({ - salesTaxJurisdictionId: new FormControl(undefined), - }); - - } - - - /** This complex type contains a list of sales tax jurisdictions. */ - export interface SalesTaxJurisdictions { - - /** A list of sales tax jurisdictions. */ - salesTaxJurisdictions?: Array; - } - - /** This complex type contains a list of sales tax jurisdictions. */ - export interface SalesTaxJurisdictionsFormProperties { - } - export function CreateSalesTaxJurisdictionsFormGroup() { - return new FormGroup({ - }); - - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An amount of time, as measured by the time-measurement units specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDurationFormProperties { - - /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** - * An amount of time, as measured by the time-measurement units specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value: FormControl, - } - export function CreateTimeDurationFormGroup() { - return new FormGroup({ - unit: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - /** A container that defines the elements of error and warning messages. */ - export interface ErrorFormProperties { - - /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category: FormControl, - - /** Name of the domain containing the service or application. */ - domain: FormControl, - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage: FormControl, - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message: FormControl, - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - - /** Container for a error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - /** Container for a error parameter. */ - export interface ErrorParameterFormProperties { - - /** Name of the entity that threw the error. */ - name: FormControl, - - /** A description of the error. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - export interface AutomotivePartsCompatibilityPolicy { - - /** The category ID to which the automotive-parts-compatibility policies apply. */ - categoryId?: string | null; - - /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ - compatibilityBasedOn?: string | null; - - /** Indicates the compatibility classification of the part based on high-level vehicle types. */ - compatibleVehicleTypes?: Array; - - /** - * Specifies the maximum number of compatible vehicle-applications allowed per item. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfCompatibleVehicles?: number | null; - } - export interface AutomotivePartsCompatibilityPolicyFormProperties { - - /** The category ID to which the automotive-parts-compatibility policies apply. */ - categoryId: FormControl, - - /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId: FormControl, - - /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ - compatibilityBasedOn: FormControl, - - /** - * Specifies the maximum number of compatible vehicle-applications allowed per item. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfCompatibleVehicles: FormControl, - } - export function CreateAutomotivePartsCompatibilityPolicyFormGroup() { - return new FormGroup({ - categoryId: new FormControl(undefined), - categoryTreeId: new FormControl(undefined), - compatibilityBasedOn: new FormControl(undefined), - maxNumberOfCompatibleVehicles: new FormControl(undefined), - }); - - } - - export interface AutomotivePartsCompatibilityPolicyResponse { - - /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ - automotivePartsCompatibilityPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - export interface AutomotivePartsCompatibilityPolicyResponseFormProperties { - } - export function CreateAutomotivePartsCompatibilityPolicyResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - export interface Exclusion { - - /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ - brands?: Array; - } - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - export interface ExclusionFormProperties { - } - export function CreateExclusionFormGroup() { - return new FormGroup({ - }); - - } - - export interface ItemCondition { - - /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ - conditionDescription?: string | null; - - /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ - conditionId?: string | null; - } - export interface ItemConditionFormProperties { - - /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ - conditionDescription: FormControl, - - /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ - conditionId: FormControl, - } - export function CreateItemConditionFormGroup() { - return new FormGroup({ - conditionDescription: new FormControl(undefined), - conditionId: new FormControl(undefined), - }); - - } - - export interface ItemConditionPolicy { - - /** The category ID to which the item-condition policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ - itemConditionRequired?: boolean | null; - - /** The item-condition values allowed in the category. */ - itemConditions?: Array; - } - export interface ItemConditionPolicyFormProperties { - - /** The category ID to which the item-condition policy applies. */ - categoryId: FormControl, - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId: FormControl, - - /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ - itemConditionRequired: FormControl, - } - export function CreateItemConditionPolicyFormGroup() { - return new FormGroup({ - categoryId: new FormControl(undefined), - categoryTreeId: new FormControl(undefined), - itemConditionRequired: new FormControl(undefined), - }); - - } - - export interface ItemConditionPolicyResponse { - - /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ - itemConditionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - export interface ItemConditionPolicyResponseFormProperties { - } - export function CreateItemConditionPolicyResponseFormGroup() { - return new FormGroup({ - }); - - } - - export interface ListingStructurePolicy { - - /** The category ID to which the listing-structure policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ - variationsSupported?: boolean | null; - } - export interface ListingStructurePolicyFormProperties { - - /** The category ID to which the listing-structure policy applies. */ - categoryId: FormControl, - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId: FormControl, - - /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ - variationsSupported: FormControl, - } - export function CreateListingStructurePolicyFormGroup() { - return new FormGroup({ - categoryId: new FormControl(undefined), - categoryTreeId: new FormControl(undefined), - variationsSupported: new FormControl(undefined), - }); - - } - - export interface ListingStructurePolicyResponse { - - /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ - listingStructurePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - export interface ListingStructurePolicyResponseFormProperties { - } - export function CreateListingStructurePolicyResponseFormGroup() { - return new FormGroup({ - }); - - } - - export interface NegotiatedPricePolicy { - - /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ - bestOfferAutoAcceptEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ - bestOfferAutoDeclineEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ - bestOfferCounterEnabled?: boolean | null; - - /** The category ID to which the negotiated-price policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - } - export interface NegotiatedPricePolicyFormProperties { - - /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ - bestOfferAutoAcceptEnabled: FormControl, - - /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ - bestOfferAutoDeclineEnabled: FormControl, - - /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ - bestOfferCounterEnabled: FormControl, - - /** The category ID to which the negotiated-price policies apply. */ - categoryId: FormControl, - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId: FormControl, - } - export function CreateNegotiatedPricePolicyFormGroup() { - return new FormGroup({ - bestOfferAutoAcceptEnabled: new FormControl(undefined), - bestOfferAutoDeclineEnabled: new FormControl(undefined), - bestOfferCounterEnabled: new FormControl(undefined), - categoryId: new FormControl(undefined), - categoryTreeId: new FormControl(undefined), - }); - - } - - export interface NegotiatedPricePolicyResponse { - - /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ - negotiatedPricePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - export interface NegotiatedPricePolicyResponseFormProperties { - } - export function CreateNegotiatedPricePolicyResponseFormGroup() { - return new FormGroup({ - }); - - } - - - /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ - export interface ProductAdoptionPolicy { - - /** The category ID to which the listing policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - exclusion?: Exclusion; - - /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ - productRequired?: boolean | null; - } - - /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ - export interface ProductAdoptionPolicyFormProperties { - - /** The category ID to which the listing policies apply. */ - categoryId: FormControl, - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId: FormControl, - - /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ - productRequired: FormControl, - } - export function CreateProductAdoptionPolicyFormGroup() { - return new FormGroup({ - categoryId: new FormControl(undefined), - categoryTreeId: new FormControl(undefined), - productRequired: new FormControl(undefined), - }); - - } - - - /** This is the response object returned by a call to getProductAdoptionPolicies. */ - export interface ProductAdoptionPolicyResponse { - - /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ - productAdoptionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - /** This is the response object returned by a call to getProductAdoptionPolicies. */ - export interface ProductAdoptionPolicyResponseFormProperties { - } - export function CreateProductAdoptionPolicyResponseFormGroup() { - return new FormGroup({ - }); - - } - - export interface ReturnPolicy { - - /** The category ID to which the return policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - domestic?: ReturnPolicyDetails; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - international?: ReturnPolicyDetails; - - /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ - required?: boolean | null; - } - export interface ReturnPolicyFormProperties { - - /** The category ID to which the return policy applies. */ - categoryId: FormControl, - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId: FormControl, - - /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ - required: FormControl, - } - export function CreateReturnPolicyFormGroup() { - return new FormGroup({ - categoryId: new FormControl(undefined), - categoryTreeId: new FormControl(undefined), - required: new FormControl(undefined), - }); - - } - - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - export interface ReturnPolicyDetails { - - /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ - policyDescriptionEnabled?: boolean | null; - - /** A list of refund methods allowed for the associated category. */ - refundMethods?: Array; - - /** A list of return methods allowed for the associated category. */ - returnMethods?: Array; - - /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ - returnPeriods?: Array; - - /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ - returnsAcceptanceEnabled?: boolean | null; - - /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ - returnShippingCostPayers?: Array; - } - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - export interface ReturnPolicyDetailsFormProperties { - - /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ - policyDescriptionEnabled: FormControl, - - /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ - returnsAcceptanceEnabled: FormControl, - } - export function CreateReturnPolicyDetailsFormGroup() { - return new FormGroup({ - policyDescriptionEnabled: new FormControl(undefined), - returnsAcceptanceEnabled: new FormControl(undefined), - }); - - } - - export interface ReturnPolicyResponse { - - /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ - returnPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - export interface ReturnPolicyResponseFormProperties { - } - export function CreateReturnPolicyResponseFormGroup() { - return new FormGroup({ - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. - * Get country/{countryCode}/sales_tax_jurisdiction - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. - * @return {SalesTaxJurisdictions} Success - */ - GetSalesTaxJurisdictions(countryCode: string): Observable { - return this.http.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}); - } - - /** - * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT - * @return {AutomotivePartsCompatibilityPolicyResponse} Success - */ - GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_item_condition_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ItemConditionPolicyResponse} Success - */ - GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_listing_structure_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ListingStructurePolicyResponse} Success - */ - GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_negotiated_price_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {NegotiatedPricePolicyResponse} Success - */ - GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_product_adoption_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ProductAdoptionPolicyResponse} Success - */ - GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_return_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** A unique ID for a sales tax jurisdiction. */ + export interface SalesTaxJurisdiction { + + /** The unique ID for a sales tax jurisdiction. */ + salesTaxJurisdictionId?: string | null; + } + + /** A unique ID for a sales tax jurisdiction. */ + export interface SalesTaxJurisdictionFormProperties { + + /** The unique ID for a sales tax jurisdiction. */ + salesTaxJurisdictionId: FormControl, + } + export function CreateSalesTaxJurisdictionFormGroup() { + return new FormGroup({ + salesTaxJurisdictionId: new FormControl(undefined), + }); + + } + + + /** This complex type contains a list of sales tax jurisdictions. */ + export interface SalesTaxJurisdictions { + + /** A list of sales tax jurisdictions. */ + salesTaxJurisdictions?: Array; + } + + /** This complex type contains a list of sales tax jurisdictions. */ + export interface SalesTaxJurisdictionsFormProperties { + } + export function CreateSalesTaxJurisdictionsFormGroup() { + return new FormGroup({ + }); + + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An amount of time, as measured by the time-measurement units specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDurationFormProperties { + + /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** + * An amount of time, as measured by the time-measurement units specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value: FormControl, + } + export function CreateTimeDurationFormGroup() { + return new FormGroup({ + unit: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + /** A container that defines the elements of error and warning messages. */ + export interface ErrorFormProperties { + + /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category: FormControl, + + /** Name of the domain containing the service or application. */ + domain: FormControl, + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage: FormControl, + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message: FormControl, + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + + /** Container for a error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + /** Container for a error parameter. */ + export interface ErrorParameterFormProperties { + + /** Name of the entity that threw the error. */ + name: FormControl, + + /** A description of the error. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + export interface AutomotivePartsCompatibilityPolicy { + + /** The category ID to which the automotive-parts-compatibility policies apply. */ + categoryId?: string | null; + + /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ + compatibilityBasedOn?: string | null; + + /** Indicates the compatibility classification of the part based on high-level vehicle types. */ + compatibleVehicleTypes?: Array; + + /** + * Specifies the maximum number of compatible vehicle-applications allowed per item. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfCompatibleVehicles?: number | null; + } + export interface AutomotivePartsCompatibilityPolicyFormProperties { + + /** The category ID to which the automotive-parts-compatibility policies apply. */ + categoryId: FormControl, + + /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId: FormControl, + + /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ + compatibilityBasedOn: FormControl, + + /** + * Specifies the maximum number of compatible vehicle-applications allowed per item. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfCompatibleVehicles: FormControl, + } + export function CreateAutomotivePartsCompatibilityPolicyFormGroup() { + return new FormGroup({ + categoryId: new FormControl(undefined), + categoryTreeId: new FormControl(undefined), + compatibilityBasedOn: new FormControl(undefined), + maxNumberOfCompatibleVehicles: new FormControl(undefined), + }); + + } + + export interface AutomotivePartsCompatibilityPolicyResponse { + + /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ + automotivePartsCompatibilityPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + export interface AutomotivePartsCompatibilityPolicyResponseFormProperties { + } + export function CreateAutomotivePartsCompatibilityPolicyResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + export interface Exclusion { + + /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ + brands?: Array; + } + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + export interface ExclusionFormProperties { + } + export function CreateExclusionFormGroup() { + return new FormGroup({ + }); + + } + + export interface ItemCondition { + + /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ + conditionDescription?: string | null; + + /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ + conditionId?: string | null; + } + export interface ItemConditionFormProperties { + + /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ + conditionDescription: FormControl, + + /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ + conditionId: FormControl, + } + export function CreateItemConditionFormGroup() { + return new FormGroup({ + conditionDescription: new FormControl(undefined), + conditionId: new FormControl(undefined), + }); + + } + + export interface ItemConditionPolicy { + + /** The category ID to which the item-condition policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ + itemConditionRequired?: boolean | null; + + /** The item-condition values allowed in the category. */ + itemConditions?: Array; + } + export interface ItemConditionPolicyFormProperties { + + /** The category ID to which the item-condition policy applies. */ + categoryId: FormControl, + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId: FormControl, + + /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ + itemConditionRequired: FormControl, + } + export function CreateItemConditionPolicyFormGroup() { + return new FormGroup({ + categoryId: new FormControl(undefined), + categoryTreeId: new FormControl(undefined), + itemConditionRequired: new FormControl(undefined), + }); + + } + + export interface ItemConditionPolicyResponse { + + /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ + itemConditionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + export interface ItemConditionPolicyResponseFormProperties { + } + export function CreateItemConditionPolicyResponseFormGroup() { + return new FormGroup({ + }); + + } + + export interface ListingStructurePolicy { + + /** The category ID to which the listing-structure policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ + variationsSupported?: boolean | null; + } + export interface ListingStructurePolicyFormProperties { + + /** The category ID to which the listing-structure policy applies. */ + categoryId: FormControl, + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId: FormControl, + + /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ + variationsSupported: FormControl, + } + export function CreateListingStructurePolicyFormGroup() { + return new FormGroup({ + categoryId: new FormControl(undefined), + categoryTreeId: new FormControl(undefined), + variationsSupported: new FormControl(undefined), + }); + + } + + export interface ListingStructurePolicyResponse { + + /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ + listingStructurePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + export interface ListingStructurePolicyResponseFormProperties { + } + export function CreateListingStructurePolicyResponseFormGroup() { + return new FormGroup({ + }); + + } + + export interface NegotiatedPricePolicy { + + /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ + bestOfferAutoAcceptEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ + bestOfferAutoDeclineEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ + bestOfferCounterEnabled?: boolean | null; + + /** The category ID to which the negotiated-price policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + } + export interface NegotiatedPricePolicyFormProperties { + + /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ + bestOfferAutoAcceptEnabled: FormControl, + + /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ + bestOfferAutoDeclineEnabled: FormControl, + + /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ + bestOfferCounterEnabled: FormControl, + + /** The category ID to which the negotiated-price policies apply. */ + categoryId: FormControl, + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId: FormControl, + } + export function CreateNegotiatedPricePolicyFormGroup() { + return new FormGroup({ + bestOfferAutoAcceptEnabled: new FormControl(undefined), + bestOfferAutoDeclineEnabled: new FormControl(undefined), + bestOfferCounterEnabled: new FormControl(undefined), + categoryId: new FormControl(undefined), + categoryTreeId: new FormControl(undefined), + }); + + } + + export interface NegotiatedPricePolicyResponse { + + /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ + negotiatedPricePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + export interface NegotiatedPricePolicyResponseFormProperties { + } + export function CreateNegotiatedPricePolicyResponseFormGroup() { + return new FormGroup({ + }); + + } + + + /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ + export interface ProductAdoptionPolicy { + + /** The category ID to which the listing policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + exclusion?: Exclusion; + + /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ + productRequired?: boolean | null; + } + + /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ + export interface ProductAdoptionPolicyFormProperties { + + /** The category ID to which the listing policies apply. */ + categoryId: FormControl, + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId: FormControl, + + /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ + productRequired: FormControl, + } + export function CreateProductAdoptionPolicyFormGroup() { + return new FormGroup({ + categoryId: new FormControl(undefined), + categoryTreeId: new FormControl(undefined), + productRequired: new FormControl(undefined), + }); + + } + + + /** This is the response object returned by a call to getProductAdoptionPolicies. */ + export interface ProductAdoptionPolicyResponse { + + /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ + productAdoptionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + /** This is the response object returned by a call to getProductAdoptionPolicies. */ + export interface ProductAdoptionPolicyResponseFormProperties { + } + export function CreateProductAdoptionPolicyResponseFormGroup() { + return new FormGroup({ + }); + + } + + export interface ReturnPolicy { + + /** The category ID to which the return policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + domestic?: ReturnPolicyDetails; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + international?: ReturnPolicyDetails; + + /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ + required?: boolean | null; + } + export interface ReturnPolicyFormProperties { + + /** The category ID to which the return policy applies. */ + categoryId: FormControl, + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId: FormControl, + + /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ + required: FormControl, + } + export function CreateReturnPolicyFormGroup() { + return new FormGroup({ + categoryId: new FormControl(undefined), + categoryTreeId: new FormControl(undefined), + required: new FormControl(undefined), + }); + + } + + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + export interface ReturnPolicyDetails { + + /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ + policyDescriptionEnabled?: boolean | null; + + /** A list of refund methods allowed for the associated category. */ + refundMethods?: Array; + + /** A list of return methods allowed for the associated category. */ + returnMethods?: Array; + + /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ + returnPeriods?: Array; + + /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ + returnsAcceptanceEnabled?: boolean | null; + + /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ + returnShippingCostPayers?: Array; + } + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + export interface ReturnPolicyDetailsFormProperties { + + /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ + policyDescriptionEnabled: FormControl, + + /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ + returnsAcceptanceEnabled: FormControl, + } + export function CreateReturnPolicyDetailsFormGroup() { + return new FormGroup({ + policyDescriptionEnabled: new FormControl(undefined), + returnsAcceptanceEnabled: new FormControl(undefined), + }); + + } + + export interface ReturnPolicyResponse { + + /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ + returnPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + export interface ReturnPolicyResponseFormProperties { + } + export function CreateReturnPolicyResponseFormGroup() { + return new FormGroup({ + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. + * Get country/{countryCode}/sales_tax_jurisdiction + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. + * @return {SalesTaxJurisdictions} Success + */ + GetSalesTaxJurisdictions(countryCode: string): Observable { + return this.http.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}); + } + + /** + * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT + * @return {AutomotivePartsCompatibilityPolicyResponse} Success + */ + GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_item_condition_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ItemConditionPolicyResponse} Success + */ + GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_listing_structure_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ListingStructurePolicyResponse} Success + */ + GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_negotiated_price_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {NegotiatedPricePolicyResponse} Success + */ + GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_product_adoption_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ProductAdoptionPolicyResponse} Success + */ + GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_return_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_negotiation.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_negotiation.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_negotiation.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_negotiation.ts index 64272840..70d712e6 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_negotiation.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_negotiation.ts @@ -1,503 +1,503 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount in the specified currency. */ - value?: string | null; - } - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface AmountFormProperties { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ - currency: FormControl, - - /** The monetary amount in the specified currency. */ - value: FormControl, - } - export function CreateAmountFormGroup() { - return new FormGroup({ - currency: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ - export interface CreateOffersRequest { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ - allowCounterOffer?: boolean | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ - offeredItems?: Array; - } - - /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ - export interface CreateOffersRequestFormProperties { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ - allowCounterOffer: FormControl, - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ - message: FormControl, - } - export function CreateCreateOffersRequestFormGroup() { - return new FormGroup({ - allowCounterOffer: new FormControl(undefined), - message: new FormControl(undefined), - }); - - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDurationFormProperties { - - /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ - unit: FormControl, - - /** - * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value: FormControl, - } - export function CreateTimeDurationFormGroup() { - return new FormGroup({ - unit: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** A complex type that defines the offer being made to an "interested" buyer. */ - export interface OfferedItem { - - /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ - discountPercentage?: string | null; - - /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ - listingId?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - price?: Amount; - - /** - * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - /** A complex type that defines the offer being made to an "interested" buyer. */ - export interface OfferedItemFormProperties { - - /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ - discountPercentage: FormControl, - - /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ - listingId: FormControl, - - /** - * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity: FormControl, - } - export function CreateOfferedItemFormGroup() { - return new FormGroup({ - discountPercentage: new FormControl(undefined), - listingId: new FormControl(undefined), - quantity: new FormControl(undefined), - }); - - } - - - /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ - export interface EligibleItem { - - /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ - listingId?: string | null; - } - - /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ - export interface EligibleItemFormProperties { - - /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ - listingId: FormControl, - } - export function CreateEligibleItemFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - }); - - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - /** This type defines the fields that can be returned in an error. */ - export interface ErrorFormProperties { - - /** Identifies the type of erro. */ - category: FormControl, - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain: FormControl, - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A more detailed explanation of the error. */ - longMessage: FormControl, - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message: FormControl, - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - export interface ErrorParameterFormProperties { - - /** The object of the error. */ - name: FormControl, - - /** The value of the object. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** A complex type that defines an offer that a seller makes to eligible buyers. */ - export interface Offer { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ - allowCounterOffer?: boolean | null; - - /** This complex type identifies an eBay user. */ - buyer?: User; - - /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - creationDate?: string | null; - - /** The eBay UserName of the user (seller) who initiated the offer. */ - initiatedBy?: string | null; - - /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ - lastModifiedDate?: string | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ - offeredItems?: Array; - - /** A unique eBay-assigned identifier for the offer. */ - offerId?: string | null; - - /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ - offerStatus?: string | null; - - /** The type of offer being made. For implementation help, refer to eBay API documentation */ - offerType?: string | null; - - /** A unique, eBay-assigned ID for the revision of the offer. */ - revision?: string | null; - } - - /** A complex type that defines an offer that a seller makes to eligible buyers. */ - export interface OfferFormProperties { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ - allowCounterOffer: FormControl, - - /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - creationDate: FormControl, - - /** The eBay UserName of the user (seller) who initiated the offer. */ - initiatedBy: FormControl, - - /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ - lastModifiedDate: FormControl, - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ - message: FormControl, - - /** A unique eBay-assigned identifier for the offer. */ - offerId: FormControl, - - /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ - offerStatus: FormControl, - - /** The type of offer being made. For implementation help, refer to eBay API documentation */ - offerType: FormControl, - - /** A unique, eBay-assigned ID for the revision of the offer. */ - revision: FormControl, - } - export function CreateOfferFormGroup() { - return new FormGroup({ - allowCounterOffer: new FormControl(undefined), - creationDate: new FormControl(undefined), - initiatedBy: new FormControl(undefined), - lastModifiedDate: new FormControl(undefined), - message: new FormControl(undefined), - offerId: new FormControl(undefined), - offerStatus: new FormControl(undefined), - offerType: new FormControl(undefined), - revision: new FormControl(undefined), - }); - - } - - - /** This complex type identifies an eBay user. */ - export interface User { - - /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ - maskedUsername?: string | null; - } - - /** This complex type identifies an eBay user. */ - export interface UserFormProperties { - - /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ - maskedUsername: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - maskedUsername: new FormControl(undefined), - }); - - } - - - /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ - export interface PagedEligibleItemCollection { - - /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ - eligibleItems?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ - export interface PagedEligibleItemCollectionFormProperties { - - /** The URI of the current page of results from the result set. */ - href: FormControl, - - /** - * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next: FormControl, - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev: FormControl, - - /** - * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreatePagedEligibleItemCollectionFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - - /** The response object returned from a SendOfferToInterestedBuyers request. */ - export interface SendOfferToInterestedBuyersCollectionResponse { - - /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ - offers?: Array; - } - - /** The response object returned from a SendOfferToInterestedBuyers request. */ - export interface SendOfferToInterestedBuyersCollectionResponseFormProperties { - } - export function CreateSendOfferToInterestedBuyersCollectionResponseFormGroup() { - return new FormGroup({ - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Get find_eligible_items - * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 - * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {PagedEligibleItemCollection} Success - */ - FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Post send_offer_to_interested_buyers - * @param {CreateOffersRequest} requestBody Send offer to eligible items request. - * @return {SendOfferToInterestedBuyersCollectionResponse} Success - */ - SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Observable { - return this.http.post(this.baseUri + 'send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount in the specified currency. */ + value?: string | null; + } + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface AmountFormProperties { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ + currency: FormControl, + + /** The monetary amount in the specified currency. */ + value: FormControl, + } + export function CreateAmountFormGroup() { + return new FormGroup({ + currency: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ + export interface CreateOffersRequest { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ + allowCounterOffer?: boolean | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ + offeredItems?: Array; + } + + /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ + export interface CreateOffersRequestFormProperties { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ + allowCounterOffer: FormControl, + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ + message: FormControl, + } + export function CreateCreateOffersRequestFormGroup() { + return new FormGroup({ + allowCounterOffer: new FormControl(undefined), + message: new FormControl(undefined), + }); + + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDurationFormProperties { + + /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ + unit: FormControl, + + /** + * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value: FormControl, + } + export function CreateTimeDurationFormGroup() { + return new FormGroup({ + unit: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** A complex type that defines the offer being made to an "interested" buyer. */ + export interface OfferedItem { + + /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ + discountPercentage?: string | null; + + /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ + listingId?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + price?: Amount; + + /** + * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + /** A complex type that defines the offer being made to an "interested" buyer. */ + export interface OfferedItemFormProperties { + + /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ + discountPercentage: FormControl, + + /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ + listingId: FormControl, + + /** + * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity: FormControl, + } + export function CreateOfferedItemFormGroup() { + return new FormGroup({ + discountPercentage: new FormControl(undefined), + listingId: new FormControl(undefined), + quantity: new FormControl(undefined), + }); + + } + + + /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ + export interface EligibleItem { + + /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ + listingId?: string | null; + } + + /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ + export interface EligibleItemFormProperties { + + /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ + listingId: FormControl, + } + export function CreateEligibleItemFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + }); + + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + /** This type defines the fields that can be returned in an error. */ + export interface ErrorFormProperties { + + /** Identifies the type of erro. */ + category: FormControl, + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain: FormControl, + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A more detailed explanation of the error. */ + longMessage: FormControl, + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message: FormControl, + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + export interface ErrorParameterFormProperties { + + /** The object of the error. */ + name: FormControl, + + /** The value of the object. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** A complex type that defines an offer that a seller makes to eligible buyers. */ + export interface Offer { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ + allowCounterOffer?: boolean | null; + + /** This complex type identifies an eBay user. */ + buyer?: User; + + /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + creationDate?: string | null; + + /** The eBay UserName of the user (seller) who initiated the offer. */ + initiatedBy?: string | null; + + /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ + lastModifiedDate?: string | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ + offeredItems?: Array; + + /** A unique eBay-assigned identifier for the offer. */ + offerId?: string | null; + + /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ + offerStatus?: string | null; + + /** The type of offer being made. For implementation help, refer to eBay API documentation */ + offerType?: string | null; + + /** A unique, eBay-assigned ID for the revision of the offer. */ + revision?: string | null; + } + + /** A complex type that defines an offer that a seller makes to eligible buyers. */ + export interface OfferFormProperties { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ + allowCounterOffer: FormControl, + + /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + creationDate: FormControl, + + /** The eBay UserName of the user (seller) who initiated the offer. */ + initiatedBy: FormControl, + + /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ + lastModifiedDate: FormControl, + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ + message: FormControl, + + /** A unique eBay-assigned identifier for the offer. */ + offerId: FormControl, + + /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ + offerStatus: FormControl, + + /** The type of offer being made. For implementation help, refer to eBay API documentation */ + offerType: FormControl, + + /** A unique, eBay-assigned ID for the revision of the offer. */ + revision: FormControl, + } + export function CreateOfferFormGroup() { + return new FormGroup({ + allowCounterOffer: new FormControl(undefined), + creationDate: new FormControl(undefined), + initiatedBy: new FormControl(undefined), + lastModifiedDate: new FormControl(undefined), + message: new FormControl(undefined), + offerId: new FormControl(undefined), + offerStatus: new FormControl(undefined), + offerType: new FormControl(undefined), + revision: new FormControl(undefined), + }); + + } + + + /** This complex type identifies an eBay user. */ + export interface User { + + /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ + maskedUsername?: string | null; + } + + /** This complex type identifies an eBay user. */ + export interface UserFormProperties { + + /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ + maskedUsername: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + maskedUsername: new FormControl(undefined), + }); + + } + + + /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ + export interface PagedEligibleItemCollection { + + /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ + eligibleItems?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ + export interface PagedEligibleItemCollectionFormProperties { + + /** The URI of the current page of results from the result set. */ + href: FormControl, + + /** + * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next: FormControl, + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev: FormControl, + + /** + * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreatePagedEligibleItemCollectionFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + + /** The response object returned from a SendOfferToInterestedBuyers request. */ + export interface SendOfferToInterestedBuyersCollectionResponse { + + /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ + offers?: Array; + } + + /** The response object returned from a SendOfferToInterestedBuyers request. */ + export interface SendOfferToInterestedBuyersCollectionResponseFormProperties { + } + export function CreateSendOfferToInterestedBuyersCollectionResponseFormGroup() { + return new FormGroup({ + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Get find_eligible_items + * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 + * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {PagedEligibleItemCollection} Success + */ + FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Post send_offer_to_interested_buyers + * @param {CreateOffersRequest} requestBody Send offer to eligible items request. + * @return {SendOfferToInterestedBuyersCollectionResponse} Success + */ + SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Observable { + return this.http.post(this.baseUri + 'send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/sell_recommendation.txt b/Tests/SwagTsTests/NG2FormGroupResults/sell_recommendation.ts similarity index 98% rename from Tests/SwagTsTests/NG2FormGroupResults/sell_recommendation.txt rename to Tests/SwagTsTests/NG2FormGroupResults/sell_recommendation.ts index 3e5596bd..9106b4b0 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/sell_recommendation.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/sell_recommendation.ts @@ -1,334 +1,334 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - export interface Ad { - - /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ - bidPercentages?: Array; - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - promoteWithAd?: PromoteWithAd; - } - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - export interface AdFormProperties { - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - promoteWithAd: FormControl, - } - export function CreateAdFormGroup() { - return new FormGroup({ - promoteWithAd: new FormControl(undefined), - }); - - } - - - /** A complex type that returns data related to Promoted Listings bid percentages. */ - export interface BidPercentages { - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - basis?: Basis; - - /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ - value?: string | null; - } - - /** A complex type that returns data related to Promoted Listings bid percentages. */ - export interface BidPercentagesFormProperties { - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - basis: FormControl, - - /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ - value: FormControl, - } - export function CreateBidPercentagesFormGroup() { - return new FormGroup({ - basis: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - export enum Basis { TRENDING = 0 } - - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - /** This type defines the fields that can be returned in an error. */ - export interface ErrorFormProperties { - - /** Identifies the type of erro. */ - category: FormControl, - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain: FormControl, - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId: FormControl, - - /** A more detailed explanation of the error. */ - longMessage: FormControl, - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message: FormControl, - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - category: new FormControl(undefined), - domain: new FormControl(undefined), - errorId: new FormControl(undefined), - longMessage: new FormControl(undefined), - message: new FormControl(undefined), - subdomain: new FormControl(undefined), - }); - - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - export interface ErrorParameterFormProperties { - - /** The object of the error. */ - name: FormControl, - - /** The value of the object. */ - value: FormControl, - } - export function CreateErrorParameterFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - value: new FormControl(undefined), - }); - - } - - - /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ - export interface FindListingRecommendationRequest { - - /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ - listingIds?: Array; - } - - /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ - export interface FindListingRecommendationRequestFormProperties { - } - export function CreateFindListingRecommendationRequestFormGroup() { - return new FormGroup({ - }); - - } - - - /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ - export interface ListingRecommendation { - - /** An ID that identifies the active listing associated with the eBay recommendations. */ - listingId?: string | null; - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - marketing?: MarketingRecommendation; - } - - /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ - export interface ListingRecommendationFormProperties { - - /** An ID that identifies the active listing associated with the eBay recommendations. */ - listingId: FormControl, - } - export function CreateListingRecommendationFormGroup() { - return new FormGroup({ - listingId: new FormControl(undefined), - }); - - } - - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - export interface MarketingRecommendation { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - ad?: Ad; - - /** A message that can conditionally accompany the listing information. */ - message?: string | null; - } - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - export interface MarketingRecommendationFormProperties { - - /** A message that can conditionally accompany the listing information. */ - message: FormControl, - } - export function CreateMarketingRecommendationFormGroup() { - return new FormGroup({ - message: new FormControl(undefined), - }); - - } - - - /** The high-level object used to return a set of Promoted Listings ad recommendations. */ - export interface PagedListingRecommendationCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ - listingRecommendations?: Array; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - /** The high-level object used to return a set of Promoted Listings ad recommendations. */ - export interface PagedListingRecommendationCollectionFormProperties { - - /** The URI of the current page of results from the result set. */ - href: FormControl, - - /** - * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit: FormControl, - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next: FormControl, - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset: FormControl, - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev: FormControl, - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total: FormControl, - } - export function CreatePagedListingRecommendationCollectionFormGroup() { - return new FormGroup({ - href: new FormControl(undefined), - limit: new FormControl(undefined), - next: new FormControl(undefined), - offset: new FormControl(undefined), - prev: new FormControl(undefined), - total: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. - * Post find - * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} - * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {void} Success - */ - FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Observable> { - return this.http.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + export interface Ad { + + /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ + bidPercentages?: Array; + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + promoteWithAd?: PromoteWithAd; + } + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + export interface AdFormProperties { + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + promoteWithAd: FormControl, + } + export function CreateAdFormGroup() { + return new FormGroup({ + promoteWithAd: new FormControl(undefined), + }); + + } + + + /** A complex type that returns data related to Promoted Listings bid percentages. */ + export interface BidPercentages { + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + basis?: Basis; + + /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ + value?: string | null; + } + + /** A complex type that returns data related to Promoted Listings bid percentages. */ + export interface BidPercentagesFormProperties { + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + basis: FormControl, + + /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ + value: FormControl, + } + export function CreateBidPercentagesFormGroup() { + return new FormGroup({ + basis: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + export enum Basis { TRENDING = 0 } + + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + /** This type defines the fields that can be returned in an error. */ + export interface ErrorFormProperties { + + /** Identifies the type of erro. */ + category: FormControl, + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain: FormControl, + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId: FormControl, + + /** A more detailed explanation of the error. */ + longMessage: FormControl, + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message: FormControl, + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + category: new FormControl(undefined), + domain: new FormControl(undefined), + errorId: new FormControl(undefined), + longMessage: new FormControl(undefined), + message: new FormControl(undefined), + subdomain: new FormControl(undefined), + }); + + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + export interface ErrorParameterFormProperties { + + /** The object of the error. */ + name: FormControl, + + /** The value of the object. */ + value: FormControl, + } + export function CreateErrorParameterFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + value: new FormControl(undefined), + }); + + } + + + /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ + export interface FindListingRecommendationRequest { + + /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ + listingIds?: Array; + } + + /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ + export interface FindListingRecommendationRequestFormProperties { + } + export function CreateFindListingRecommendationRequestFormGroup() { + return new FormGroup({ + }); + + } + + + /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ + export interface ListingRecommendation { + + /** An ID that identifies the active listing associated with the eBay recommendations. */ + listingId?: string | null; + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + marketing?: MarketingRecommendation; + } + + /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ + export interface ListingRecommendationFormProperties { + + /** An ID that identifies the active listing associated with the eBay recommendations. */ + listingId: FormControl, + } + export function CreateListingRecommendationFormGroup() { + return new FormGroup({ + listingId: new FormControl(undefined), + }); + + } + + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + export interface MarketingRecommendation { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + ad?: Ad; + + /** A message that can conditionally accompany the listing information. */ + message?: string | null; + } + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + export interface MarketingRecommendationFormProperties { + + /** A message that can conditionally accompany the listing information. */ + message: FormControl, + } + export function CreateMarketingRecommendationFormGroup() { + return new FormGroup({ + message: new FormControl(undefined), + }); + + } + + + /** The high-level object used to return a set of Promoted Listings ad recommendations. */ + export interface PagedListingRecommendationCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ + listingRecommendations?: Array; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + /** The high-level object used to return a set of Promoted Listings ad recommendations. */ + export interface PagedListingRecommendationCollectionFormProperties { + + /** The URI of the current page of results from the result set. */ + href: FormControl, + + /** + * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit: FormControl, + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next: FormControl, + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset: FormControl, + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev: FormControl, + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total: FormControl, + } + export function CreatePagedListingRecommendationCollectionFormGroup() { + return new FormGroup({ + href: new FormControl(undefined), + limit: new FormControl(undefined), + next: new FormControl(undefined), + offset: new FormControl(undefined), + prev: new FormControl(undefined), + total: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. + * Post find + * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} + * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {void} Success + */ + FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Observable> { + return this.http.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/xero-identity.txt b/Tests/SwagTsTests/NG2FormGroupResults/xero-identity.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/xero-identity.txt rename to Tests/SwagTsTests/NG2FormGroupResults/xero-identity.ts index df5c2687..ccd5988d 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/xero-identity.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/xero-identity.ts @@ -1,189 +1,189 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Connection { - - /** Xero identifier */ - id?: string | null; - - /** Xero identifier of organisation */ - tenantId?: string | null; - - /** Identifier shared across connections authorised at the same time */ - authEventId?: string | null; - - /** Xero tenant type (i.e. ORGANISATION, PRACTICE) */ - tenantType?: string | null; - - /** Xero tenant name */ - tenantName?: string | null; - - /** The date when the user connected this tenant to your app */ - createdDateUtc?: Date | null; - - /** The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. */ - updatedDateUtc?: Date | null; - } - export interface ConnectionFormProperties { - - /** Xero identifier */ - id: FormControl, - - /** Xero identifier of organisation */ - tenantId: FormControl, - - /** Identifier shared across connections authorised at the same time */ - authEventId: FormControl, - - /** Xero tenant type (i.e. ORGANISATION, PRACTICE) */ - tenantType: FormControl, - - /** Xero tenant name */ - tenantName: FormControl, - - /** The date when the user connected this tenant to your app */ - createdDateUtc: FormControl, - - /** The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. */ - updatedDateUtc: FormControl, - } - export function CreateConnectionFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - tenantId: new FormControl(undefined), - authEventId: new FormControl(undefined), - tenantType: new FormControl(undefined), - tenantName: new FormControl(undefined), - createdDateUtc: new FormControl(undefined), - updatedDateUtc: new FormControl(undefined), - }); - - } - - export interface RefreshToken { - - /** Xero grant type */ - grant_type?: string | null; - - /** refresh token provided during authentication flow */ - refresh_token?: string | null; - - /** client id for Xero app */ - client_id?: string | null; - - /** client secret for Xero app 2 */ - client_secret?: string | null; - } - export interface RefreshTokenFormProperties { - - /** Xero grant type */ - grant_type: FormControl, - - /** refresh token provided during authentication flow */ - refresh_token: FormControl, - - /** client id for Xero app */ - client_id: FormControl, - - /** client secret for Xero app 2 */ - client_secret: FormControl, - } - export function CreateRefreshTokenFormGroup() { - return new FormGroup({ - grant_type: new FormControl(undefined), - refresh_token: new FormControl(undefined), - client_id: new FormControl(undefined), - client_secret: new FormControl(undefined), - }); - - } - - export interface AccessToken { - - /** Xero unique identifier */ - id_token?: string | null; - - /** access token provided during authentication flow */ - access_token?: string | null; - - /** time in milliseconds until access token expires. */ - expires_in?: string | null; - - /** type of token i.e. Bearer */ - token_type?: string | null; - - /** token used to refresh an expired access token */ - refresh_token?: string | null; - } - export interface AccessTokenFormProperties { - - /** Xero unique identifier */ - id_token: FormControl, - - /** access token provided during authentication flow */ - access_token: FormControl, - - /** time in milliseconds until access token expires. */ - expires_in: FormControl, - - /** type of token i.e. Bearer */ - token_type: FormControl, - - /** token used to refresh an expired access token */ - refresh_token: FormControl, - } - export function CreateAccessTokenFormGroup() { - return new FormGroup({ - id_token: new FormControl(undefined), - access_token: new FormControl(undefined), - expires_in: new FormControl(undefined), - token_type: new FormControl(undefined), - refresh_token: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Allows you to retrieve the connections for this user - * Override the base server url that include version - * Get connections - * @param {string} authEventId Filter by authEventId - * @return {Array} Success - return response of type Connections array with 0 to n Connection - */ - GetConnections(authEventId: string | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'connections?authEventId=' + (authEventId == null ? '' : encodeURIComponent(authEventId)), {}); - } - - /** - * Allows you to delete a connection for this user (i.e. disconnect a tenant) - * Override the base server url that include version - * Delete connections/{id} - * @param {string} id Unique identifier for retrieving single object - * @return {void} - */ - DeleteConnection(id: string): Observable> { - return this.http.delete(this.baseUri + 'connections/' + (id == null ? '' : encodeURIComponent(id)), { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Connection { + + /** Xero identifier */ + id?: string | null; + + /** Xero identifier of organisation */ + tenantId?: string | null; + + /** Identifier shared across connections authorised at the same time */ + authEventId?: string | null; + + /** Xero tenant type (i.e. ORGANISATION, PRACTICE) */ + tenantType?: string | null; + + /** Xero tenant name */ + tenantName?: string | null; + + /** The date when the user connected this tenant to your app */ + createdDateUtc?: Date | null; + + /** The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. */ + updatedDateUtc?: Date | null; + } + export interface ConnectionFormProperties { + + /** Xero identifier */ + id: FormControl, + + /** Xero identifier of organisation */ + tenantId: FormControl, + + /** Identifier shared across connections authorised at the same time */ + authEventId: FormControl, + + /** Xero tenant type (i.e. ORGANISATION, PRACTICE) */ + tenantType: FormControl, + + /** Xero tenant name */ + tenantName: FormControl, + + /** The date when the user connected this tenant to your app */ + createdDateUtc: FormControl, + + /** The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. */ + updatedDateUtc: FormControl, + } + export function CreateConnectionFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + tenantId: new FormControl(undefined), + authEventId: new FormControl(undefined), + tenantType: new FormControl(undefined), + tenantName: new FormControl(undefined), + createdDateUtc: new FormControl(undefined), + updatedDateUtc: new FormControl(undefined), + }); + + } + + export interface RefreshToken { + + /** Xero grant type */ + grant_type?: string | null; + + /** refresh token provided during authentication flow */ + refresh_token?: string | null; + + /** client id for Xero app */ + client_id?: string | null; + + /** client secret for Xero app 2 */ + client_secret?: string | null; + } + export interface RefreshTokenFormProperties { + + /** Xero grant type */ + grant_type: FormControl, + + /** refresh token provided during authentication flow */ + refresh_token: FormControl, + + /** client id for Xero app */ + client_id: FormControl, + + /** client secret for Xero app 2 */ + client_secret: FormControl, + } + export function CreateRefreshTokenFormGroup() { + return new FormGroup({ + grant_type: new FormControl(undefined), + refresh_token: new FormControl(undefined), + client_id: new FormControl(undefined), + client_secret: new FormControl(undefined), + }); + + } + + export interface AccessToken { + + /** Xero unique identifier */ + id_token?: string | null; + + /** access token provided during authentication flow */ + access_token?: string | null; + + /** time in milliseconds until access token expires. */ + expires_in?: string | null; + + /** type of token i.e. Bearer */ + token_type?: string | null; + + /** token used to refresh an expired access token */ + refresh_token?: string | null; + } + export interface AccessTokenFormProperties { + + /** Xero unique identifier */ + id_token: FormControl, + + /** access token provided during authentication flow */ + access_token: FormControl, + + /** time in milliseconds until access token expires. */ + expires_in: FormControl, + + /** type of token i.e. Bearer */ + token_type: FormControl, + + /** token used to refresh an expired access token */ + refresh_token: FormControl, + } + export function CreateAccessTokenFormGroup() { + return new FormGroup({ + id_token: new FormControl(undefined), + access_token: new FormControl(undefined), + expires_in: new FormControl(undefined), + token_type: new FormControl(undefined), + refresh_token: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Allows you to retrieve the connections for this user + * Override the base server url that include version + * Get connections + * @param {string} authEventId Filter by authEventId + * @return {Array} Success - return response of type Connections array with 0 to n Connection + */ + GetConnections(authEventId: string | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'connections?authEventId=' + (authEventId == null ? '' : encodeURIComponent(authEventId)), {}); + } + + /** + * Allows you to delete a connection for this user (i.e. disconnect a tenant) + * Override the base server url that include version + * Delete connections/{id} + * @param {string} id Unique identifier for retrieving single object + * @return {void} + */ + DeleteConnection(id: string): Observable> { + return this.http.delete(this.baseUri + 'connections/' + (id == null ? '' : encodeURIComponent(id)), { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-au.txt b/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-au.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-au.txt rename to Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-au.ts index fa8f2d7b..fe6f4294 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-au.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-au.ts @@ -1,3124 +1,3124 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Employees { - Employees1?: Array; - } - export interface EmployeesFormProperties { - } - export function CreateEmployeesFormGroup() { - return new FormGroup({ - }); - - } - - export interface Employee { - - /** - * First name of employee - * Required - */ - FirstName: string; - - /** - * Last name of employee - * Required - */ - LastName: string; - - /** - * Date of birth of the employee (YYYY-MM-DD) - * Required - */ - DateOfBirth: string; - HomeAddress?: HomeAddress; - - /** Start date for an employee (YYYY-MM-DD) */ - StartDate?: string | null; - - /** Title of the employee */ - Title?: string | null; - - /** Middle name(s) of the employee */ - MiddleNames?: string | null; - - /** The email address for the employee */ - Email?: string | null; - - /** The employee’s gender. See Employee Gender */ - Gender?: EmployeeGender | null; - - /** Employee phone number */ - Phone?: string | null; - - /** Employee mobile number */ - Mobile?: string | null; - - /** Employee’s twitter name */ - TwitterUserName?: string | null; - - /** Authorised to approve other employees' leave requests */ - IsAuthorisedToApproveLeave?: boolean | null; - - /** Authorised to approve timesheets */ - IsAuthorisedToApproveTimesheets?: boolean | null; - - /** JobTitle of the employee */ - JobTitle?: string | null; - - /** Employees classification */ - Classification?: string | null; - - /** Xero unique identifier for earnings rate */ - OrdinaryEarningsRateID?: string | null; - - /** Xero unique identifier for payroll calendar for the employee */ - PayrollCalendarID?: string | null; - - /** The Employee Group allows you to report on payroll expenses and liabilities for each group of employees */ - EmployeeGroupName?: string | null; - - /** Xero unique identifier for an Employee */ - EmployeeID?: string | null; - - /** Employee Termination Date (YYYY-MM-DD) */ - TerminationDate?: string | null; - BankAccounts?: Array; - PayTemplate?: PayTemplate; - OpeningBalances?: OpeningBalances; - TaxDeclaration?: TaxDeclaration; - LeaveBalances?: Array; - LeaveLines?: Array; - SuperMemberships?: Array; - - /** Employee Status Types */ - Status?: EmployeeStatus | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface EmployeeFormProperties { - - /** - * First name of employee - * Required - */ - FirstName: FormControl, - - /** - * Last name of employee - * Required - */ - LastName: FormControl, - - /** - * Date of birth of the employee (YYYY-MM-DD) - * Required - */ - DateOfBirth: FormControl, - - /** Start date for an employee (YYYY-MM-DD) */ - StartDate: FormControl, - - /** Title of the employee */ - Title: FormControl, - - /** Middle name(s) of the employee */ - MiddleNames: FormControl, - - /** The email address for the employee */ - Email: FormControl, - - /** The employee’s gender. See Employee Gender */ - Gender: FormControl, - - /** Employee phone number */ - Phone: FormControl, - - /** Employee mobile number */ - Mobile: FormControl, - - /** Employee’s twitter name */ - TwitterUserName: FormControl, - - /** Authorised to approve other employees' leave requests */ - IsAuthorisedToApproveLeave: FormControl, - - /** Authorised to approve timesheets */ - IsAuthorisedToApproveTimesheets: FormControl, - - /** JobTitle of the employee */ - JobTitle: FormControl, - - /** Employees classification */ - Classification: FormControl, - - /** Xero unique identifier for earnings rate */ - OrdinaryEarningsRateID: FormControl, - - /** Xero unique identifier for payroll calendar for the employee */ - PayrollCalendarID: FormControl, - - /** The Employee Group allows you to report on payroll expenses and liabilities for each group of employees */ - EmployeeGroupName: FormControl, - - /** Xero unique identifier for an Employee */ - EmployeeID: FormControl, - - /** Employee Termination Date (YYYY-MM-DD) */ - TerminationDate: FormControl, - - /** Employee Status Types */ - Status: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreateEmployeeFormGroup() { - return new FormGroup({ - FirstName: new FormControl(undefined, [Validators.required]), - LastName: new FormControl(undefined, [Validators.required]), - DateOfBirth: new FormControl(undefined, [Validators.required]), - StartDate: new FormControl(undefined), - Title: new FormControl(undefined), - MiddleNames: new FormControl(undefined), - Email: new FormControl(undefined), - Gender: new FormControl(undefined), - Phone: new FormControl(undefined), - Mobile: new FormControl(undefined), - TwitterUserName: new FormControl(undefined), - IsAuthorisedToApproveLeave: new FormControl(undefined), - IsAuthorisedToApproveTimesheets: new FormControl(undefined), - JobTitle: new FormControl(undefined), - Classification: new FormControl(undefined), - OrdinaryEarningsRateID: new FormControl(undefined), - PayrollCalendarID: new FormControl(undefined), - EmployeeGroupName: new FormControl(undefined), - EmployeeID: new FormControl(undefined), - TerminationDate: new FormControl(undefined), - Status: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export interface HomeAddress { - - /** - * Address line 1 for employee home address - * Required - */ - AddressLine1: string; - - /** Address line 2 for employee home address */ - AddressLine2?: string | null; - - /** Suburb for employee home address */ - City?: string | null; - - /** State abbreviation for employee home address */ - Region?: HomeAddressRegion | null; - - /** PostCode for employee home address */ - PostalCode?: string | null; - - /** Country of HomeAddress */ - Country?: string | null; - } - export interface HomeAddressFormProperties { - - /** - * Address line 1 for employee home address - * Required - */ - AddressLine1: FormControl, - - /** Address line 2 for employee home address */ - AddressLine2: FormControl, - - /** Suburb for employee home address */ - City: FormControl, - - /** State abbreviation for employee home address */ - Region: FormControl, - - /** PostCode for employee home address */ - PostalCode: FormControl, - - /** Country of HomeAddress */ - Country: FormControl, - } - export function CreateHomeAddressFormGroup() { - return new FormGroup({ - AddressLine1: new FormControl(undefined, [Validators.required]), - AddressLine2: new FormControl(undefined), - City: new FormControl(undefined), - Region: new FormControl(undefined), - PostalCode: new FormControl(undefined), - Country: new FormControl(undefined), - }); - - } - - export enum HomeAddressRegion { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } - - export enum EmployeeGender { N = 0, M = 1, F = 2, I = 3 } - - export interface BankAccount { - - /** The text that will appear on your employee's bank statement when they receive payment */ - StatementText?: string | null; - - /** The name of the account */ - AccountName?: string | null; - - /** The BSB number of the account */ - BSB?: string | null; - - /** The account number */ - AccountNumber?: string | null; - - /** If this account is the Remaining bank account */ - Remainder?: boolean | null; - - /** - * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) - * Type: double - */ - Amount?: number | null; - } - export interface BankAccountFormProperties { - - /** The text that will appear on your employee's bank statement when they receive payment */ - StatementText: FormControl, - - /** The name of the account */ - AccountName: FormControl, - - /** The BSB number of the account */ - BSB: FormControl, - - /** The account number */ - AccountNumber: FormControl, - - /** If this account is the Remaining bank account */ - Remainder: FormControl, - - /** - * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) - * Type: double - */ - Amount: FormControl, - } - export function CreateBankAccountFormGroup() { - return new FormGroup({ - StatementText: new FormControl(undefined), - AccountName: new FormControl(undefined), - BSB: new FormControl(undefined), - AccountNumber: new FormControl(undefined), - Remainder: new FormControl(undefined), - Amount: new FormControl(undefined), - }); - - } - - export interface PayTemplate { - EarningsLines?: Array; - DeductionLines?: Array; - SuperLines?: Array; - ReimbursementLines?: Array; - LeaveLines?: Array; - } - export interface PayTemplateFormProperties { - } - export function CreatePayTemplateFormGroup() { - return new FormGroup({ - }); - - } - - export interface EarningsLine { - - /** - * Xero unique id for earnings rate - * Required - */ - EarningsRateID: string; - - /** Required */ - CalculationType: EarningsLineCalculationType; - - /** - * Annual salary for earnings line - * Type: double - */ - AnnualSalary?: number | null; - - /** - * number of units for earning line - * Type: double - */ - NumberOfUnitsPerWeek?: number | null; - - /** - * Rate per unit of the EarningsLine. - * Type: double - */ - RatePerUnit?: number | null; - - /** - * Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" - * Type: double - */ - NormalNumberOfUnits?: number | null; - - /** - * Earnings rate amount - * Type: double - */ - Amount?: number | null; - - /** - * Earnings rate number of units. - * Type: double - */ - NumberOfUnits?: number | null; - - /** - * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - FixedAmount?: number | null; - } - export interface EarningsLineFormProperties { - - /** - * Xero unique id for earnings rate - * Required - */ - EarningsRateID: FormControl, - - /** Required */ - CalculationType: FormControl, - - /** - * Annual salary for earnings line - * Type: double - */ - AnnualSalary: FormControl, - - /** - * number of units for earning line - * Type: double - */ - NumberOfUnitsPerWeek: FormControl, - - /** - * Rate per unit of the EarningsLine. - * Type: double - */ - RatePerUnit: FormControl, - - /** - * Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" - * Type: double - */ - NormalNumberOfUnits: FormControl, - - /** - * Earnings rate amount - * Type: double - */ - Amount: FormControl, - - /** - * Earnings rate number of units. - * Type: double - */ - NumberOfUnits: FormControl, - - /** - * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - FixedAmount: FormControl, - } - export function CreateEarningsLineFormGroup() { - return new FormGroup({ - EarningsRateID: new FormControl(undefined, [Validators.required]), - CalculationType: new FormControl(undefined, [Validators.required]), - AnnualSalary: new FormControl(undefined), - NumberOfUnitsPerWeek: new FormControl(undefined), - RatePerUnit: new FormControl(undefined), - NormalNumberOfUnits: new FormControl(undefined), - Amount: new FormControl(undefined), - NumberOfUnits: new FormControl(undefined), - FixedAmount: new FormControl(undefined), - }); - - } - - export enum EarningsLineCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } - - export interface DeductionLine { - - /** - * Xero deduction type identifier - * Required - */ - DeductionTypeID: string; - - /** Required */ - CalculationType: DeductionLineCalculationType; - - /** - * Deduction type amount - * Type: double - */ - Amount?: number | null; - - /** - * The Percentage of the Deduction - * Type: double - */ - Percentage?: number | null; - - /** - * Deduction number of units - * Type: double - */ - NumberOfUnits?: number | null; - } - export interface DeductionLineFormProperties { - - /** - * Xero deduction type identifier - * Required - */ - DeductionTypeID: FormControl, - - /** Required */ - CalculationType: FormControl, - - /** - * Deduction type amount - * Type: double - */ - Amount: FormControl, - - /** - * The Percentage of the Deduction - * Type: double - */ - Percentage: FormControl, - - /** - * Deduction number of units - * Type: double - */ - NumberOfUnits: FormControl, - } - export function CreateDeductionLineFormGroup() { - return new FormGroup({ - DeductionTypeID: new FormControl(undefined, [Validators.required]), - CalculationType: new FormControl(undefined, [Validators.required]), - Amount: new FormControl(undefined), - Percentage: new FormControl(undefined), - NumberOfUnits: new FormControl(undefined), - }); - - } - - export enum DeductionLineCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } - - export interface SuperLine { - - /** Xero super membership ID */ - SuperMembershipID?: string | null; - ContributionType?: SuperLineContributionType | null; - CalculationType?: SuperLineCalculationType | null; - - /** - * amount of mimimum earnings - * Type: double - */ - MinimumMonthlyEarnings?: number | null; - - /** expense account code */ - ExpenseAccountCode?: string | null; - - /** liabilty account code */ - LiabilityAccountCode?: string | null; - - /** - * percentage for super line - * Type: double - */ - Percentage?: number | null; - - /** - * Super membership amount - * Type: double - */ - Amount?: number | null; - } - export interface SuperLineFormProperties { - - /** Xero super membership ID */ - SuperMembershipID: FormControl, - ContributionType: FormControl, - CalculationType: FormControl, - - /** - * amount of mimimum earnings - * Type: double - */ - MinimumMonthlyEarnings: FormControl, - - /** expense account code */ - ExpenseAccountCode: FormControl, - - /** liabilty account code */ - LiabilityAccountCode: FormControl, - - /** - * percentage for super line - * Type: double - */ - Percentage: FormControl, - - /** - * Super membership amount - * Type: double - */ - Amount: FormControl, - } - export function CreateSuperLineFormGroup() { - return new FormGroup({ - SuperMembershipID: new FormControl(undefined), - ContributionType: new FormControl(undefined), - CalculationType: new FormControl(undefined), - MinimumMonthlyEarnings: new FormControl(undefined), - ExpenseAccountCode: new FormControl(undefined), - LiabilityAccountCode: new FormControl(undefined), - Percentage: new FormControl(undefined), - Amount: new FormControl(undefined), - }); - - } - - export enum SuperLineContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } - - export enum SuperLineCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } - - export interface ReimbursementLine { - - /** Xero reimbursement type identifier */ - ReimbursementTypeID?: string | null; - - /** - * Reimbursement type amount - * Type: double - */ - Amount?: number | null; - - /** - * Reimbursement lines description (max length 50) - * Max length: 50 - */ - Description?: string | null; - - /** Reimbursement expense account. For posted pay run you should be able to see expense account code. */ - ExpenseAccount?: string | null; - } - export interface ReimbursementLineFormProperties { - - /** Xero reimbursement type identifier */ - ReimbursementTypeID: FormControl, - - /** - * Reimbursement type amount - * Type: double - */ - Amount: FormControl, - - /** - * Reimbursement lines description (max length 50) - * Max length: 50 - */ - Description: FormControl, - - /** Reimbursement expense account. For posted pay run you should be able to see expense account code. */ - ExpenseAccount: FormControl, - } - export function CreateReimbursementLineFormGroup() { - return new FormGroup({ - ReimbursementTypeID: new FormControl(undefined), - Amount: new FormControl(undefined), - Description: new FormControl(undefined, [Validators.maxLength(50)]), - ExpenseAccount: new FormControl(undefined), - }); - - } - - export interface LeaveLine { - - /** Xero leave type identifier */ - LeaveTypeID?: string | null; - - /** Calculation type for leave line for Opening Balance on Employee */ - CalculationType?: LeaveLineCalculationType | null; - EntitlementFinalPayPayoutType?: LeaveLineEntitlementFinalPayPayoutType | null; - EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; - - /** amount of leave line */ - IncludeSuperannuationGuaranteeContribution?: boolean | null; - - /** - * Leave number of units - * Type: double - */ - NumberOfUnits?: number | null; - } - export interface LeaveLineFormProperties { - - /** Xero leave type identifier */ - LeaveTypeID: FormControl, - - /** Calculation type for leave line for Opening Balance on Employee */ - CalculationType: FormControl, - EntitlementFinalPayPayoutType: FormControl, - EmploymentTerminationPaymentType: FormControl, - - /** amount of leave line */ - IncludeSuperannuationGuaranteeContribution: FormControl, - - /** - * Leave number of units - * Type: double - */ - NumberOfUnits: FormControl, - } - export function CreateLeaveLineFormGroup() { - return new FormGroup({ - LeaveTypeID: new FormControl(undefined), - CalculationType: new FormControl(undefined), - EntitlementFinalPayPayoutType: new FormControl(undefined), - EmploymentTerminationPaymentType: new FormControl(undefined), - IncludeSuperannuationGuaranteeContribution: new FormControl(undefined), - NumberOfUnits: new FormControl(undefined), - }); - - } - - export enum LeaveLineCalculationType { NOCALCULATIONREQUIRED = 0, FIXEDAMOUNTEACHPERIOD = 1, ENTERRATEINPAYTEMPLATE = 2, BASEDONORDINARYEARNINGS = 3, '' = 4 } - - export enum LeaveLineEntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } - - export enum LeaveLineEmploymentTerminationPaymentType { O = 0, R = 1 } - - export interface OpeningBalances { - - /** Opening Balance Date. (YYYY-MM-DD) */ - OpeningBalanceDate?: string | null; - - /** Opening Balance tax */ - Tax?: string | null; - EarningsLines?: Array; - DeductionLines?: Array; - SuperLines?: Array; - ReimbursementLines?: Array; - LeaveLines?: Array; - } - export interface OpeningBalancesFormProperties { - - /** Opening Balance Date. (YYYY-MM-DD) */ - OpeningBalanceDate: FormControl, - - /** Opening Balance tax */ - Tax: FormControl, - } - export function CreateOpeningBalancesFormGroup() { - return new FormGroup({ - OpeningBalanceDate: new FormControl(undefined), - Tax: new FormControl(undefined), - }); - - } - - export interface TaxDeclaration { - - /** - * Address line 1 for employee home address - * Required - */ - EmployeeID: string; - - /** Required */ - EmploymentBasis: TaxDeclarationEmploymentBasis; - TFNExemptionType?: TaxDeclarationTFNExemptionType | null; - - /** The tax file number e.g 123123123. */ - TaxFileNumber?: string | null; - - /** If the employee is Australian resident for tax purposes. e.g true or false */ - AustralianResidentForTaxPurposes?: boolean | null; - ResidencyStatus?: TaxDeclarationResidencyStatus | null; - - /** If tax free threshold claimed. e.g true or false */ - TaxFreeThresholdClaimed?: boolean | null; - - /** If has tax offset estimated then the tax offset estimated amount. e.g 100 */ - TaxOffsetEstimatedAmount?: string | null; - - /** If employee has HECS or HELP debt. e.g true or false */ - HasHELPDebt?: boolean | null; - - /** If employee has financial supplement debt. e.g true or false */ - HasSFSSDebt?: boolean | null; - - /** If employee has trade support loan. e.g true or false */ - HasTradeSupportLoanDebt?: boolean | null; - - /** If the employee has requested that additional tax be withheld each pay run. e.g 50 */ - UpwardVariationTaxWithholdingAmount?: string | null; - - /** If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false */ - EligibleToReceiveLeaveLoading?: boolean | null; - - /** If the employee has approved withholding variation. e.g (0 - 100) */ - ApprovedWithholdingVariationPercentage?: string | null; - - /** If the employee is eligible for student startup loan rules */ - HasStudentStartupLoan?: boolean | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - export interface TaxDeclarationFormProperties { - - /** - * Address line 1 for employee home address - * Required - */ - EmployeeID: FormControl, - - /** Required */ - EmploymentBasis: FormControl, - TFNExemptionType: FormControl, - - /** The tax file number e.g 123123123. */ - TaxFileNumber: FormControl, - - /** If the employee is Australian resident for tax purposes. e.g true or false */ - AustralianResidentForTaxPurposes: FormControl, - ResidencyStatus: FormControl, - - /** If tax free threshold claimed. e.g true or false */ - TaxFreeThresholdClaimed: FormControl, - - /** If has tax offset estimated then the tax offset estimated amount. e.g 100 */ - TaxOffsetEstimatedAmount: FormControl, - - /** If employee has HECS or HELP debt. e.g true or false */ - HasHELPDebt: FormControl, - - /** If employee has financial supplement debt. e.g true or false */ - HasSFSSDebt: FormControl, - - /** If employee has trade support loan. e.g true or false */ - HasTradeSupportLoanDebt: FormControl, - - /** If the employee has requested that additional tax be withheld each pay run. e.g 50 */ - UpwardVariationTaxWithholdingAmount: FormControl, - - /** If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false */ - EligibleToReceiveLeaveLoading: FormControl, - - /** If the employee has approved withholding variation. e.g (0 - 100) */ - ApprovedWithholdingVariationPercentage: FormControl, - - /** If the employee is eligible for student startup loan rules */ - HasStudentStartupLoan: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreateTaxDeclarationFormGroup() { - return new FormGroup({ - EmployeeID: new FormControl(undefined, [Validators.required]), - EmploymentBasis: new FormControl(undefined, [Validators.required]), - TFNExemptionType: new FormControl(undefined), - TaxFileNumber: new FormControl(undefined), - AustralianResidentForTaxPurposes: new FormControl(undefined), - ResidencyStatus: new FormControl(undefined), - TaxFreeThresholdClaimed: new FormControl(undefined), - TaxOffsetEstimatedAmount: new FormControl(undefined), - HasHELPDebt: new FormControl(undefined), - HasSFSSDebt: new FormControl(undefined), - HasTradeSupportLoanDebt: new FormControl(undefined), - UpwardVariationTaxWithholdingAmount: new FormControl(undefined), - EligibleToReceiveLeaveLoading: new FormControl(undefined), - ApprovedWithholdingVariationPercentage: new FormControl(undefined), - HasStudentStartupLoan: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export enum TaxDeclarationEmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } - - export enum TaxDeclarationTFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } - - export enum TaxDeclarationResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } - - export interface LeaveBalance { - - /** The name of the leave type */ - LeaveName?: string | null; - - /** Identifier of the leave type (see PayItems) */ - LeaveTypeID?: string | null; - - /** - * The balance of the leave available - * Type: double - */ - NumberOfUnits?: number | null; - - /** The type of units as specified by the LeaveType (see PayItems) */ - TypeOfUnits?: string | null; - } - export interface LeaveBalanceFormProperties { - - /** The name of the leave type */ - LeaveName: FormControl, - - /** Identifier of the leave type (see PayItems) */ - LeaveTypeID: FormControl, - - /** - * The balance of the leave available - * Type: double - */ - NumberOfUnits: FormControl, - - /** The type of units as specified by the LeaveType (see PayItems) */ - TypeOfUnits: FormControl, - } - export function CreateLeaveBalanceFormGroup() { - return new FormGroup({ - LeaveName: new FormControl(undefined), - LeaveTypeID: new FormControl(undefined), - NumberOfUnits: new FormControl(undefined), - TypeOfUnits: new FormControl(undefined), - }); - - } - - export interface SuperMembership { - - /** Xero unique identifier for Super membership */ - SuperMembershipID?: string | null; - - /** - * Xero identifier for super fund - * Required - */ - SuperFundID: string; - - /** - * The memberhsip number assigned to the employee by the super fund. - * Required - * Type: double - */ - EmployeeNumber: number; - } - export interface SuperMembershipFormProperties { - - /** Xero unique identifier for Super membership */ - SuperMembershipID: FormControl, - - /** - * Xero identifier for super fund - * Required - */ - SuperFundID: FormControl, - - /** - * The memberhsip number assigned to the employee by the super fund. - * Required - * Type: double - */ - EmployeeNumber: FormControl, - } - export function CreateSuperMembershipFormGroup() { - return new FormGroup({ - SuperMembershipID: new FormControl(undefined), - SuperFundID: new FormControl(undefined, [Validators.required]), - EmployeeNumber: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum EmployeeStatus { ACTIVE = 0, TERMINATED = 1 } - - export interface ValidationError { - - /** Validation error message */ - Message?: string | null; - } - export interface ValidationErrorFormProperties { - - /** Validation error message */ - Message: FormControl, - } - export function CreateValidationErrorFormGroup() { - return new FormGroup({ - Message: new FormControl(undefined), - }); - - } - - export interface LeaveApplications { - LeaveApplications1?: Array; - } - export interface LeaveApplicationsFormProperties { - } - export function CreateLeaveApplicationsFormGroup() { - return new FormGroup({ - }); - - } - - export interface LeaveApplication { - - /** The Xero identifier for Payroll Employee */ - LeaveApplicationID?: string | null; - - /** The Xero identifier for Payroll Employee */ - EmployeeID?: string | null; - - /** The Xero identifier for Leave Type */ - LeaveTypeID?: string | null; - - /** The title of the leave */ - Title?: string | null; - - /** Start date of the leave (YYYY-MM-DD) */ - StartDate?: string | null; - - /** End date of the leave (YYYY-MM-DD) */ - EndDate?: string | null; - - /** The Description of the Leave */ - Description?: string | null; - LeavePeriods?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface LeaveApplicationFormProperties { - - /** The Xero identifier for Payroll Employee */ - LeaveApplicationID: FormControl, - - /** The Xero identifier for Payroll Employee */ - EmployeeID: FormControl, - - /** The Xero identifier for Leave Type */ - LeaveTypeID: FormControl, - - /** The title of the leave */ - Title: FormControl, - - /** Start date of the leave (YYYY-MM-DD) */ - StartDate: FormControl, - - /** End date of the leave (YYYY-MM-DD) */ - EndDate: FormControl, - - /** The Description of the Leave */ - Description: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreateLeaveApplicationFormGroup() { - return new FormGroup({ - LeaveApplicationID: new FormControl(undefined), - EmployeeID: new FormControl(undefined), - LeaveTypeID: new FormControl(undefined), - Title: new FormControl(undefined), - StartDate: new FormControl(undefined), - EndDate: new FormControl(undefined), - Description: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export interface LeavePeriod { - - /** - * The Number of Units for the leave - * Type: double - */ - NumberOfUnits?: number | null; - - /** The Pay Period End Date (YYYY-MM-DD) */ - PayPeriodEndDate?: string | null; - - /** The Pay Period Start Date (YYYY-MM-DD) */ - PayPeriodStartDate?: string | null; - LeavePeriodStatus?: LeavePeriodLeavePeriodStatus | null; - } - export interface LeavePeriodFormProperties { - - /** - * The Number of Units for the leave - * Type: double - */ - NumberOfUnits: FormControl, - - /** The Pay Period End Date (YYYY-MM-DD) */ - PayPeriodEndDate: FormControl, - - /** The Pay Period Start Date (YYYY-MM-DD) */ - PayPeriodStartDate: FormControl, - LeavePeriodStatus: FormControl, - } - export function CreateLeavePeriodFormGroup() { - return new FormGroup({ - NumberOfUnits: new FormControl(undefined), - PayPeriodEndDate: new FormControl(undefined), - PayPeriodStartDate: new FormControl(undefined), - LeavePeriodStatus: new FormControl(undefined), - }); - - } - - export enum LeavePeriodLeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } - - export enum LeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } - - export interface PayItems { - PayItems1?: PayItem; - } - export interface PayItemsFormProperties { - } - export function CreatePayItemsFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayItem { - EarningsRates?: Array; - DeductionTypes?: Array; - LeaveTypes?: Array; - ReimbursementTypes?: Array; - } - export interface PayItemFormProperties { - } - export function CreatePayItemFormGroup() { - return new FormGroup({ - }); - - } - - export interface EarningsRate { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** - * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - * Max length: 50 - */ - TypeOfUnits?: string | null; - - /** Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding */ - IsExemptFromTax?: boolean | null; - - /** See the ATO website for details of which payments are exempt from SGC */ - IsExemptFromSuper?: boolean | null; - - /** Boolean to determine if the earnings rate is reportable or exempt from W1 */ - IsReportableAsW1?: boolean | null; - EarningsType?: EarningsRateEarningsType | null; - - /** Xero identifier */ - EarningsRateID?: string | null; - RateType?: EarningsRateRateType | null; - - /** Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. */ - RatePerUnit?: string | null; - - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE - * Type: double - */ - Multiplier?: number | null; - - /** Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE */ - AccrueLeave?: boolean | null; - - /** - * Optional Amount for FIXEDAMOUNT RateType EarningsRate - * Type: double - */ - Amount?: number | null; - EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - AllowanceType?: EarningsRateAllowanceType | null; - } - export interface EarningsRateFormProperties { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name: FormControl, - - /** See Accounts */ - AccountCode: FormControl, - - /** - * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - * Max length: 50 - */ - TypeOfUnits: FormControl, - - /** Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding */ - IsExemptFromTax: FormControl, - - /** See the ATO website for details of which payments are exempt from SGC */ - IsExemptFromSuper: FormControl, - - /** Boolean to determine if the earnings rate is reportable or exempt from W1 */ - IsReportableAsW1: FormControl, - EarningsType: FormControl, - - /** Xero identifier */ - EarningsRateID: FormControl, - RateType: FormControl, - - /** Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. */ - RatePerUnit: FormControl, - - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE - * Type: double - */ - Multiplier: FormControl, - - /** Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE */ - AccrueLeave: FormControl, - - /** - * Optional Amount for FIXEDAMOUNT RateType EarningsRate - * Type: double - */ - Amount: FormControl, - EmploymentTerminationPaymentType: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - - /** Is the current record */ - CurrentRecord: FormControl, - AllowanceType: FormControl, - } - export function CreateEarningsRateFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined, [Validators.maxLength(100)]), - AccountCode: new FormControl(undefined), - TypeOfUnits: new FormControl(undefined, [Validators.maxLength(50)]), - IsExemptFromTax: new FormControl(undefined), - IsExemptFromSuper: new FormControl(undefined), - IsReportableAsW1: new FormControl(undefined), - EarningsType: new FormControl(undefined), - EarningsRateID: new FormControl(undefined), - RateType: new FormControl(undefined), - RatePerUnit: new FormControl(undefined), - Multiplier: new FormControl(undefined), - AccrueLeave: new FormControl(undefined), - Amount: new FormControl(undefined), - EmploymentTerminationPaymentType: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - CurrentRecord: new FormControl(undefined), - AllowanceType: new FormControl(undefined), - }); - - } - - export enum EarningsRateEarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } - - export enum EarningsRateRateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } - - export enum EarningsRateAllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } - - export interface DeductionType { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. */ - ReducesTax?: boolean | null; - - /** Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. */ - ReducesSuper?: boolean | null; - - /** Boolean to determine if the deduction type is reportable or exempt from W1 */ - IsExemptFromW1?: boolean | null; - - /** Xero identifier */ - DeductionTypeID?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - DeductionCategory?: DeductionTypeDeductionCategory | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - } - export interface DeductionTypeFormProperties { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name: FormControl, - - /** See Accounts */ - AccountCode: FormControl, - - /** Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. */ - ReducesTax: FormControl, - - /** Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. */ - ReducesSuper: FormControl, - - /** Boolean to determine if the deduction type is reportable or exempt from W1 */ - IsExemptFromW1: FormControl, - - /** Xero identifier */ - DeductionTypeID: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - DeductionCategory: FormControl, - - /** Is the current record */ - CurrentRecord: FormControl, - } - export function CreateDeductionTypeFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined, [Validators.maxLength(100)]), - AccountCode: new FormControl(undefined), - ReducesTax: new FormControl(undefined), - ReducesSuper: new FormControl(undefined), - IsExemptFromW1: new FormControl(undefined), - DeductionTypeID: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - DeductionCategory: new FormControl(undefined), - CurrentRecord: new FormControl(undefined), - }); - - } - - export enum DeductionTypeDeductionCategory { NONE = 0, UNIONFEES = 1, WORKPLACEGIVING = 2 } - - export interface LeaveType { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate */ - TypeOfUnits?: string | null; - - /** Xero identifier */ - LeaveTypeID?: string | null; - - /** - * The number of units the employee is entitled to each year - * Type: double - */ - NormalEntitlement?: number | null; - - /** - * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - LeaveLoadingRate?: number | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Set this to indicate that an employee will be paid when taking this type of leave */ - IsPaidLeave?: boolean | null; - - /** Set this if you want a balance for this leave type to be shown on your employee’s payslips */ - ShowOnPayslip?: boolean | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - } - export interface LeaveTypeFormProperties { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name: FormControl, - - /** The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate */ - TypeOfUnits: FormControl, - - /** Xero identifier */ - LeaveTypeID: FormControl, - - /** - * The number of units the employee is entitled to each year - * Type: double - */ - NormalEntitlement: FormControl, - - /** - * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - LeaveLoadingRate: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - - /** Set this to indicate that an employee will be paid when taking this type of leave */ - IsPaidLeave: FormControl, - - /** Set this if you want a balance for this leave type to be shown on your employee’s payslips */ - ShowOnPayslip: FormControl, - - /** Is the current record */ - CurrentRecord: FormControl, - } - export function CreateLeaveTypeFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined, [Validators.maxLength(100)]), - TypeOfUnits: new FormControl(undefined), - LeaveTypeID: new FormControl(undefined), - NormalEntitlement: new FormControl(undefined), - LeaveLoadingRate: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - IsPaidLeave: new FormControl(undefined), - ShowOnPayslip: new FormControl(undefined), - CurrentRecord: new FormControl(undefined), - }); - - } - - export interface ReimbursementType { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** Xero identifier */ - ReimbursementTypeID?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - } - export interface ReimbursementTypeFormProperties { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name: FormControl, - - /** See Accounts */ - AccountCode: FormControl, - - /** Xero identifier */ - ReimbursementTypeID: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - - /** Is the current record */ - CurrentRecord: FormControl, - } - export function CreateReimbursementTypeFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined, [Validators.maxLength(100)]), - AccountCode: new FormControl(undefined), - ReimbursementTypeID: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - CurrentRecord: new FormControl(undefined), - }); - - } - - export interface PayrollCalendars { - PayrollCalendars1?: Array; - } - export interface PayrollCalendarsFormProperties { - } - export function CreatePayrollCalendarsFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayrollCalendar { - - /** Name of the Payroll Calendar */ - Name?: string | null; - CalendarType?: PayrollCalendarCalendarType | null; - - /** The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) */ - StartDate?: string | null; - - /** The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) */ - PaymentDate?: string | null; - - /** Xero identifier */ - PayrollCalendarID?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface PayrollCalendarFormProperties { - - /** Name of the Payroll Calendar */ - Name: FormControl, - CalendarType: FormControl, - - /** The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) */ - StartDate: FormControl, - - /** The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) */ - PaymentDate: FormControl, - - /** Xero identifier */ - PayrollCalendarID: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreatePayrollCalendarFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined), - CalendarType: new FormControl(undefined), - StartDate: new FormControl(undefined), - PaymentDate: new FormControl(undefined), - PayrollCalendarID: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export enum PayrollCalendarCalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } - - export interface Timesheets { - Timesheets1?: Array; - } - export interface TimesheetsFormProperties { - } - export function CreateTimesheetsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Timesheet { - - /** - * The Xero identifier for an employee - * Required - */ - EmployeeID: string; - - /** - * Period start date (YYYY-MM-DD) - * Required - */ - StartDate: string; - - /** - * Period end date (YYYY-MM-DD) - * Required - */ - EndDate: string; - Status?: TimesheetStatus | null; - - /** - * Timesheet total hours - * Type: double - */ - Hours?: number | null; - - /** The Xero identifier for a Payroll Timesheet */ - TimesheetID?: string | null; - TimesheetLines?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface TimesheetFormProperties { - - /** - * The Xero identifier for an employee - * Required - */ - EmployeeID: FormControl, - - /** - * Period start date (YYYY-MM-DD) - * Required - */ - StartDate: FormControl, - - /** - * Period end date (YYYY-MM-DD) - * Required - */ - EndDate: FormControl, - Status: FormControl, - - /** - * Timesheet total hours - * Type: double - */ - Hours: FormControl, - - /** The Xero identifier for a Payroll Timesheet */ - TimesheetID: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreateTimesheetFormGroup() { - return new FormGroup({ - EmployeeID: new FormControl(undefined, [Validators.required]), - StartDate: new FormControl(undefined, [Validators.required]), - EndDate: new FormControl(undefined, [Validators.required]), - Status: new FormControl(undefined), - Hours: new FormControl(undefined), - TimesheetID: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export enum TimesheetStatus { DRAFT = 0, PROCESSED = 1, APPROVED = 2 } - - export interface TimesheetLine { - - /** The Xero identifier for an Earnings Rate */ - EarningsRateID?: string | null; - - /** The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. */ - TrackingItemID?: string | null; - - /** The number of units on a timesheet line */ - NumberOfUnits?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - export interface TimesheetLineFormProperties { - - /** The Xero identifier for an Earnings Rate */ - EarningsRateID: FormControl, - - /** The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. */ - TrackingItemID: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreateTimesheetLineFormGroup() { - return new FormGroup({ - EarningsRateID: new FormControl(undefined), - TrackingItemID: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export interface TimesheetObject { - Timesheet?: Timesheet; - } - export interface TimesheetObjectFormProperties { - } - export function CreateTimesheetObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayRuns { - PayRuns1?: Array; - } - export interface PayRunsFormProperties { - } - export function CreatePayRunsFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayRun { - - /** - * Xero identifier for pay run - * Required - */ - PayrollCalendarID: string; - - /** Xero identifier for pay run */ - PayRunID?: string | null; - - /** Period Start Date for the PayRun (YYYY-MM-DD) */ - PayRunPeriodStartDate?: string | null; - - /** Period End Date for the PayRun (YYYY-MM-DD) */ - PayRunPeriodEndDate?: string | null; - PayRunStatus?: PayRunPayRunStatus | null; - - /** Payment Date for the PayRun (YYYY-MM-DD) */ - PaymentDate?: string | null; - - /** Payslip message for the PayRun */ - PayslipMessage?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** The payslips in the payrun */ - Payslips?: Array; - - /** - * The total Wages for the Payrun - * Type: double - */ - Wages?: number | null; - - /** - * The total Deductions for the Payrun - * Type: double - */ - Deductions?: number | null; - - /** - * The total Tax for the Payrun - * Type: double - */ - Tax?: number | null; - - /** - * The total Super for the Payrun - * Type: double - */ - Super?: number | null; - - /** - * The total Reimbursements for the Payrun - * Type: double - */ - Reimbursement?: number | null; - - /** - * The total NetPay for the Payrun - * Type: double - */ - NetPay?: number | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface PayRunFormProperties { - - /** - * Xero identifier for pay run - * Required - */ - PayrollCalendarID: FormControl, - - /** Xero identifier for pay run */ - PayRunID: FormControl, - - /** Period Start Date for the PayRun (YYYY-MM-DD) */ - PayRunPeriodStartDate: FormControl, - - /** Period End Date for the PayRun (YYYY-MM-DD) */ - PayRunPeriodEndDate: FormControl, - PayRunStatus: FormControl, - - /** Payment Date for the PayRun (YYYY-MM-DD) */ - PaymentDate: FormControl, - - /** Payslip message for the PayRun */ - PayslipMessage: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - - /** - * The total Wages for the Payrun - * Type: double - */ - Wages: FormControl, - - /** - * The total Deductions for the Payrun - * Type: double - */ - Deductions: FormControl, - - /** - * The total Tax for the Payrun - * Type: double - */ - Tax: FormControl, - - /** - * The total Super for the Payrun - * Type: double - */ - Super: FormControl, - - /** - * The total Reimbursements for the Payrun - * Type: double - */ - Reimbursement: FormControl, - - /** - * The total NetPay for the Payrun - * Type: double - */ - NetPay: FormControl, - } - export function CreatePayRunFormGroup() { - return new FormGroup({ - PayrollCalendarID: new FormControl(undefined, [Validators.required]), - PayRunID: new FormControl(undefined), - PayRunPeriodStartDate: new FormControl(undefined), - PayRunPeriodEndDate: new FormControl(undefined), - PayRunStatus: new FormControl(undefined), - PaymentDate: new FormControl(undefined), - PayslipMessage: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - Wages: new FormControl(undefined), - Deductions: new FormControl(undefined), - Tax: new FormControl(undefined), - Super: new FormControl(undefined), - Reimbursement: new FormControl(undefined), - NetPay: new FormControl(undefined), - }); - - } - - export enum PayRunPayRunStatus { DRAFT = 0, POSTED = 1 } - - export interface PayslipSummary { - - /** The Xero identifier for an employee */ - EmployeeID?: string | null; - - /** Xero identifier for the payslip */ - PayslipID?: string | null; - - /** First name of employee */ - FirstName?: string | null; - - /** Last name of employee */ - LastName?: string | null; - - /** Employee group name */ - EmployeeGroup?: string | null; - - /** - * The Wages for the Payslip - * Type: double - */ - Wages?: number | null; - - /** - * The Deductions for the Payslip - * Type: double - */ - Deductions?: number | null; - - /** - * The Tax for the Payslip - * Type: double - */ - Tax?: number | null; - - /** - * The Super for the Payslip - * Type: double - */ - Super?: number | null; - - /** - * The Reimbursements for the Payslip - * Type: double - */ - Reimbursements?: number | null; - - /** - * The NetPay for the Payslip - * Type: double - */ - NetPay?: number | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - export interface PayslipSummaryFormProperties { - - /** The Xero identifier for an employee */ - EmployeeID: FormControl, - - /** Xero identifier for the payslip */ - PayslipID: FormControl, - - /** First name of employee */ - FirstName: FormControl, - - /** Last name of employee */ - LastName: FormControl, - - /** Employee group name */ - EmployeeGroup: FormControl, - - /** - * The Wages for the Payslip - * Type: double - */ - Wages: FormControl, - - /** - * The Deductions for the Payslip - * Type: double - */ - Deductions: FormControl, - - /** - * The Tax for the Payslip - * Type: double - */ - Tax: FormControl, - - /** - * The Super for the Payslip - * Type: double - */ - Super: FormControl, - - /** - * The Reimbursements for the Payslip - * Type: double - */ - Reimbursements: FormControl, - - /** - * The NetPay for the Payslip - * Type: double - */ - NetPay: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreatePayslipSummaryFormGroup() { - return new FormGroup({ - EmployeeID: new FormControl(undefined), - PayslipID: new FormControl(undefined), - FirstName: new FormControl(undefined), - LastName: new FormControl(undefined), - EmployeeGroup: new FormControl(undefined), - Wages: new FormControl(undefined), - Deductions: new FormControl(undefined), - Tax: new FormControl(undefined), - Super: new FormControl(undefined), - Reimbursements: new FormControl(undefined), - NetPay: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export interface PayslipLines { - EarningsLines?: Array; - LeaveEarningsLines?: Array; - TimesheetEarningsLines?: Array; - DeductionLines?: Array; - LeaveAccrualLines?: Array; - ReimbursementLines?: Array; - SuperannuationLines?: Array; - TaxLines?: Array; - } - export interface PayslipLinesFormProperties { - } - export function CreatePayslipLinesFormGroup() { - return new FormGroup({ - }); - - } - - export interface LeaveEarningsLine { - - /** Xero identifier */ - EarningsRateID?: string | null; - - /** - * Rate per unit of the EarningsLine. - * Type: double - */ - RatePerUnit?: number | null; - - /** - * Earnings rate number of units. - * Type: double - */ - NumberOfUnits?: number | null; - } - export interface LeaveEarningsLineFormProperties { - - /** Xero identifier */ - EarningsRateID: FormControl, - - /** - * Rate per unit of the EarningsLine. - * Type: double - */ - RatePerUnit: FormControl, - - /** - * Earnings rate number of units. - * Type: double - */ - NumberOfUnits: FormControl, - } - export function CreateLeaveEarningsLineFormGroup() { - return new FormGroup({ - EarningsRateID: new FormControl(undefined), - RatePerUnit: new FormControl(undefined), - NumberOfUnits: new FormControl(undefined), - }); - - } - - export interface LeaveAccrualLine { - - /** Xero identifier for the Leave type. */ - LeaveTypeID?: string | null; - - /** - * Leave Accrual number of units - * Type: double - */ - NumberOfUnits?: number | null; - - /** If you want to auto calculate leave. */ - AutoCalculate?: boolean | null; - } - export interface LeaveAccrualLineFormProperties { - - /** Xero identifier for the Leave type. */ - LeaveTypeID: FormControl, - - /** - * Leave Accrual number of units - * Type: double - */ - NumberOfUnits: FormControl, - - /** If you want to auto calculate leave. */ - AutoCalculate: FormControl, - } - export function CreateLeaveAccrualLineFormGroup() { - return new FormGroup({ - LeaveTypeID: new FormControl(undefined), - NumberOfUnits: new FormControl(undefined), - AutoCalculate: new FormControl(undefined), - }); - - } - - export interface SuperannuationLine { - - /** Xero identifier for payroll super fund membership ID. */ - SuperMembershipID?: string | null; - ContributionType?: SuperLineContributionType | null; - CalculationType?: SuperLineCalculationType | null; - - /** - * Superannuation minimum monthly earnings. - * Type: double - */ - MinimumMonthlyEarnings?: number | null; - - /** Superannuation expense account code. */ - ExpenseAccountCode?: string | null; - - /** Superannuation liability account code */ - LiabilityAccountCode?: string | null; - - /** Superannuation payment date for the current period (YYYY-MM-DD) */ - PaymentDateForThisPeriod?: string | null; - - /** - * Superannuation percentage - * Type: double - */ - Percentage?: number | null; - - /** - * Superannuation amount - * Type: double - */ - Amount?: number | null; - } - export interface SuperannuationLineFormProperties { - - /** Xero identifier for payroll super fund membership ID. */ - SuperMembershipID: FormControl, - ContributionType: FormControl, - CalculationType: FormControl, - - /** - * Superannuation minimum monthly earnings. - * Type: double - */ - MinimumMonthlyEarnings: FormControl, - - /** Superannuation expense account code. */ - ExpenseAccountCode: FormControl, - - /** Superannuation liability account code */ - LiabilityAccountCode: FormControl, - - /** Superannuation payment date for the current period (YYYY-MM-DD) */ - PaymentDateForThisPeriod: FormControl, - - /** - * Superannuation percentage - * Type: double - */ - Percentage: FormControl, - - /** - * Superannuation amount - * Type: double - */ - Amount: FormControl, - } - export function CreateSuperannuationLineFormGroup() { - return new FormGroup({ - SuperMembershipID: new FormControl(undefined), - ContributionType: new FormControl(undefined), - CalculationType: new FormControl(undefined), - MinimumMonthlyEarnings: new FormControl(undefined), - ExpenseAccountCode: new FormControl(undefined), - LiabilityAccountCode: new FormControl(undefined), - PaymentDateForThisPeriod: new FormControl(undefined), - Percentage: new FormControl(undefined), - Amount: new FormControl(undefined), - }); - - } - - export interface TaxLine { - - /** Xero identifier for payslip tax line ID. */ - PayslipTaxLineID?: string | null; - - /** - * The tax line amount - * Type: double - */ - Amount?: number | null; - - /** Name of the tax type. */ - TaxTypeName?: string | null; - - /** Description of the tax line. */ - Description?: string | null; - ManualTaxType?: TaxLineManualTaxType | null; - - /** The tax line liability account code. For posted pay run you should be able to see liability account code */ - LiabilityAccount?: string | null; - } - export interface TaxLineFormProperties { - - /** Xero identifier for payslip tax line ID. */ - PayslipTaxLineID: FormControl, - - /** - * The tax line amount - * Type: double - */ - Amount: FormControl, - - /** Name of the tax type. */ - TaxTypeName: FormControl, - - /** Description of the tax line. */ - Description: FormControl, - ManualTaxType: FormControl, - - /** The tax line liability account code. For posted pay run you should be able to see liability account code */ - LiabilityAccount: FormControl, - } - export function CreateTaxLineFormGroup() { - return new FormGroup({ - PayslipTaxLineID: new FormControl(undefined), - Amount: new FormControl(undefined), - TaxTypeName: new FormControl(undefined), - Description: new FormControl(undefined), - ManualTaxType: new FormControl(undefined), - LiabilityAccount: new FormControl(undefined), - }); - - } - - export enum TaxLineManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } - - export interface PayslipObject { - Payslip?: Payslip; - } - export interface PayslipObjectFormProperties { - } - export function CreatePayslipObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Payslip { - - /** The Xero identifier for an employee */ - EmployeeID?: string | null; - - /** Xero identifier for the payslip */ - PayslipID?: string | null; - - /** First name of employee */ - FirstName?: string | null; - - /** Last name of employee */ - LastName?: string | null; - - /** - * The Wages for the Payslip - * Type: double - */ - Wages?: number | null; - - /** - * The Deductions for the Payslip - * Type: double - */ - Deductions?: number | null; - - /** - * The Tax for the Payslip - * Type: double - */ - Tax?: number | null; - - /** - * The Super for the Payslip - * Type: double - */ - Super?: number | null; - - /** - * The Reimbursements for the Payslip - * Type: double - */ - Reimbursements?: number | null; - - /** - * The NetPay for the Payslip - * Type: double - */ - NetPay?: number | null; - EarningsLines?: Array; - LeaveEarningsLines?: Array; - TimesheetEarningsLines?: Array; - DeductionLines?: Array; - LeaveAccrualLines?: Array; - ReimbursementLines?: Array; - SuperannuationLines?: Array; - TaxLines?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - export interface PayslipFormProperties { - - /** The Xero identifier for an employee */ - EmployeeID: FormControl, - - /** Xero identifier for the payslip */ - PayslipID: FormControl, - - /** First name of employee */ - FirstName: FormControl, - - /** Last name of employee */ - LastName: FormControl, - - /** - * The Wages for the Payslip - * Type: double - */ - Wages: FormControl, - - /** - * The Deductions for the Payslip - * Type: double - */ - Deductions: FormControl, - - /** - * The Tax for the Payslip - * Type: double - */ - Tax: FormControl, - - /** - * The Super for the Payslip - * Type: double - */ - Super: FormControl, - - /** - * The Reimbursements for the Payslip - * Type: double - */ - Reimbursements: FormControl, - - /** - * The NetPay for the Payslip - * Type: double - */ - NetPay: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreatePayslipFormGroup() { - return new FormGroup({ - EmployeeID: new FormControl(undefined), - PayslipID: new FormControl(undefined), - FirstName: new FormControl(undefined), - LastName: new FormControl(undefined), - Wages: new FormControl(undefined), - Deductions: new FormControl(undefined), - Tax: new FormControl(undefined), - Super: new FormControl(undefined), - Reimbursements: new FormControl(undefined), - NetPay: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export interface Payslips { - Payslips1?: Array; - } - export interface PayslipsFormProperties { - } - export function CreatePayslipsFormGroup() { - return new FormGroup({ - }); - - } - - export interface SettingsObject { - Settings?: Settings; - } - export interface SettingsObjectFormProperties { - } - export function CreateSettingsObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Settings { - - /** Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. */ - Accounts?: Array; - - /** Tracking categories for Employees and Timesheets */ - TrackingCategories?: SettingsTrackingCategories; - - /** - * Number of days in the Payroll year - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - DaysInPayrollYear?: number | null; - } - export interface SettingsFormProperties { - - /** - * Number of days in the Payroll year - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - DaysInPayrollYear: FormControl, - } - export function CreateSettingsFormGroup() { - return new FormGroup({ - DaysInPayrollYear: new FormControl(undefined), - }); - - } - - export interface Account { - - /** Xero identifier for accounts */ - AccountID?: string | null; - - /** See Account Types */ - Type?: AccountType | null; - - /** Customer defined account code */ - Code?: string | null; - - /** Name of account */ - Name?: string | null; - } - export interface AccountFormProperties { - - /** Xero identifier for accounts */ - AccountID: FormControl, - - /** See Account Types */ - Type: FormControl, - - /** Customer defined account code */ - Code: FormControl, - - /** Name of account */ - Name: FormControl, - } - export function CreateAccountFormGroup() { - return new FormGroup({ - AccountID: new FormControl(undefined), - Type: new FormControl(undefined), - Code: new FormControl(undefined), - Name: new FormControl(undefined), - }); - - } - - export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21, WAGESPAYABLELIABILITY = 22 } - - export interface SettingsTrackingCategories { - - /** The tracking category used for employees */ - EmployeeGroups?: SettingsTrackingCategoriesEmployeeGroups; - - /** The tracking category used for timesheets */ - TimesheetCategories?: SettingsTrackingCategoriesTimesheetCategories; - } - export interface SettingsTrackingCategoriesFormProperties { - } - export function CreateSettingsTrackingCategoriesFormGroup() { - return new FormGroup({ - }); - - } - - export interface SettingsTrackingCategoriesEmployeeGroups { - - /** The identifier for the tracking category */ - TrackingCategoryID?: string | null; - - /** Name of the tracking category */ - TrackingCategoryName?: string | null; - } - export interface SettingsTrackingCategoriesEmployeeGroupsFormProperties { - - /** The identifier for the tracking category */ - TrackingCategoryID: FormControl, - - /** Name of the tracking category */ - TrackingCategoryName: FormControl, - } - export function CreateSettingsTrackingCategoriesEmployeeGroupsFormGroup() { - return new FormGroup({ - TrackingCategoryID: new FormControl(undefined), - TrackingCategoryName: new FormControl(undefined), - }); - - } - - export interface SettingsTrackingCategoriesTimesheetCategories { - - /** The identifier for the tracking category */ - TrackingCategoryID?: string | null; - - /** Name of the tracking category */ - TrackingCategoryName?: string | null; - } - export interface SettingsTrackingCategoriesTimesheetCategoriesFormProperties { - - /** The identifier for the tracking category */ - TrackingCategoryID: FormControl, - - /** Name of the tracking category */ - TrackingCategoryName: FormControl, - } - export function CreateSettingsTrackingCategoriesTimesheetCategoriesFormGroup() { - return new FormGroup({ - TrackingCategoryID: new FormControl(undefined), - TrackingCategoryName: new FormControl(undefined), - }); - - } - - export interface SuperFunds { - SuperFunds1?: Array; - } - export interface SuperFundsFormProperties { - } - export function CreateSuperFundsFormGroup() { - return new FormGroup({ - }); - - } - - export interface SuperFund { - - /** Xero identifier for a super fund */ - SuperFundID?: string | null; - - /** Required */ - Type: SuperFundType; - - /** Name of the super fund */ - Name?: string | null; - - /** ABN of the self managed super fund */ - ABN?: string | null; - - /** BSB of the self managed super fund */ - BSB?: string | null; - - /** The account number for the self managed super fund. */ - AccountNumber?: string | null; - - /** The account name for the self managed super fund. */ - AccountName?: string | null; - - /** The electronic service address for the self managed super fund. */ - ElectronicServiceAddress?: string | null; - - /** Some funds assign a unique number to each employer */ - EmployerNumber?: string | null; - - /** The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. */ - SPIN?: string | null; - - /** The USI of the Regulated SuperFund */ - USI?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface SuperFundFormProperties { - - /** Xero identifier for a super fund */ - SuperFundID: FormControl, - - /** Required */ - Type: FormControl, - - /** Name of the super fund */ - Name: FormControl, - - /** ABN of the self managed super fund */ - ABN: FormControl, - - /** BSB of the self managed super fund */ - BSB: FormControl, - - /** The account number for the self managed super fund. */ - AccountNumber: FormControl, - - /** The account name for the self managed super fund. */ - AccountName: FormControl, - - /** The electronic service address for the self managed super fund. */ - ElectronicServiceAddress: FormControl, - - /** Some funds assign a unique number to each employer */ - EmployerNumber: FormControl, - - /** The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. */ - SPIN: FormControl, - - /** The USI of the Regulated SuperFund */ - USI: FormControl, - - /** Last modified timestamp */ - UpdatedDateUTC: FormControl, - } - export function CreateSuperFundFormGroup() { - return new FormGroup({ - SuperFundID: new FormControl(undefined), - Type: new FormControl(undefined, [Validators.required]), - Name: new FormControl(undefined), - ABN: new FormControl(undefined), - BSB: new FormControl(undefined), - AccountNumber: new FormControl(undefined), - AccountName: new FormControl(undefined), - ElectronicServiceAddress: new FormControl(undefined), - EmployerNumber: new FormControl(undefined), - SPIN: new FormControl(undefined), - USI: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export enum SuperFundType { REGULATED = 0, SMSF = 1 } - - export interface SuperFundProducts { - SuperFundProducts1?: Array; - } - export interface SuperFundProductsFormProperties { - } - export function CreateSuperFundProductsFormGroup() { - return new FormGroup({ - }); - - } - - export interface SuperFundProduct { - - /** The ABN of the Regulated SuperFund */ - ABN?: string | null; - - /** The USI of the Regulated SuperFund */ - USI?: string | null; - - /** The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN */ - SPIN?: string | null; - - /** The name of the Regulated SuperFund */ - ProductName?: string | null; - } - export interface SuperFundProductFormProperties { - - /** The ABN of the Regulated SuperFund */ - ABN: FormControl, - - /** The USI of the Regulated SuperFund */ - USI: FormControl, - - /** The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN */ - SPIN: FormControl, - - /** The name of the Regulated SuperFund */ - ProductName: FormControl, - } - export function CreateSuperFundProductFormGroup() { - return new FormGroup({ - ABN: new FormControl(undefined), - USI: new FormControl(undefined), - SPIN: new FormControl(undefined), - ProductName: new FormControl(undefined), - }); - - } - - - /** The reimbursement type lines */ - export interface ReimbursementLines { - ReimbursementLines1?: Array; - } - - /** The reimbursement type lines */ - export interface ReimbursementLinesFormProperties { - } - export function CreateReimbursementLinesFormGroup() { - return new FormGroup({ - }); - - } - - - /** The leave type lines */ - export interface LeaveLines { - Employee?: Array; - } - - /** The leave type lines */ - export interface LeaveLinesFormProperties { - } - export function CreateLeaveLinesFormGroup() { - return new FormGroup({ - }); - - } - - export enum RateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } - - export enum EarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } - - export enum EmploymentTerminationPaymentType { O = 0, R = 1 } - - export enum AllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } - - export enum CalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } - - export enum EarningsRateCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } - - export enum DeductionTypeCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } - - export enum SuperannuationContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } - - export enum SuperannuationCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } - - export enum PaymentFrequencyType { WEEKLY = 0, MONTHLY = 1, FORTNIGHTLY = 2, QUARTERLY = 3, TWICEMONTHLY = 4, FOURWEEKLY = 5, YEARLY = 6 } - - export enum LeaveTypeContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } - - export enum EntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } - - export enum PayRunStatus { DRAFT = 0, POSTED = 1 } - - export enum ManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } - - export enum EmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } - - export enum TFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } - - export enum ResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } - - - /** State abbreviation for employee home address */ - export enum State { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } - - - /** The object returned for a bad request */ - export interface APIException { - - /** The error number */ - ErrorNumber?: string | null; - - /** The type of error */ - Type?: string | null; - - /** The message describing the error */ - Message?: string | null; - } - - /** The object returned for a bad request */ - export interface APIExceptionFormProperties { - - /** The error number */ - ErrorNumber: FormControl, - - /** The type of error */ - Type: FormControl, - - /** The message describing the error */ - Message: FormControl, - } - export function CreateAPIExceptionFormGroup() { - return new FormGroup({ - ErrorNumber: new FormControl(undefined), - Type: new FormControl(undefined), - Message: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches employees - * Get Employees - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 employees will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Employees} search results matching criteria - */ - GetEmployees(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a payroll employee - * Post Employees - * @return {Employees} A successful request - */ - CreateEmployee(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an employee by unique id - * Get Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {Employees} search results matching criteria - */ - GetEmployee(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); - } - - /** - * Update an Employee - * Update properties on a single employee - * Post Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {Employees} A successful request - */ - UpdateEmployee(EmployeeId: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Leave Applications - * Get LeaveApplications - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {LeaveApplications} search results matching criteria - */ - GetLeaveApplications(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'LeaveApplications?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a Leave Application - * Post LeaveApplications - * @return {LeaveApplications} A successful request - */ - CreateLeaveApplication(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'LeaveApplications', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an Leave Application by unique id - * Get LeaveApplications/{LeaveApplicationId} - * @param {string} LeaveApplicationId Leave Application id for single object - * @return {LeaveApplications} search results matching criteria - */ - GetLeaveApplication(LeaveApplicationId: string): Observable { - return this.http.get(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), {}); - } - - /** - * Use this method to update a Leave Application - * Post LeaveApplications/{LeaveApplicationId} - * @param {string} LeaveApplicationId Leave Application id for single object - * @return {LeaveApplications} A successful request - */ - UpdateLeaveApplication(LeaveApplicationId: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Pay Items - * Get PayItems - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayItems} search results matching criteria - */ - GetPayItems(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayItems?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a Pay Item - * Post PayItems - * @return {PayItems} A successful request - currently returns empty array for JSON - */ - CreatePayItem(requestBody: PayItem): Observable { - return this.http.post(this.baseUri + 'PayItems', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Payroll Calendars - * Get PayrollCalendars - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayrollCalendars} search results matching criteria - */ - GetPayrollCalendars(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayrollCalendars?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a Payroll Calendars - * Post PayrollCalendars - * @return {PayrollCalendars} A successful request - */ - CreatePayrollCalendar(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'PayrollCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Payroll Calendars - * Get PayrollCalendars/{PayrollCalendarID} - * @param {string} PayrollCalendarID Payroll Calendar id for single object - * @return {PayrollCalendars} search results matching criteria - */ - GetPayrollCalendar(PayrollCalendarID: string): Observable { - return this.http.get(this.baseUri + 'PayrollCalendars/' + (PayrollCalendarID == null ? '' : encodeURIComponent(PayrollCalendarID)), {}); - } - - /** - * searches PayRuns - * Get PayRuns - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayRuns} search results matching criteria - */ - GetPayRuns(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayRuns?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a PayRun - * Post PayRuns - * @return {PayRuns} A successful request - */ - CreatePayRun(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'PayRuns', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an payrun by unique id - * Get PayRuns/{PayRunID} - * @param {string} PayRunID PayRun id for single object - * @return {PayRuns} search results matching criteria - */ - GetPayRun(PayRunID: string): Observable { - return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); - } - - /** - * Update a PayRun - * Update properties on a single PayRun - * Post PayRuns/{PayRunID} - * @param {string} PayRunID PayRun id for single object - * @return {PayRuns} A successful request - */ - UpdatePayRun(PayRunID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an payslip by unique id - * Get Payslip/{PayslipID} - * @param {string} PayslipID Payslip id for single object - * @return {PayslipObject} search results matching criteria - */ - GetPayslip(PayslipID: string): Observable { - return this.http.get(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); - } - - /** - * Update a Payslip - * Update lines on a single payslips - * Post Payslip/{PayslipID} - * @param {string} PayslipID Payslip id for single object - * @return {Payslips} A successful request - currently returns empty array for JSON - */ - UpdatePayslip(PayslipID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve settings - * Get Settings - * @return {SettingsObject} payroll settings - */ - GetSettings(): Observable { - return this.http.get(this.baseUri + 'Settings', {}); - } - - /** - * searches SuperFunds - * Get Superfunds - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {SuperFunds} search results matching criteria - */ - GetSuperfunds(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Superfunds?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a super fund - * Post Superfunds - * @return {SuperFunds} A successful request - */ - CreateSuperfund(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Superfunds', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an Superfund by unique id - * Get Superfunds/{SuperFundID} - * @param {string} SuperFundID Superfund id for single object - * @return {SuperFunds} search results matching criteria - */ - GetSuperfund(SuperFundID: string): Observable { - return this.http.get(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), {}); - } - - /** - * Update a Superfund - * Update properties on a single Superfund - * Post Superfunds/{SuperFundID} - * @param {string} SuperFundID Superfund id for single object - * @return {SuperFunds} A successful request - */ - UpdateSuperfund(SuperFundID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches SuperfundProducts - * Get SuperfundProducts - * @param {string} ABN The ABN of the Regulated SuperFund - * @param {string} USI The USI of the Regulated SuperFund - * @return {SuperFundProducts} search results matching criteria - */ - GetSuperfundProducts(ABN: string | null | undefined, USI: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'SuperfundProducts?ABN=' + (ABN == null ? '' : encodeURIComponent(ABN)) + '&USI=' + (USI == null ? '' : encodeURIComponent(USI)), {}); - } - - /** - * searches timesheets - * Get Timesheets - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 timesheets will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Timesheets} search results matching criteria - */ - GetTimesheets(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Timesheets?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a timesheet - * Post Timesheets - * @return {Timesheets} A successful request - */ - CreateTimesheet(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an timesheet by unique id - * Get Timesheets/{TimesheetID} - * @param {string} TimesheetID Timesheet id for single object - * @return {TimesheetObject} search results matching criteria - */ - GetTimesheet(TimesheetID: string): Observable { - return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); - } - - /** - * Update a Timesheet - * Update properties on a single timesheet - * Post Timesheets/{TimesheetID} - * @param {string} TimesheetID Timesheet id for single object - * @return {Timesheets} A successful request - */ - UpdateTimesheet(TimesheetID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Employees { + Employees1?: Array; + } + export interface EmployeesFormProperties { + } + export function CreateEmployeesFormGroup() { + return new FormGroup({ + }); + + } + + export interface Employee { + + /** + * First name of employee + * Required + */ + FirstName: string; + + /** + * Last name of employee + * Required + */ + LastName: string; + + /** + * Date of birth of the employee (YYYY-MM-DD) + * Required + */ + DateOfBirth: string; + HomeAddress?: HomeAddress; + + /** Start date for an employee (YYYY-MM-DD) */ + StartDate?: string | null; + + /** Title of the employee */ + Title?: string | null; + + /** Middle name(s) of the employee */ + MiddleNames?: string | null; + + /** The email address for the employee */ + Email?: string | null; + + /** The employee’s gender. See Employee Gender */ + Gender?: EmployeeGender | null; + + /** Employee phone number */ + Phone?: string | null; + + /** Employee mobile number */ + Mobile?: string | null; + + /** Employee’s twitter name */ + TwitterUserName?: string | null; + + /** Authorised to approve other employees' leave requests */ + IsAuthorisedToApproveLeave?: boolean | null; + + /** Authorised to approve timesheets */ + IsAuthorisedToApproveTimesheets?: boolean | null; + + /** JobTitle of the employee */ + JobTitle?: string | null; + + /** Employees classification */ + Classification?: string | null; + + /** Xero unique identifier for earnings rate */ + OrdinaryEarningsRateID?: string | null; + + /** Xero unique identifier for payroll calendar for the employee */ + PayrollCalendarID?: string | null; + + /** The Employee Group allows you to report on payroll expenses and liabilities for each group of employees */ + EmployeeGroupName?: string | null; + + /** Xero unique identifier for an Employee */ + EmployeeID?: string | null; + + /** Employee Termination Date (YYYY-MM-DD) */ + TerminationDate?: string | null; + BankAccounts?: Array; + PayTemplate?: PayTemplate; + OpeningBalances?: OpeningBalances; + TaxDeclaration?: TaxDeclaration; + LeaveBalances?: Array; + LeaveLines?: Array; + SuperMemberships?: Array; + + /** Employee Status Types */ + Status?: EmployeeStatus | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface EmployeeFormProperties { + + /** + * First name of employee + * Required + */ + FirstName: FormControl, + + /** + * Last name of employee + * Required + */ + LastName: FormControl, + + /** + * Date of birth of the employee (YYYY-MM-DD) + * Required + */ + DateOfBirth: FormControl, + + /** Start date for an employee (YYYY-MM-DD) */ + StartDate: FormControl, + + /** Title of the employee */ + Title: FormControl, + + /** Middle name(s) of the employee */ + MiddleNames: FormControl, + + /** The email address for the employee */ + Email: FormControl, + + /** The employee’s gender. See Employee Gender */ + Gender: FormControl, + + /** Employee phone number */ + Phone: FormControl, + + /** Employee mobile number */ + Mobile: FormControl, + + /** Employee’s twitter name */ + TwitterUserName: FormControl, + + /** Authorised to approve other employees' leave requests */ + IsAuthorisedToApproveLeave: FormControl, + + /** Authorised to approve timesheets */ + IsAuthorisedToApproveTimesheets: FormControl, + + /** JobTitle of the employee */ + JobTitle: FormControl, + + /** Employees classification */ + Classification: FormControl, + + /** Xero unique identifier for earnings rate */ + OrdinaryEarningsRateID: FormControl, + + /** Xero unique identifier for payroll calendar for the employee */ + PayrollCalendarID: FormControl, + + /** The Employee Group allows you to report on payroll expenses and liabilities for each group of employees */ + EmployeeGroupName: FormControl, + + /** Xero unique identifier for an Employee */ + EmployeeID: FormControl, + + /** Employee Termination Date (YYYY-MM-DD) */ + TerminationDate: FormControl, + + /** Employee Status Types */ + Status: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreateEmployeeFormGroup() { + return new FormGroup({ + FirstName: new FormControl(undefined, [Validators.required]), + LastName: new FormControl(undefined, [Validators.required]), + DateOfBirth: new FormControl(undefined, [Validators.required]), + StartDate: new FormControl(undefined), + Title: new FormControl(undefined), + MiddleNames: new FormControl(undefined), + Email: new FormControl(undefined), + Gender: new FormControl(undefined), + Phone: new FormControl(undefined), + Mobile: new FormControl(undefined), + TwitterUserName: new FormControl(undefined), + IsAuthorisedToApproveLeave: new FormControl(undefined), + IsAuthorisedToApproveTimesheets: new FormControl(undefined), + JobTitle: new FormControl(undefined), + Classification: new FormControl(undefined), + OrdinaryEarningsRateID: new FormControl(undefined), + PayrollCalendarID: new FormControl(undefined), + EmployeeGroupName: new FormControl(undefined), + EmployeeID: new FormControl(undefined), + TerminationDate: new FormControl(undefined), + Status: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export interface HomeAddress { + + /** + * Address line 1 for employee home address + * Required + */ + AddressLine1: string; + + /** Address line 2 for employee home address */ + AddressLine2?: string | null; + + /** Suburb for employee home address */ + City?: string | null; + + /** State abbreviation for employee home address */ + Region?: HomeAddressRegion | null; + + /** PostCode for employee home address */ + PostalCode?: string | null; + + /** Country of HomeAddress */ + Country?: string | null; + } + export interface HomeAddressFormProperties { + + /** + * Address line 1 for employee home address + * Required + */ + AddressLine1: FormControl, + + /** Address line 2 for employee home address */ + AddressLine2: FormControl, + + /** Suburb for employee home address */ + City: FormControl, + + /** State abbreviation for employee home address */ + Region: FormControl, + + /** PostCode for employee home address */ + PostalCode: FormControl, + + /** Country of HomeAddress */ + Country: FormControl, + } + export function CreateHomeAddressFormGroup() { + return new FormGroup({ + AddressLine1: new FormControl(undefined, [Validators.required]), + AddressLine2: new FormControl(undefined), + City: new FormControl(undefined), + Region: new FormControl(undefined), + PostalCode: new FormControl(undefined), + Country: new FormControl(undefined), + }); + + } + + export enum HomeAddressRegion { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } + + export enum EmployeeGender { N = 0, M = 1, F = 2, I = 3 } + + export interface BankAccount { + + /** The text that will appear on your employee's bank statement when they receive payment */ + StatementText?: string | null; + + /** The name of the account */ + AccountName?: string | null; + + /** The BSB number of the account */ + BSB?: string | null; + + /** The account number */ + AccountNumber?: string | null; + + /** If this account is the Remaining bank account */ + Remainder?: boolean | null; + + /** + * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) + * Type: double + */ + Amount?: number | null; + } + export interface BankAccountFormProperties { + + /** The text that will appear on your employee's bank statement when they receive payment */ + StatementText: FormControl, + + /** The name of the account */ + AccountName: FormControl, + + /** The BSB number of the account */ + BSB: FormControl, + + /** The account number */ + AccountNumber: FormControl, + + /** If this account is the Remaining bank account */ + Remainder: FormControl, + + /** + * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) + * Type: double + */ + Amount: FormControl, + } + export function CreateBankAccountFormGroup() { + return new FormGroup({ + StatementText: new FormControl(undefined), + AccountName: new FormControl(undefined), + BSB: new FormControl(undefined), + AccountNumber: new FormControl(undefined), + Remainder: new FormControl(undefined), + Amount: new FormControl(undefined), + }); + + } + + export interface PayTemplate { + EarningsLines?: Array; + DeductionLines?: Array; + SuperLines?: Array; + ReimbursementLines?: Array; + LeaveLines?: Array; + } + export interface PayTemplateFormProperties { + } + export function CreatePayTemplateFormGroup() { + return new FormGroup({ + }); + + } + + export interface EarningsLine { + + /** + * Xero unique id for earnings rate + * Required + */ + EarningsRateID: string; + + /** Required */ + CalculationType: EarningsLineCalculationType; + + /** + * Annual salary for earnings line + * Type: double + */ + AnnualSalary?: number | null; + + /** + * number of units for earning line + * Type: double + */ + NumberOfUnitsPerWeek?: number | null; + + /** + * Rate per unit of the EarningsLine. + * Type: double + */ + RatePerUnit?: number | null; + + /** + * Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" + * Type: double + */ + NormalNumberOfUnits?: number | null; + + /** + * Earnings rate amount + * Type: double + */ + Amount?: number | null; + + /** + * Earnings rate number of units. + * Type: double + */ + NumberOfUnits?: number | null; + + /** + * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + FixedAmount?: number | null; + } + export interface EarningsLineFormProperties { + + /** + * Xero unique id for earnings rate + * Required + */ + EarningsRateID: FormControl, + + /** Required */ + CalculationType: FormControl, + + /** + * Annual salary for earnings line + * Type: double + */ + AnnualSalary: FormControl, + + /** + * number of units for earning line + * Type: double + */ + NumberOfUnitsPerWeek: FormControl, + + /** + * Rate per unit of the EarningsLine. + * Type: double + */ + RatePerUnit: FormControl, + + /** + * Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" + * Type: double + */ + NormalNumberOfUnits: FormControl, + + /** + * Earnings rate amount + * Type: double + */ + Amount: FormControl, + + /** + * Earnings rate number of units. + * Type: double + */ + NumberOfUnits: FormControl, + + /** + * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + FixedAmount: FormControl, + } + export function CreateEarningsLineFormGroup() { + return new FormGroup({ + EarningsRateID: new FormControl(undefined, [Validators.required]), + CalculationType: new FormControl(undefined, [Validators.required]), + AnnualSalary: new FormControl(undefined), + NumberOfUnitsPerWeek: new FormControl(undefined), + RatePerUnit: new FormControl(undefined), + NormalNumberOfUnits: new FormControl(undefined), + Amount: new FormControl(undefined), + NumberOfUnits: new FormControl(undefined), + FixedAmount: new FormControl(undefined), + }); + + } + + export enum EarningsLineCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } + + export interface DeductionLine { + + /** + * Xero deduction type identifier + * Required + */ + DeductionTypeID: string; + + /** Required */ + CalculationType: DeductionLineCalculationType; + + /** + * Deduction type amount + * Type: double + */ + Amount?: number | null; + + /** + * The Percentage of the Deduction + * Type: double + */ + Percentage?: number | null; + + /** + * Deduction number of units + * Type: double + */ + NumberOfUnits?: number | null; + } + export interface DeductionLineFormProperties { + + /** + * Xero deduction type identifier + * Required + */ + DeductionTypeID: FormControl, + + /** Required */ + CalculationType: FormControl, + + /** + * Deduction type amount + * Type: double + */ + Amount: FormControl, + + /** + * The Percentage of the Deduction + * Type: double + */ + Percentage: FormControl, + + /** + * Deduction number of units + * Type: double + */ + NumberOfUnits: FormControl, + } + export function CreateDeductionLineFormGroup() { + return new FormGroup({ + DeductionTypeID: new FormControl(undefined, [Validators.required]), + CalculationType: new FormControl(undefined, [Validators.required]), + Amount: new FormControl(undefined), + Percentage: new FormControl(undefined), + NumberOfUnits: new FormControl(undefined), + }); + + } + + export enum DeductionLineCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } + + export interface SuperLine { + + /** Xero super membership ID */ + SuperMembershipID?: string | null; + ContributionType?: SuperLineContributionType | null; + CalculationType?: SuperLineCalculationType | null; + + /** + * amount of mimimum earnings + * Type: double + */ + MinimumMonthlyEarnings?: number | null; + + /** expense account code */ + ExpenseAccountCode?: string | null; + + /** liabilty account code */ + LiabilityAccountCode?: string | null; + + /** + * percentage for super line + * Type: double + */ + Percentage?: number | null; + + /** + * Super membership amount + * Type: double + */ + Amount?: number | null; + } + export interface SuperLineFormProperties { + + /** Xero super membership ID */ + SuperMembershipID: FormControl, + ContributionType: FormControl, + CalculationType: FormControl, + + /** + * amount of mimimum earnings + * Type: double + */ + MinimumMonthlyEarnings: FormControl, + + /** expense account code */ + ExpenseAccountCode: FormControl, + + /** liabilty account code */ + LiabilityAccountCode: FormControl, + + /** + * percentage for super line + * Type: double + */ + Percentage: FormControl, + + /** + * Super membership amount + * Type: double + */ + Amount: FormControl, + } + export function CreateSuperLineFormGroup() { + return new FormGroup({ + SuperMembershipID: new FormControl(undefined), + ContributionType: new FormControl(undefined), + CalculationType: new FormControl(undefined), + MinimumMonthlyEarnings: new FormControl(undefined), + ExpenseAccountCode: new FormControl(undefined), + LiabilityAccountCode: new FormControl(undefined), + Percentage: new FormControl(undefined), + Amount: new FormControl(undefined), + }); + + } + + export enum SuperLineContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } + + export enum SuperLineCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } + + export interface ReimbursementLine { + + /** Xero reimbursement type identifier */ + ReimbursementTypeID?: string | null; + + /** + * Reimbursement type amount + * Type: double + */ + Amount?: number | null; + + /** + * Reimbursement lines description (max length 50) + * Max length: 50 + */ + Description?: string | null; + + /** Reimbursement expense account. For posted pay run you should be able to see expense account code. */ + ExpenseAccount?: string | null; + } + export interface ReimbursementLineFormProperties { + + /** Xero reimbursement type identifier */ + ReimbursementTypeID: FormControl, + + /** + * Reimbursement type amount + * Type: double + */ + Amount: FormControl, + + /** + * Reimbursement lines description (max length 50) + * Max length: 50 + */ + Description: FormControl, + + /** Reimbursement expense account. For posted pay run you should be able to see expense account code. */ + ExpenseAccount: FormControl, + } + export function CreateReimbursementLineFormGroup() { + return new FormGroup({ + ReimbursementTypeID: new FormControl(undefined), + Amount: new FormControl(undefined), + Description: new FormControl(undefined, [Validators.maxLength(50)]), + ExpenseAccount: new FormControl(undefined), + }); + + } + + export interface LeaveLine { + + /** Xero leave type identifier */ + LeaveTypeID?: string | null; + + /** Calculation type for leave line for Opening Balance on Employee */ + CalculationType?: LeaveLineCalculationType | null; + EntitlementFinalPayPayoutType?: LeaveLineEntitlementFinalPayPayoutType | null; + EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; + + /** amount of leave line */ + IncludeSuperannuationGuaranteeContribution?: boolean | null; + + /** + * Leave number of units + * Type: double + */ + NumberOfUnits?: number | null; + } + export interface LeaveLineFormProperties { + + /** Xero leave type identifier */ + LeaveTypeID: FormControl, + + /** Calculation type for leave line for Opening Balance on Employee */ + CalculationType: FormControl, + EntitlementFinalPayPayoutType: FormControl, + EmploymentTerminationPaymentType: FormControl, + + /** amount of leave line */ + IncludeSuperannuationGuaranteeContribution: FormControl, + + /** + * Leave number of units + * Type: double + */ + NumberOfUnits: FormControl, + } + export function CreateLeaveLineFormGroup() { + return new FormGroup({ + LeaveTypeID: new FormControl(undefined), + CalculationType: new FormControl(undefined), + EntitlementFinalPayPayoutType: new FormControl(undefined), + EmploymentTerminationPaymentType: new FormControl(undefined), + IncludeSuperannuationGuaranteeContribution: new FormControl(undefined), + NumberOfUnits: new FormControl(undefined), + }); + + } + + export enum LeaveLineCalculationType { NOCALCULATIONREQUIRED = 0, FIXEDAMOUNTEACHPERIOD = 1, ENTERRATEINPAYTEMPLATE = 2, BASEDONORDINARYEARNINGS = 3, '' = 4 } + + export enum LeaveLineEntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } + + export enum LeaveLineEmploymentTerminationPaymentType { O = 0, R = 1 } + + export interface OpeningBalances { + + /** Opening Balance Date. (YYYY-MM-DD) */ + OpeningBalanceDate?: string | null; + + /** Opening Balance tax */ + Tax?: string | null; + EarningsLines?: Array; + DeductionLines?: Array; + SuperLines?: Array; + ReimbursementLines?: Array; + LeaveLines?: Array; + } + export interface OpeningBalancesFormProperties { + + /** Opening Balance Date. (YYYY-MM-DD) */ + OpeningBalanceDate: FormControl, + + /** Opening Balance tax */ + Tax: FormControl, + } + export function CreateOpeningBalancesFormGroup() { + return new FormGroup({ + OpeningBalanceDate: new FormControl(undefined), + Tax: new FormControl(undefined), + }); + + } + + export interface TaxDeclaration { + + /** + * Address line 1 for employee home address + * Required + */ + EmployeeID: string; + + /** Required */ + EmploymentBasis: TaxDeclarationEmploymentBasis; + TFNExemptionType?: TaxDeclarationTFNExemptionType | null; + + /** The tax file number e.g 123123123. */ + TaxFileNumber?: string | null; + + /** If the employee is Australian resident for tax purposes. e.g true or false */ + AustralianResidentForTaxPurposes?: boolean | null; + ResidencyStatus?: TaxDeclarationResidencyStatus | null; + + /** If tax free threshold claimed. e.g true or false */ + TaxFreeThresholdClaimed?: boolean | null; + + /** If has tax offset estimated then the tax offset estimated amount. e.g 100 */ + TaxOffsetEstimatedAmount?: string | null; + + /** If employee has HECS or HELP debt. e.g true or false */ + HasHELPDebt?: boolean | null; + + /** If employee has financial supplement debt. e.g true or false */ + HasSFSSDebt?: boolean | null; + + /** If employee has trade support loan. e.g true or false */ + HasTradeSupportLoanDebt?: boolean | null; + + /** If the employee has requested that additional tax be withheld each pay run. e.g 50 */ + UpwardVariationTaxWithholdingAmount?: string | null; + + /** If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false */ + EligibleToReceiveLeaveLoading?: boolean | null; + + /** If the employee has approved withholding variation. e.g (0 - 100) */ + ApprovedWithholdingVariationPercentage?: string | null; + + /** If the employee is eligible for student startup loan rules */ + HasStudentStartupLoan?: boolean | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + export interface TaxDeclarationFormProperties { + + /** + * Address line 1 for employee home address + * Required + */ + EmployeeID: FormControl, + + /** Required */ + EmploymentBasis: FormControl, + TFNExemptionType: FormControl, + + /** The tax file number e.g 123123123. */ + TaxFileNumber: FormControl, + + /** If the employee is Australian resident for tax purposes. e.g true or false */ + AustralianResidentForTaxPurposes: FormControl, + ResidencyStatus: FormControl, + + /** If tax free threshold claimed. e.g true or false */ + TaxFreeThresholdClaimed: FormControl, + + /** If has tax offset estimated then the tax offset estimated amount. e.g 100 */ + TaxOffsetEstimatedAmount: FormControl, + + /** If employee has HECS or HELP debt. e.g true or false */ + HasHELPDebt: FormControl, + + /** If employee has financial supplement debt. e.g true or false */ + HasSFSSDebt: FormControl, + + /** If employee has trade support loan. e.g true or false */ + HasTradeSupportLoanDebt: FormControl, + + /** If the employee has requested that additional tax be withheld each pay run. e.g 50 */ + UpwardVariationTaxWithholdingAmount: FormControl, + + /** If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false */ + EligibleToReceiveLeaveLoading: FormControl, + + /** If the employee has approved withholding variation. e.g (0 - 100) */ + ApprovedWithholdingVariationPercentage: FormControl, + + /** If the employee is eligible for student startup loan rules */ + HasStudentStartupLoan: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreateTaxDeclarationFormGroup() { + return new FormGroup({ + EmployeeID: new FormControl(undefined, [Validators.required]), + EmploymentBasis: new FormControl(undefined, [Validators.required]), + TFNExemptionType: new FormControl(undefined), + TaxFileNumber: new FormControl(undefined), + AustralianResidentForTaxPurposes: new FormControl(undefined), + ResidencyStatus: new FormControl(undefined), + TaxFreeThresholdClaimed: new FormControl(undefined), + TaxOffsetEstimatedAmount: new FormControl(undefined), + HasHELPDebt: new FormControl(undefined), + HasSFSSDebt: new FormControl(undefined), + HasTradeSupportLoanDebt: new FormControl(undefined), + UpwardVariationTaxWithholdingAmount: new FormControl(undefined), + EligibleToReceiveLeaveLoading: new FormControl(undefined), + ApprovedWithholdingVariationPercentage: new FormControl(undefined), + HasStudentStartupLoan: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export enum TaxDeclarationEmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } + + export enum TaxDeclarationTFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } + + export enum TaxDeclarationResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } + + export interface LeaveBalance { + + /** The name of the leave type */ + LeaveName?: string | null; + + /** Identifier of the leave type (see PayItems) */ + LeaveTypeID?: string | null; + + /** + * The balance of the leave available + * Type: double + */ + NumberOfUnits?: number | null; + + /** The type of units as specified by the LeaveType (see PayItems) */ + TypeOfUnits?: string | null; + } + export interface LeaveBalanceFormProperties { + + /** The name of the leave type */ + LeaveName: FormControl, + + /** Identifier of the leave type (see PayItems) */ + LeaveTypeID: FormControl, + + /** + * The balance of the leave available + * Type: double + */ + NumberOfUnits: FormControl, + + /** The type of units as specified by the LeaveType (see PayItems) */ + TypeOfUnits: FormControl, + } + export function CreateLeaveBalanceFormGroup() { + return new FormGroup({ + LeaveName: new FormControl(undefined), + LeaveTypeID: new FormControl(undefined), + NumberOfUnits: new FormControl(undefined), + TypeOfUnits: new FormControl(undefined), + }); + + } + + export interface SuperMembership { + + /** Xero unique identifier for Super membership */ + SuperMembershipID?: string | null; + + /** + * Xero identifier for super fund + * Required + */ + SuperFundID: string; + + /** + * The memberhsip number assigned to the employee by the super fund. + * Required + * Type: double + */ + EmployeeNumber: number; + } + export interface SuperMembershipFormProperties { + + /** Xero unique identifier for Super membership */ + SuperMembershipID: FormControl, + + /** + * Xero identifier for super fund + * Required + */ + SuperFundID: FormControl, + + /** + * The memberhsip number assigned to the employee by the super fund. + * Required + * Type: double + */ + EmployeeNumber: FormControl, + } + export function CreateSuperMembershipFormGroup() { + return new FormGroup({ + SuperMembershipID: new FormControl(undefined), + SuperFundID: new FormControl(undefined, [Validators.required]), + EmployeeNumber: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum EmployeeStatus { ACTIVE = 0, TERMINATED = 1 } + + export interface ValidationError { + + /** Validation error message */ + Message?: string | null; + } + export interface ValidationErrorFormProperties { + + /** Validation error message */ + Message: FormControl, + } + export function CreateValidationErrorFormGroup() { + return new FormGroup({ + Message: new FormControl(undefined), + }); + + } + + export interface LeaveApplications { + LeaveApplications1?: Array; + } + export interface LeaveApplicationsFormProperties { + } + export function CreateLeaveApplicationsFormGroup() { + return new FormGroup({ + }); + + } + + export interface LeaveApplication { + + /** The Xero identifier for Payroll Employee */ + LeaveApplicationID?: string | null; + + /** The Xero identifier for Payroll Employee */ + EmployeeID?: string | null; + + /** The Xero identifier for Leave Type */ + LeaveTypeID?: string | null; + + /** The title of the leave */ + Title?: string | null; + + /** Start date of the leave (YYYY-MM-DD) */ + StartDate?: string | null; + + /** End date of the leave (YYYY-MM-DD) */ + EndDate?: string | null; + + /** The Description of the Leave */ + Description?: string | null; + LeavePeriods?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface LeaveApplicationFormProperties { + + /** The Xero identifier for Payroll Employee */ + LeaveApplicationID: FormControl, + + /** The Xero identifier for Payroll Employee */ + EmployeeID: FormControl, + + /** The Xero identifier for Leave Type */ + LeaveTypeID: FormControl, + + /** The title of the leave */ + Title: FormControl, + + /** Start date of the leave (YYYY-MM-DD) */ + StartDate: FormControl, + + /** End date of the leave (YYYY-MM-DD) */ + EndDate: FormControl, + + /** The Description of the Leave */ + Description: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreateLeaveApplicationFormGroup() { + return new FormGroup({ + LeaveApplicationID: new FormControl(undefined), + EmployeeID: new FormControl(undefined), + LeaveTypeID: new FormControl(undefined), + Title: new FormControl(undefined), + StartDate: new FormControl(undefined), + EndDate: new FormControl(undefined), + Description: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export interface LeavePeriod { + + /** + * The Number of Units for the leave + * Type: double + */ + NumberOfUnits?: number | null; + + /** The Pay Period End Date (YYYY-MM-DD) */ + PayPeriodEndDate?: string | null; + + /** The Pay Period Start Date (YYYY-MM-DD) */ + PayPeriodStartDate?: string | null; + LeavePeriodStatus?: LeavePeriodLeavePeriodStatus | null; + } + export interface LeavePeriodFormProperties { + + /** + * The Number of Units for the leave + * Type: double + */ + NumberOfUnits: FormControl, + + /** The Pay Period End Date (YYYY-MM-DD) */ + PayPeriodEndDate: FormControl, + + /** The Pay Period Start Date (YYYY-MM-DD) */ + PayPeriodStartDate: FormControl, + LeavePeriodStatus: FormControl, + } + export function CreateLeavePeriodFormGroup() { + return new FormGroup({ + NumberOfUnits: new FormControl(undefined), + PayPeriodEndDate: new FormControl(undefined), + PayPeriodStartDate: new FormControl(undefined), + LeavePeriodStatus: new FormControl(undefined), + }); + + } + + export enum LeavePeriodLeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } + + export enum LeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } + + export interface PayItems { + PayItems1?: PayItem; + } + export interface PayItemsFormProperties { + } + export function CreatePayItemsFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayItem { + EarningsRates?: Array; + DeductionTypes?: Array; + LeaveTypes?: Array; + ReimbursementTypes?: Array; + } + export interface PayItemFormProperties { + } + export function CreatePayItemFormGroup() { + return new FormGroup({ + }); + + } + + export interface EarningsRate { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** + * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + * Max length: 50 + */ + TypeOfUnits?: string | null; + + /** Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding */ + IsExemptFromTax?: boolean | null; + + /** See the ATO website for details of which payments are exempt from SGC */ + IsExemptFromSuper?: boolean | null; + + /** Boolean to determine if the earnings rate is reportable or exempt from W1 */ + IsReportableAsW1?: boolean | null; + EarningsType?: EarningsRateEarningsType | null; + + /** Xero identifier */ + EarningsRateID?: string | null; + RateType?: EarningsRateRateType | null; + + /** Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. */ + RatePerUnit?: string | null; + + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + * Type: double + */ + Multiplier?: number | null; + + /** Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE */ + AccrueLeave?: boolean | null; + + /** + * Optional Amount for FIXEDAMOUNT RateType EarningsRate + * Type: double + */ + Amount?: number | null; + EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + AllowanceType?: EarningsRateAllowanceType | null; + } + export interface EarningsRateFormProperties { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name: FormControl, + + /** See Accounts */ + AccountCode: FormControl, + + /** + * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + * Max length: 50 + */ + TypeOfUnits: FormControl, + + /** Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding */ + IsExemptFromTax: FormControl, + + /** See the ATO website for details of which payments are exempt from SGC */ + IsExemptFromSuper: FormControl, + + /** Boolean to determine if the earnings rate is reportable or exempt from W1 */ + IsReportableAsW1: FormControl, + EarningsType: FormControl, + + /** Xero identifier */ + EarningsRateID: FormControl, + RateType: FormControl, + + /** Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. */ + RatePerUnit: FormControl, + + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + * Type: double + */ + Multiplier: FormControl, + + /** Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE */ + AccrueLeave: FormControl, + + /** + * Optional Amount for FIXEDAMOUNT RateType EarningsRate + * Type: double + */ + Amount: FormControl, + EmploymentTerminationPaymentType: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + + /** Is the current record */ + CurrentRecord: FormControl, + AllowanceType: FormControl, + } + export function CreateEarningsRateFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined, [Validators.maxLength(100)]), + AccountCode: new FormControl(undefined), + TypeOfUnits: new FormControl(undefined, [Validators.maxLength(50)]), + IsExemptFromTax: new FormControl(undefined), + IsExemptFromSuper: new FormControl(undefined), + IsReportableAsW1: new FormControl(undefined), + EarningsType: new FormControl(undefined), + EarningsRateID: new FormControl(undefined), + RateType: new FormControl(undefined), + RatePerUnit: new FormControl(undefined), + Multiplier: new FormControl(undefined), + AccrueLeave: new FormControl(undefined), + Amount: new FormControl(undefined), + EmploymentTerminationPaymentType: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + CurrentRecord: new FormControl(undefined), + AllowanceType: new FormControl(undefined), + }); + + } + + export enum EarningsRateEarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } + + export enum EarningsRateRateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } + + export enum EarningsRateAllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } + + export interface DeductionType { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. */ + ReducesTax?: boolean | null; + + /** Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. */ + ReducesSuper?: boolean | null; + + /** Boolean to determine if the deduction type is reportable or exempt from W1 */ + IsExemptFromW1?: boolean | null; + + /** Xero identifier */ + DeductionTypeID?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + DeductionCategory?: DeductionTypeDeductionCategory | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + } + export interface DeductionTypeFormProperties { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name: FormControl, + + /** See Accounts */ + AccountCode: FormControl, + + /** Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. */ + ReducesTax: FormControl, + + /** Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. */ + ReducesSuper: FormControl, + + /** Boolean to determine if the deduction type is reportable or exempt from W1 */ + IsExemptFromW1: FormControl, + + /** Xero identifier */ + DeductionTypeID: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + DeductionCategory: FormControl, + + /** Is the current record */ + CurrentRecord: FormControl, + } + export function CreateDeductionTypeFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined, [Validators.maxLength(100)]), + AccountCode: new FormControl(undefined), + ReducesTax: new FormControl(undefined), + ReducesSuper: new FormControl(undefined), + IsExemptFromW1: new FormControl(undefined), + DeductionTypeID: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + DeductionCategory: new FormControl(undefined), + CurrentRecord: new FormControl(undefined), + }); + + } + + export enum DeductionTypeDeductionCategory { NONE = 0, UNIONFEES = 1, WORKPLACEGIVING = 2 } + + export interface LeaveType { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate */ + TypeOfUnits?: string | null; + + /** Xero identifier */ + LeaveTypeID?: string | null; + + /** + * The number of units the employee is entitled to each year + * Type: double + */ + NormalEntitlement?: number | null; + + /** + * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + LeaveLoadingRate?: number | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Set this to indicate that an employee will be paid when taking this type of leave */ + IsPaidLeave?: boolean | null; + + /** Set this if you want a balance for this leave type to be shown on your employee’s payslips */ + ShowOnPayslip?: boolean | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + } + export interface LeaveTypeFormProperties { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name: FormControl, + + /** The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate */ + TypeOfUnits: FormControl, + + /** Xero identifier */ + LeaveTypeID: FormControl, + + /** + * The number of units the employee is entitled to each year + * Type: double + */ + NormalEntitlement: FormControl, + + /** + * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + LeaveLoadingRate: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + + /** Set this to indicate that an employee will be paid when taking this type of leave */ + IsPaidLeave: FormControl, + + /** Set this if you want a balance for this leave type to be shown on your employee’s payslips */ + ShowOnPayslip: FormControl, + + /** Is the current record */ + CurrentRecord: FormControl, + } + export function CreateLeaveTypeFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined, [Validators.maxLength(100)]), + TypeOfUnits: new FormControl(undefined), + LeaveTypeID: new FormControl(undefined), + NormalEntitlement: new FormControl(undefined), + LeaveLoadingRate: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + IsPaidLeave: new FormControl(undefined), + ShowOnPayslip: new FormControl(undefined), + CurrentRecord: new FormControl(undefined), + }); + + } + + export interface ReimbursementType { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** Xero identifier */ + ReimbursementTypeID?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + } + export interface ReimbursementTypeFormProperties { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name: FormControl, + + /** See Accounts */ + AccountCode: FormControl, + + /** Xero identifier */ + ReimbursementTypeID: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + + /** Is the current record */ + CurrentRecord: FormControl, + } + export function CreateReimbursementTypeFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined, [Validators.maxLength(100)]), + AccountCode: new FormControl(undefined), + ReimbursementTypeID: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + CurrentRecord: new FormControl(undefined), + }); + + } + + export interface PayrollCalendars { + PayrollCalendars1?: Array; + } + export interface PayrollCalendarsFormProperties { + } + export function CreatePayrollCalendarsFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayrollCalendar { + + /** Name of the Payroll Calendar */ + Name?: string | null; + CalendarType?: PayrollCalendarCalendarType | null; + + /** The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) */ + StartDate?: string | null; + + /** The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) */ + PaymentDate?: string | null; + + /** Xero identifier */ + PayrollCalendarID?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface PayrollCalendarFormProperties { + + /** Name of the Payroll Calendar */ + Name: FormControl, + CalendarType: FormControl, + + /** The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) */ + StartDate: FormControl, + + /** The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) */ + PaymentDate: FormControl, + + /** Xero identifier */ + PayrollCalendarID: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreatePayrollCalendarFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined), + CalendarType: new FormControl(undefined), + StartDate: new FormControl(undefined), + PaymentDate: new FormControl(undefined), + PayrollCalendarID: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export enum PayrollCalendarCalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } + + export interface Timesheets { + Timesheets1?: Array; + } + export interface TimesheetsFormProperties { + } + export function CreateTimesheetsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Timesheet { + + /** + * The Xero identifier for an employee + * Required + */ + EmployeeID: string; + + /** + * Period start date (YYYY-MM-DD) + * Required + */ + StartDate: string; + + /** + * Period end date (YYYY-MM-DD) + * Required + */ + EndDate: string; + Status?: TimesheetStatus | null; + + /** + * Timesheet total hours + * Type: double + */ + Hours?: number | null; + + /** The Xero identifier for a Payroll Timesheet */ + TimesheetID?: string | null; + TimesheetLines?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface TimesheetFormProperties { + + /** + * The Xero identifier for an employee + * Required + */ + EmployeeID: FormControl, + + /** + * Period start date (YYYY-MM-DD) + * Required + */ + StartDate: FormControl, + + /** + * Period end date (YYYY-MM-DD) + * Required + */ + EndDate: FormControl, + Status: FormControl, + + /** + * Timesheet total hours + * Type: double + */ + Hours: FormControl, + + /** The Xero identifier for a Payroll Timesheet */ + TimesheetID: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreateTimesheetFormGroup() { + return new FormGroup({ + EmployeeID: new FormControl(undefined, [Validators.required]), + StartDate: new FormControl(undefined, [Validators.required]), + EndDate: new FormControl(undefined, [Validators.required]), + Status: new FormControl(undefined), + Hours: new FormControl(undefined), + TimesheetID: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export enum TimesheetStatus { DRAFT = 0, PROCESSED = 1, APPROVED = 2 } + + export interface TimesheetLine { + + /** The Xero identifier for an Earnings Rate */ + EarningsRateID?: string | null; + + /** The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. */ + TrackingItemID?: string | null; + + /** The number of units on a timesheet line */ + NumberOfUnits?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + export interface TimesheetLineFormProperties { + + /** The Xero identifier for an Earnings Rate */ + EarningsRateID: FormControl, + + /** The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. */ + TrackingItemID: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreateTimesheetLineFormGroup() { + return new FormGroup({ + EarningsRateID: new FormControl(undefined), + TrackingItemID: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export interface TimesheetObject { + Timesheet?: Timesheet; + } + export interface TimesheetObjectFormProperties { + } + export function CreateTimesheetObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayRuns { + PayRuns1?: Array; + } + export interface PayRunsFormProperties { + } + export function CreatePayRunsFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayRun { + + /** + * Xero identifier for pay run + * Required + */ + PayrollCalendarID: string; + + /** Xero identifier for pay run */ + PayRunID?: string | null; + + /** Period Start Date for the PayRun (YYYY-MM-DD) */ + PayRunPeriodStartDate?: string | null; + + /** Period End Date for the PayRun (YYYY-MM-DD) */ + PayRunPeriodEndDate?: string | null; + PayRunStatus?: PayRunPayRunStatus | null; + + /** Payment Date for the PayRun (YYYY-MM-DD) */ + PaymentDate?: string | null; + + /** Payslip message for the PayRun */ + PayslipMessage?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** The payslips in the payrun */ + Payslips?: Array; + + /** + * The total Wages for the Payrun + * Type: double + */ + Wages?: number | null; + + /** + * The total Deductions for the Payrun + * Type: double + */ + Deductions?: number | null; + + /** + * The total Tax for the Payrun + * Type: double + */ + Tax?: number | null; + + /** + * The total Super for the Payrun + * Type: double + */ + Super?: number | null; + + /** + * The total Reimbursements for the Payrun + * Type: double + */ + Reimbursement?: number | null; + + /** + * The total NetPay for the Payrun + * Type: double + */ + NetPay?: number | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface PayRunFormProperties { + + /** + * Xero identifier for pay run + * Required + */ + PayrollCalendarID: FormControl, + + /** Xero identifier for pay run */ + PayRunID: FormControl, + + /** Period Start Date for the PayRun (YYYY-MM-DD) */ + PayRunPeriodStartDate: FormControl, + + /** Period End Date for the PayRun (YYYY-MM-DD) */ + PayRunPeriodEndDate: FormControl, + PayRunStatus: FormControl, + + /** Payment Date for the PayRun (YYYY-MM-DD) */ + PaymentDate: FormControl, + + /** Payslip message for the PayRun */ + PayslipMessage: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + + /** + * The total Wages for the Payrun + * Type: double + */ + Wages: FormControl, + + /** + * The total Deductions for the Payrun + * Type: double + */ + Deductions: FormControl, + + /** + * The total Tax for the Payrun + * Type: double + */ + Tax: FormControl, + + /** + * The total Super for the Payrun + * Type: double + */ + Super: FormControl, + + /** + * The total Reimbursements for the Payrun + * Type: double + */ + Reimbursement: FormControl, + + /** + * The total NetPay for the Payrun + * Type: double + */ + NetPay: FormControl, + } + export function CreatePayRunFormGroup() { + return new FormGroup({ + PayrollCalendarID: new FormControl(undefined, [Validators.required]), + PayRunID: new FormControl(undefined), + PayRunPeriodStartDate: new FormControl(undefined), + PayRunPeriodEndDate: new FormControl(undefined), + PayRunStatus: new FormControl(undefined), + PaymentDate: new FormControl(undefined), + PayslipMessage: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + Wages: new FormControl(undefined), + Deductions: new FormControl(undefined), + Tax: new FormControl(undefined), + Super: new FormControl(undefined), + Reimbursement: new FormControl(undefined), + NetPay: new FormControl(undefined), + }); + + } + + export enum PayRunPayRunStatus { DRAFT = 0, POSTED = 1 } + + export interface PayslipSummary { + + /** The Xero identifier for an employee */ + EmployeeID?: string | null; + + /** Xero identifier for the payslip */ + PayslipID?: string | null; + + /** First name of employee */ + FirstName?: string | null; + + /** Last name of employee */ + LastName?: string | null; + + /** Employee group name */ + EmployeeGroup?: string | null; + + /** + * The Wages for the Payslip + * Type: double + */ + Wages?: number | null; + + /** + * The Deductions for the Payslip + * Type: double + */ + Deductions?: number | null; + + /** + * The Tax for the Payslip + * Type: double + */ + Tax?: number | null; + + /** + * The Super for the Payslip + * Type: double + */ + Super?: number | null; + + /** + * The Reimbursements for the Payslip + * Type: double + */ + Reimbursements?: number | null; + + /** + * The NetPay for the Payslip + * Type: double + */ + NetPay?: number | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + export interface PayslipSummaryFormProperties { + + /** The Xero identifier for an employee */ + EmployeeID: FormControl, + + /** Xero identifier for the payslip */ + PayslipID: FormControl, + + /** First name of employee */ + FirstName: FormControl, + + /** Last name of employee */ + LastName: FormControl, + + /** Employee group name */ + EmployeeGroup: FormControl, + + /** + * The Wages for the Payslip + * Type: double + */ + Wages: FormControl, + + /** + * The Deductions for the Payslip + * Type: double + */ + Deductions: FormControl, + + /** + * The Tax for the Payslip + * Type: double + */ + Tax: FormControl, + + /** + * The Super for the Payslip + * Type: double + */ + Super: FormControl, + + /** + * The Reimbursements for the Payslip + * Type: double + */ + Reimbursements: FormControl, + + /** + * The NetPay for the Payslip + * Type: double + */ + NetPay: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreatePayslipSummaryFormGroup() { + return new FormGroup({ + EmployeeID: new FormControl(undefined), + PayslipID: new FormControl(undefined), + FirstName: new FormControl(undefined), + LastName: new FormControl(undefined), + EmployeeGroup: new FormControl(undefined), + Wages: new FormControl(undefined), + Deductions: new FormControl(undefined), + Tax: new FormControl(undefined), + Super: new FormControl(undefined), + Reimbursements: new FormControl(undefined), + NetPay: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export interface PayslipLines { + EarningsLines?: Array; + LeaveEarningsLines?: Array; + TimesheetEarningsLines?: Array; + DeductionLines?: Array; + LeaveAccrualLines?: Array; + ReimbursementLines?: Array; + SuperannuationLines?: Array; + TaxLines?: Array; + } + export interface PayslipLinesFormProperties { + } + export function CreatePayslipLinesFormGroup() { + return new FormGroup({ + }); + + } + + export interface LeaveEarningsLine { + + /** Xero identifier */ + EarningsRateID?: string | null; + + /** + * Rate per unit of the EarningsLine. + * Type: double + */ + RatePerUnit?: number | null; + + /** + * Earnings rate number of units. + * Type: double + */ + NumberOfUnits?: number | null; + } + export interface LeaveEarningsLineFormProperties { + + /** Xero identifier */ + EarningsRateID: FormControl, + + /** + * Rate per unit of the EarningsLine. + * Type: double + */ + RatePerUnit: FormControl, + + /** + * Earnings rate number of units. + * Type: double + */ + NumberOfUnits: FormControl, + } + export function CreateLeaveEarningsLineFormGroup() { + return new FormGroup({ + EarningsRateID: new FormControl(undefined), + RatePerUnit: new FormControl(undefined), + NumberOfUnits: new FormControl(undefined), + }); + + } + + export interface LeaveAccrualLine { + + /** Xero identifier for the Leave type. */ + LeaveTypeID?: string | null; + + /** + * Leave Accrual number of units + * Type: double + */ + NumberOfUnits?: number | null; + + /** If you want to auto calculate leave. */ + AutoCalculate?: boolean | null; + } + export interface LeaveAccrualLineFormProperties { + + /** Xero identifier for the Leave type. */ + LeaveTypeID: FormControl, + + /** + * Leave Accrual number of units + * Type: double + */ + NumberOfUnits: FormControl, + + /** If you want to auto calculate leave. */ + AutoCalculate: FormControl, + } + export function CreateLeaveAccrualLineFormGroup() { + return new FormGroup({ + LeaveTypeID: new FormControl(undefined), + NumberOfUnits: new FormControl(undefined), + AutoCalculate: new FormControl(undefined), + }); + + } + + export interface SuperannuationLine { + + /** Xero identifier for payroll super fund membership ID. */ + SuperMembershipID?: string | null; + ContributionType?: SuperLineContributionType | null; + CalculationType?: SuperLineCalculationType | null; + + /** + * Superannuation minimum monthly earnings. + * Type: double + */ + MinimumMonthlyEarnings?: number | null; + + /** Superannuation expense account code. */ + ExpenseAccountCode?: string | null; + + /** Superannuation liability account code */ + LiabilityAccountCode?: string | null; + + /** Superannuation payment date for the current period (YYYY-MM-DD) */ + PaymentDateForThisPeriod?: string | null; + + /** + * Superannuation percentage + * Type: double + */ + Percentage?: number | null; + + /** + * Superannuation amount + * Type: double + */ + Amount?: number | null; + } + export interface SuperannuationLineFormProperties { + + /** Xero identifier for payroll super fund membership ID. */ + SuperMembershipID: FormControl, + ContributionType: FormControl, + CalculationType: FormControl, + + /** + * Superannuation minimum monthly earnings. + * Type: double + */ + MinimumMonthlyEarnings: FormControl, + + /** Superannuation expense account code. */ + ExpenseAccountCode: FormControl, + + /** Superannuation liability account code */ + LiabilityAccountCode: FormControl, + + /** Superannuation payment date for the current period (YYYY-MM-DD) */ + PaymentDateForThisPeriod: FormControl, + + /** + * Superannuation percentage + * Type: double + */ + Percentage: FormControl, + + /** + * Superannuation amount + * Type: double + */ + Amount: FormControl, + } + export function CreateSuperannuationLineFormGroup() { + return new FormGroup({ + SuperMembershipID: new FormControl(undefined), + ContributionType: new FormControl(undefined), + CalculationType: new FormControl(undefined), + MinimumMonthlyEarnings: new FormControl(undefined), + ExpenseAccountCode: new FormControl(undefined), + LiabilityAccountCode: new FormControl(undefined), + PaymentDateForThisPeriod: new FormControl(undefined), + Percentage: new FormControl(undefined), + Amount: new FormControl(undefined), + }); + + } + + export interface TaxLine { + + /** Xero identifier for payslip tax line ID. */ + PayslipTaxLineID?: string | null; + + /** + * The tax line amount + * Type: double + */ + Amount?: number | null; + + /** Name of the tax type. */ + TaxTypeName?: string | null; + + /** Description of the tax line. */ + Description?: string | null; + ManualTaxType?: TaxLineManualTaxType | null; + + /** The tax line liability account code. For posted pay run you should be able to see liability account code */ + LiabilityAccount?: string | null; + } + export interface TaxLineFormProperties { + + /** Xero identifier for payslip tax line ID. */ + PayslipTaxLineID: FormControl, + + /** + * The tax line amount + * Type: double + */ + Amount: FormControl, + + /** Name of the tax type. */ + TaxTypeName: FormControl, + + /** Description of the tax line. */ + Description: FormControl, + ManualTaxType: FormControl, + + /** The tax line liability account code. For posted pay run you should be able to see liability account code */ + LiabilityAccount: FormControl, + } + export function CreateTaxLineFormGroup() { + return new FormGroup({ + PayslipTaxLineID: new FormControl(undefined), + Amount: new FormControl(undefined), + TaxTypeName: new FormControl(undefined), + Description: new FormControl(undefined), + ManualTaxType: new FormControl(undefined), + LiabilityAccount: new FormControl(undefined), + }); + + } + + export enum TaxLineManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } + + export interface PayslipObject { + Payslip?: Payslip; + } + export interface PayslipObjectFormProperties { + } + export function CreatePayslipObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Payslip { + + /** The Xero identifier for an employee */ + EmployeeID?: string | null; + + /** Xero identifier for the payslip */ + PayslipID?: string | null; + + /** First name of employee */ + FirstName?: string | null; + + /** Last name of employee */ + LastName?: string | null; + + /** + * The Wages for the Payslip + * Type: double + */ + Wages?: number | null; + + /** + * The Deductions for the Payslip + * Type: double + */ + Deductions?: number | null; + + /** + * The Tax for the Payslip + * Type: double + */ + Tax?: number | null; + + /** + * The Super for the Payslip + * Type: double + */ + Super?: number | null; + + /** + * The Reimbursements for the Payslip + * Type: double + */ + Reimbursements?: number | null; + + /** + * The NetPay for the Payslip + * Type: double + */ + NetPay?: number | null; + EarningsLines?: Array; + LeaveEarningsLines?: Array; + TimesheetEarningsLines?: Array; + DeductionLines?: Array; + LeaveAccrualLines?: Array; + ReimbursementLines?: Array; + SuperannuationLines?: Array; + TaxLines?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + export interface PayslipFormProperties { + + /** The Xero identifier for an employee */ + EmployeeID: FormControl, + + /** Xero identifier for the payslip */ + PayslipID: FormControl, + + /** First name of employee */ + FirstName: FormControl, + + /** Last name of employee */ + LastName: FormControl, + + /** + * The Wages for the Payslip + * Type: double + */ + Wages: FormControl, + + /** + * The Deductions for the Payslip + * Type: double + */ + Deductions: FormControl, + + /** + * The Tax for the Payslip + * Type: double + */ + Tax: FormControl, + + /** + * The Super for the Payslip + * Type: double + */ + Super: FormControl, + + /** + * The Reimbursements for the Payslip + * Type: double + */ + Reimbursements: FormControl, + + /** + * The NetPay for the Payslip + * Type: double + */ + NetPay: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreatePayslipFormGroup() { + return new FormGroup({ + EmployeeID: new FormControl(undefined), + PayslipID: new FormControl(undefined), + FirstName: new FormControl(undefined), + LastName: new FormControl(undefined), + Wages: new FormControl(undefined), + Deductions: new FormControl(undefined), + Tax: new FormControl(undefined), + Super: new FormControl(undefined), + Reimbursements: new FormControl(undefined), + NetPay: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export interface Payslips { + Payslips1?: Array; + } + export interface PayslipsFormProperties { + } + export function CreatePayslipsFormGroup() { + return new FormGroup({ + }); + + } + + export interface SettingsObject { + Settings?: Settings; + } + export interface SettingsObjectFormProperties { + } + export function CreateSettingsObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Settings { + + /** Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. */ + Accounts?: Array; + + /** Tracking categories for Employees and Timesheets */ + TrackingCategories?: SettingsTrackingCategories; + + /** + * Number of days in the Payroll year + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + DaysInPayrollYear?: number | null; + } + export interface SettingsFormProperties { + + /** + * Number of days in the Payroll year + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + DaysInPayrollYear: FormControl, + } + export function CreateSettingsFormGroup() { + return new FormGroup({ + DaysInPayrollYear: new FormControl(undefined), + }); + + } + + export interface Account { + + /** Xero identifier for accounts */ + AccountID?: string | null; + + /** See Account Types */ + Type?: AccountType | null; + + /** Customer defined account code */ + Code?: string | null; + + /** Name of account */ + Name?: string | null; + } + export interface AccountFormProperties { + + /** Xero identifier for accounts */ + AccountID: FormControl, + + /** See Account Types */ + Type: FormControl, + + /** Customer defined account code */ + Code: FormControl, + + /** Name of account */ + Name: FormControl, + } + export function CreateAccountFormGroup() { + return new FormGroup({ + AccountID: new FormControl(undefined), + Type: new FormControl(undefined), + Code: new FormControl(undefined), + Name: new FormControl(undefined), + }); + + } + + export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21, WAGESPAYABLELIABILITY = 22 } + + export interface SettingsTrackingCategories { + + /** The tracking category used for employees */ + EmployeeGroups?: SettingsTrackingCategoriesEmployeeGroups; + + /** The tracking category used for timesheets */ + TimesheetCategories?: SettingsTrackingCategoriesTimesheetCategories; + } + export interface SettingsTrackingCategoriesFormProperties { + } + export function CreateSettingsTrackingCategoriesFormGroup() { + return new FormGroup({ + }); + + } + + export interface SettingsTrackingCategoriesEmployeeGroups { + + /** The identifier for the tracking category */ + TrackingCategoryID?: string | null; + + /** Name of the tracking category */ + TrackingCategoryName?: string | null; + } + export interface SettingsTrackingCategoriesEmployeeGroupsFormProperties { + + /** The identifier for the tracking category */ + TrackingCategoryID: FormControl, + + /** Name of the tracking category */ + TrackingCategoryName: FormControl, + } + export function CreateSettingsTrackingCategoriesEmployeeGroupsFormGroup() { + return new FormGroup({ + TrackingCategoryID: new FormControl(undefined), + TrackingCategoryName: new FormControl(undefined), + }); + + } + + export interface SettingsTrackingCategoriesTimesheetCategories { + + /** The identifier for the tracking category */ + TrackingCategoryID?: string | null; + + /** Name of the tracking category */ + TrackingCategoryName?: string | null; + } + export interface SettingsTrackingCategoriesTimesheetCategoriesFormProperties { + + /** The identifier for the tracking category */ + TrackingCategoryID: FormControl, + + /** Name of the tracking category */ + TrackingCategoryName: FormControl, + } + export function CreateSettingsTrackingCategoriesTimesheetCategoriesFormGroup() { + return new FormGroup({ + TrackingCategoryID: new FormControl(undefined), + TrackingCategoryName: new FormControl(undefined), + }); + + } + + export interface SuperFunds { + SuperFunds1?: Array; + } + export interface SuperFundsFormProperties { + } + export function CreateSuperFundsFormGroup() { + return new FormGroup({ + }); + + } + + export interface SuperFund { + + /** Xero identifier for a super fund */ + SuperFundID?: string | null; + + /** Required */ + Type: SuperFundType; + + /** Name of the super fund */ + Name?: string | null; + + /** ABN of the self managed super fund */ + ABN?: string | null; + + /** BSB of the self managed super fund */ + BSB?: string | null; + + /** The account number for the self managed super fund. */ + AccountNumber?: string | null; + + /** The account name for the self managed super fund. */ + AccountName?: string | null; + + /** The electronic service address for the self managed super fund. */ + ElectronicServiceAddress?: string | null; + + /** Some funds assign a unique number to each employer */ + EmployerNumber?: string | null; + + /** The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. */ + SPIN?: string | null; + + /** The USI of the Regulated SuperFund */ + USI?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface SuperFundFormProperties { + + /** Xero identifier for a super fund */ + SuperFundID: FormControl, + + /** Required */ + Type: FormControl, + + /** Name of the super fund */ + Name: FormControl, + + /** ABN of the self managed super fund */ + ABN: FormControl, + + /** BSB of the self managed super fund */ + BSB: FormControl, + + /** The account number for the self managed super fund. */ + AccountNumber: FormControl, + + /** The account name for the self managed super fund. */ + AccountName: FormControl, + + /** The electronic service address for the self managed super fund. */ + ElectronicServiceAddress: FormControl, + + /** Some funds assign a unique number to each employer */ + EmployerNumber: FormControl, + + /** The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. */ + SPIN: FormControl, + + /** The USI of the Regulated SuperFund */ + USI: FormControl, + + /** Last modified timestamp */ + UpdatedDateUTC: FormControl, + } + export function CreateSuperFundFormGroup() { + return new FormGroup({ + SuperFundID: new FormControl(undefined), + Type: new FormControl(undefined, [Validators.required]), + Name: new FormControl(undefined), + ABN: new FormControl(undefined), + BSB: new FormControl(undefined), + AccountNumber: new FormControl(undefined), + AccountName: new FormControl(undefined), + ElectronicServiceAddress: new FormControl(undefined), + EmployerNumber: new FormControl(undefined), + SPIN: new FormControl(undefined), + USI: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export enum SuperFundType { REGULATED = 0, SMSF = 1 } + + export interface SuperFundProducts { + SuperFundProducts1?: Array; + } + export interface SuperFundProductsFormProperties { + } + export function CreateSuperFundProductsFormGroup() { + return new FormGroup({ + }); + + } + + export interface SuperFundProduct { + + /** The ABN of the Regulated SuperFund */ + ABN?: string | null; + + /** The USI of the Regulated SuperFund */ + USI?: string | null; + + /** The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN */ + SPIN?: string | null; + + /** The name of the Regulated SuperFund */ + ProductName?: string | null; + } + export interface SuperFundProductFormProperties { + + /** The ABN of the Regulated SuperFund */ + ABN: FormControl, + + /** The USI of the Regulated SuperFund */ + USI: FormControl, + + /** The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN */ + SPIN: FormControl, + + /** The name of the Regulated SuperFund */ + ProductName: FormControl, + } + export function CreateSuperFundProductFormGroup() { + return new FormGroup({ + ABN: new FormControl(undefined), + USI: new FormControl(undefined), + SPIN: new FormControl(undefined), + ProductName: new FormControl(undefined), + }); + + } + + + /** The reimbursement type lines */ + export interface ReimbursementLines { + ReimbursementLines1?: Array; + } + + /** The reimbursement type lines */ + export interface ReimbursementLinesFormProperties { + } + export function CreateReimbursementLinesFormGroup() { + return new FormGroup({ + }); + + } + + + /** The leave type lines */ + export interface LeaveLines { + Employee?: Array; + } + + /** The leave type lines */ + export interface LeaveLinesFormProperties { + } + export function CreateLeaveLinesFormGroup() { + return new FormGroup({ + }); + + } + + export enum RateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } + + export enum EarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } + + export enum EmploymentTerminationPaymentType { O = 0, R = 1 } + + export enum AllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } + + export enum CalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } + + export enum EarningsRateCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } + + export enum DeductionTypeCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } + + export enum SuperannuationContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } + + export enum SuperannuationCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } + + export enum PaymentFrequencyType { WEEKLY = 0, MONTHLY = 1, FORTNIGHTLY = 2, QUARTERLY = 3, TWICEMONTHLY = 4, FOURWEEKLY = 5, YEARLY = 6 } + + export enum LeaveTypeContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } + + export enum EntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } + + export enum PayRunStatus { DRAFT = 0, POSTED = 1 } + + export enum ManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } + + export enum EmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } + + export enum TFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } + + export enum ResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } + + + /** State abbreviation for employee home address */ + export enum State { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } + + + /** The object returned for a bad request */ + export interface APIException { + + /** The error number */ + ErrorNumber?: string | null; + + /** The type of error */ + Type?: string | null; + + /** The message describing the error */ + Message?: string | null; + } + + /** The object returned for a bad request */ + export interface APIExceptionFormProperties { + + /** The error number */ + ErrorNumber: FormControl, + + /** The type of error */ + Type: FormControl, + + /** The message describing the error */ + Message: FormControl, + } + export function CreateAPIExceptionFormGroup() { + return new FormGroup({ + ErrorNumber: new FormControl(undefined), + Type: new FormControl(undefined), + Message: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches employees + * Get Employees + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 employees will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Employees} search results matching criteria + */ + GetEmployees(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a payroll employee + * Post Employees + * @return {Employees} A successful request + */ + CreateEmployee(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an employee by unique id + * Get Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {Employees} search results matching criteria + */ + GetEmployee(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); + } + + /** + * Update an Employee + * Update properties on a single employee + * Post Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {Employees} A successful request + */ + UpdateEmployee(EmployeeId: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Leave Applications + * Get LeaveApplications + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {LeaveApplications} search results matching criteria + */ + GetLeaveApplications(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'LeaveApplications?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a Leave Application + * Post LeaveApplications + * @return {LeaveApplications} A successful request + */ + CreateLeaveApplication(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'LeaveApplications', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an Leave Application by unique id + * Get LeaveApplications/{LeaveApplicationId} + * @param {string} LeaveApplicationId Leave Application id for single object + * @return {LeaveApplications} search results matching criteria + */ + GetLeaveApplication(LeaveApplicationId: string): Observable { + return this.http.get(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), {}); + } + + /** + * Use this method to update a Leave Application + * Post LeaveApplications/{LeaveApplicationId} + * @param {string} LeaveApplicationId Leave Application id for single object + * @return {LeaveApplications} A successful request + */ + UpdateLeaveApplication(LeaveApplicationId: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Pay Items + * Get PayItems + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayItems} search results matching criteria + */ + GetPayItems(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayItems?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a Pay Item + * Post PayItems + * @return {PayItems} A successful request - currently returns empty array for JSON + */ + CreatePayItem(requestBody: PayItem): Observable { + return this.http.post(this.baseUri + 'PayItems', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Payroll Calendars + * Get PayrollCalendars + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayrollCalendars} search results matching criteria + */ + GetPayrollCalendars(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayrollCalendars?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a Payroll Calendars + * Post PayrollCalendars + * @return {PayrollCalendars} A successful request + */ + CreatePayrollCalendar(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'PayrollCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Payroll Calendars + * Get PayrollCalendars/{PayrollCalendarID} + * @param {string} PayrollCalendarID Payroll Calendar id for single object + * @return {PayrollCalendars} search results matching criteria + */ + GetPayrollCalendar(PayrollCalendarID: string): Observable { + return this.http.get(this.baseUri + 'PayrollCalendars/' + (PayrollCalendarID == null ? '' : encodeURIComponent(PayrollCalendarID)), {}); + } + + /** + * searches PayRuns + * Get PayRuns + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayRuns} search results matching criteria + */ + GetPayRuns(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayRuns?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a PayRun + * Post PayRuns + * @return {PayRuns} A successful request + */ + CreatePayRun(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'PayRuns', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an payrun by unique id + * Get PayRuns/{PayRunID} + * @param {string} PayRunID PayRun id for single object + * @return {PayRuns} search results matching criteria + */ + GetPayRun(PayRunID: string): Observable { + return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); + } + + /** + * Update a PayRun + * Update properties on a single PayRun + * Post PayRuns/{PayRunID} + * @param {string} PayRunID PayRun id for single object + * @return {PayRuns} A successful request + */ + UpdatePayRun(PayRunID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an payslip by unique id + * Get Payslip/{PayslipID} + * @param {string} PayslipID Payslip id for single object + * @return {PayslipObject} search results matching criteria + */ + GetPayslip(PayslipID: string): Observable { + return this.http.get(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); + } + + /** + * Update a Payslip + * Update lines on a single payslips + * Post Payslip/{PayslipID} + * @param {string} PayslipID Payslip id for single object + * @return {Payslips} A successful request - currently returns empty array for JSON + */ + UpdatePayslip(PayslipID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve settings + * Get Settings + * @return {SettingsObject} payroll settings + */ + GetSettings(): Observable { + return this.http.get(this.baseUri + 'Settings', {}); + } + + /** + * searches SuperFunds + * Get Superfunds + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {SuperFunds} search results matching criteria + */ + GetSuperfunds(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Superfunds?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a super fund + * Post Superfunds + * @return {SuperFunds} A successful request + */ + CreateSuperfund(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Superfunds', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an Superfund by unique id + * Get Superfunds/{SuperFundID} + * @param {string} SuperFundID Superfund id for single object + * @return {SuperFunds} search results matching criteria + */ + GetSuperfund(SuperFundID: string): Observable { + return this.http.get(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), {}); + } + + /** + * Update a Superfund + * Update properties on a single Superfund + * Post Superfunds/{SuperFundID} + * @param {string} SuperFundID Superfund id for single object + * @return {SuperFunds} A successful request + */ + UpdateSuperfund(SuperFundID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches SuperfundProducts + * Get SuperfundProducts + * @param {string} ABN The ABN of the Regulated SuperFund + * @param {string} USI The USI of the Regulated SuperFund + * @return {SuperFundProducts} search results matching criteria + */ + GetSuperfundProducts(ABN: string | null | undefined, USI: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'SuperfundProducts?ABN=' + (ABN == null ? '' : encodeURIComponent(ABN)) + '&USI=' + (USI == null ? '' : encodeURIComponent(USI)), {}); + } + + /** + * searches timesheets + * Get Timesheets + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 timesheets will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Timesheets} search results matching criteria + */ + GetTimesheets(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Timesheets?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a timesheet + * Post Timesheets + * @return {Timesheets} A successful request + */ + CreateTimesheet(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an timesheet by unique id + * Get Timesheets/{TimesheetID} + * @param {string} TimesheetID Timesheet id for single object + * @return {TimesheetObject} search results matching criteria + */ + GetTimesheet(TimesheetID: string): Observable { + return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); + } + + /** + * Update a Timesheet + * Update properties on a single timesheet + * Post Timesheets/{TimesheetID} + * @param {string} TimesheetID Timesheet id for single object + * @return {Timesheets} A successful request + */ + UpdateTimesheet(TimesheetID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-uk.txt b/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-uk.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-uk.txt rename to Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-uk.ts index 2b4cf1b2..22a1e954 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-uk.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/xero-payroll-uk.ts @@ -1,4734 +1,4734 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Pagination { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - page?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageSize?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageCount?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - itemCount?: number | null; - } - export interface PaginationFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - page: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageSize: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageCount: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - itemCount: FormControl, - } - export function CreatePaginationFormGroup() { - return new FormGroup({ - page: new FormControl(undefined), - pageSize: new FormControl(undefined), - pageCount: new FormControl(undefined), - itemCount: new FormControl(undefined), - }); - - } - - - /** The object returned for a bad request */ - export interface Problem { - - /** The type of error format */ - type?: string | null; - - /** The type of the error */ - title?: string | null; - - /** The error status code */ - status?: string | null; - - /** A description of the error */ - detail?: string | null; - instance?: string | null; - invalidFields?: Array; - } - - /** The object returned for a bad request */ - export interface ProblemFormProperties { - - /** The type of error format */ - type: FormControl, - - /** The type of the error */ - title: FormControl, - - /** The error status code */ - status: FormControl, - - /** A description of the error */ - detail: FormControl, - instance: FormControl, - } - export function CreateProblemFormGroup() { - return new FormGroup({ - type: new FormControl(undefined), - title: new FormControl(undefined), - status: new FormControl(undefined), - detail: new FormControl(undefined), - instance: new FormControl(undefined), - }); - - } - - export interface InvalidField { - - /** The name of the field that caused the error */ - name?: string | null; - - /** The reason the error occurred */ - reason?: string | null; - } - export interface InvalidFieldFormProperties { - - /** The name of the field that caused the error */ - name: FormControl, - - /** The reason the error occurred */ - reason: FormControl, - } - export function CreateInvalidFieldFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - reason: new FormControl(undefined), - }); - - } - - export interface Employees { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - employees?: Array; - } - export interface EmployeesFormProperties { - } - export function CreateEmployeesFormGroup() { - return new FormGroup({ - }); - - } - - export interface Employee { - - /** Xero unique identifier for the employee */ - employeeID?: string | null; - - /** Title of the employee */ - title?: string | null; - - /** First name of employee */ - firstName?: string | null; - - /** Last name of employee */ - lastName?: string | null; - - /** - * Date of birth of the employee (YYYY-MM-DD) - * Type: DateOnly - */ - dateOfBirth?: Date | null; - address?: Address; - - /** The email address for the employee */ - email?: string | null; - - /** The employee’s gender */ - gender?: EmployeeGender | null; - - /** Employee phone number */ - phoneNumber?: string | null; - - /** - * Employment start date of the employee at the time it was requested - * Type: DateOnly - */ - startDate?: Date | null; - - /** - * Employment end date of the employee at the time it was requested - * Type: DateOnly - */ - endDate?: Date | null; - - /** Xero unique identifier for the payroll calendar of the employee */ - payrollCalendarID?: string | null; - - /** UTC timestamp of last update to the employee */ - updatedDateUTC?: Date | null; - - /** UTC timestamp when the employee was created in Xero */ - createdDateUTC?: Date | null; - - /** National insurance number of the employee */ - nationalInsuranceNumber?: string | null; - } - export interface EmployeeFormProperties { - - /** Xero unique identifier for the employee */ - employeeID: FormControl, - - /** Title of the employee */ - title: FormControl, - - /** First name of employee */ - firstName: FormControl, - - /** Last name of employee */ - lastName: FormControl, - - /** - * Date of birth of the employee (YYYY-MM-DD) - * Type: DateOnly - */ - dateOfBirth: FormControl, - - /** The email address for the employee */ - email: FormControl, - - /** The employee’s gender */ - gender: FormControl, - - /** Employee phone number */ - phoneNumber: FormControl, - - /** - * Employment start date of the employee at the time it was requested - * Type: DateOnly - */ - startDate: FormControl, - - /** - * Employment end date of the employee at the time it was requested - * Type: DateOnly - */ - endDate: FormControl, - - /** Xero unique identifier for the payroll calendar of the employee */ - payrollCalendarID: FormControl, - - /** UTC timestamp of last update to the employee */ - updatedDateUTC: FormControl, - - /** UTC timestamp when the employee was created in Xero */ - createdDateUTC: FormControl, - - /** National insurance number of the employee */ - nationalInsuranceNumber: FormControl, - } - export function CreateEmployeeFormGroup() { - return new FormGroup({ - employeeID: new FormControl(undefined), - title: new FormControl(undefined), - firstName: new FormControl(undefined), - lastName: new FormControl(undefined), - dateOfBirth: new FormControl(undefined), - email: new FormControl(undefined), - gender: new FormControl(undefined), - phoneNumber: new FormControl(undefined), - startDate: new FormControl(undefined), - endDate: new FormControl(undefined), - payrollCalendarID: new FormControl(undefined), - updatedDateUTC: new FormControl(undefined), - createdDateUTC: new FormControl(undefined), - nationalInsuranceNumber: new FormControl(undefined), - }); - - } - - export interface Address { - - /** - * Address line 1 for employee home address - * Required - */ - addressLine1: string; - - /** Address line 2 for employee home address */ - addressLine2?: string | null; - - /** - * Suburb for employee home address - * Required - */ - city: string; - - /** - * PostCode for employee home address - * Required - */ - postCode: string; - - /** Country of HomeAddress */ - countryName?: string | null; - } - export interface AddressFormProperties { - - /** - * Address line 1 for employee home address - * Required - */ - addressLine1: FormControl, - - /** Address line 2 for employee home address */ - addressLine2: FormControl, - - /** - * Suburb for employee home address - * Required - */ - city: FormControl, - - /** - * PostCode for employee home address - * Required - */ - postCode: FormControl, - - /** Country of HomeAddress */ - countryName: FormControl, - } - export function CreateAddressFormGroup() { - return new FormGroup({ - addressLine1: new FormControl(undefined, [Validators.required]), - addressLine2: new FormControl(undefined), - city: new FormControl(undefined, [Validators.required]), - postCode: new FormControl(undefined, [Validators.required]), - countryName: new FormControl(undefined), - }); - - } - - export enum EmployeeGender { M = 0, F = 1 } - - export interface EmployeeObject { - pagination?: Pagination; - employee?: Employee; - - /** The object returned for a bad request */ - problem?: Problem; - } - export interface EmployeeObjectFormProperties { - } - export function CreateEmployeeObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmploymentObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - employment?: Employment; - } - export interface EmploymentObjectFormProperties { - } - export function CreateEmploymentObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Employment { - - /** Xero unique identifier for the payroll calendar of the employee */ - payrollCalendarID?: string | null; - - /** - * Start date of the employment (YYYY-MM-DD) - * Type: DateOnly - */ - startDate?: Date | null; - - /** The employment number of the employee */ - employeeNumber?: string | null; - - /** The NI Category of the employee */ - niCategory?: EmploymentNiCategory | null; - } - export interface EmploymentFormProperties { - - /** Xero unique identifier for the payroll calendar of the employee */ - payrollCalendarID: FormControl, - - /** - * Start date of the employment (YYYY-MM-DD) - * Type: DateOnly - */ - startDate: FormControl, - - /** The employment number of the employee */ - employeeNumber: FormControl, - - /** The NI Category of the employee */ - niCategory: FormControl, - } - export function CreateEmploymentFormGroup() { - return new FormGroup({ - payrollCalendarID: new FormControl(undefined), - startDate: new FormControl(undefined), - employeeNumber: new FormControl(undefined), - niCategory: new FormControl(undefined), - }); - - } - - export enum EmploymentNiCategory { A = 0, B = 1, C = 2, H = 3, J = 4, M = 5, Z = 6, X = 7 } - - export interface EmployeeTaxObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - employeeTax?: EmployeeTax; - } - export interface EmployeeTaxObjectFormProperties { - } - export function CreateEmployeeTaxObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeTax { - - /** The Starter type. */ - starterType?: string | null; - - /** Starter declaration. */ - starterDeclaration?: string | null; - - /** The Tax code. */ - taxCode?: string | null; - - /** Describes whether the tax settings is W1M1 */ - w1M1?: boolean | null; - - /** - * The previous taxable pay - * Type: double - */ - previousTaxablePay?: number | null; - - /** - * The tax amount previously paid - * Type: double - */ - previousTaxPaid?: number | null; - - /** The employee's student loan deduction type */ - studentLoanDeduction?: string | null; - - /** Describes whether the employee has post graduate loans */ - hasPostGraduateLoans?: boolean | null; - - /** Describes whether the employee is director */ - isDirector?: boolean | null; - - /** - * The directorship start date - * Type: DateOnly - */ - directorshipStartDate?: Date | null; - - /** NICs calculation method */ - nicCalculationMethod?: string | null; - } - export interface EmployeeTaxFormProperties { - - /** The Starter type. */ - starterType: FormControl, - - /** Starter declaration. */ - starterDeclaration: FormControl, - - /** The Tax code. */ - taxCode: FormControl, - - /** Describes whether the tax settings is W1M1 */ - w1M1: FormControl, - - /** - * The previous taxable pay - * Type: double - */ - previousTaxablePay: FormControl, - - /** - * The tax amount previously paid - * Type: double - */ - previousTaxPaid: FormControl, - - /** The employee's student loan deduction type */ - studentLoanDeduction: FormControl, - - /** Describes whether the employee has post graduate loans */ - hasPostGraduateLoans: FormControl, - - /** Describes whether the employee is director */ - isDirector: FormControl, - - /** - * The directorship start date - * Type: DateOnly - */ - directorshipStartDate: FormControl, - - /** NICs calculation method */ - nicCalculationMethod: FormControl, - } - export function CreateEmployeeTaxFormGroup() { - return new FormGroup({ - starterType: new FormControl(undefined), - starterDeclaration: new FormControl(undefined), - taxCode: new FormControl(undefined), - w1M1: new FormControl(undefined), - previousTaxablePay: new FormControl(undefined), - previousTaxPaid: new FormControl(undefined), - studentLoanDeduction: new FormControl(undefined), - hasPostGraduateLoans: new FormControl(undefined), - isDirector: new FormControl(undefined), - directorshipStartDate: new FormControl(undefined), - nicCalculationMethod: new FormControl(undefined), - }); - - } - - export interface EmployeeOpeningBalancesObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - openingBalances?: EmployeeOpeningBalances; - } - export interface EmployeeOpeningBalancesObjectFormProperties { - } - export function CreateEmployeeOpeningBalancesObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeOpeningBalances { - - /** - * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryAdoptionPay?: number | null; - - /** - * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryMaternityPay?: number | null; - - /** - * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryPaternityPay?: number | null; - - /** - * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutorySharedParentalPay?: number | null; - - /** - * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutorySickPay?: number | null; - - /** - * The unique employee number issued by the employee's former employer - * Type: double - */ - priorEmployeeNumber?: number | null; - } - export interface EmployeeOpeningBalancesFormProperties { - - /** - * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryAdoptionPay: FormControl, - - /** - * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryMaternityPay: FormControl, - - /** - * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryPaternityPay: FormControl, - - /** - * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutorySharedParentalPay: FormControl, - - /** - * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutorySickPay: FormControl, - - /** - * The unique employee number issued by the employee's former employer - * Type: double - */ - priorEmployeeNumber: FormControl, - } - export function CreateEmployeeOpeningBalancesFormGroup() { - return new FormGroup({ - statutoryAdoptionPay: new FormControl(undefined), - statutoryMaternityPay: new FormControl(undefined), - statutoryPaternityPay: new FormControl(undefined), - statutorySharedParentalPay: new FormControl(undefined), - statutorySickPay: new FormControl(undefined), - priorEmployeeNumber: new FormControl(undefined), - }); - - } - - export interface EmployeeLeaves { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leave?: Array; - } - export interface EmployeeLeavesFormProperties { - } - export function CreateEmployeeLeavesFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeLeave { - - /** The Xero identifier for LeaveType */ - leaveID?: string | null; - - /** - * The Xero identifier for LeaveType - * Required - */ - leaveTypeID: string; - - /** - * The description of the leave (max length = 50) - * Required - */ - description: string; - - /** - * Start date of the leave (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - startDate: Date; - - /** - * End date of the leave (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - endDate: Date; - - /** The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. */ - periods?: Array; - - /** UTC timestamp of last update to the leave type note */ - updatedDateUTC?: Date | null; - } - export interface EmployeeLeaveFormProperties { - - /** The Xero identifier for LeaveType */ - leaveID: FormControl, - - /** - * The Xero identifier for LeaveType - * Required - */ - leaveTypeID: FormControl, - - /** - * The description of the leave (max length = 50) - * Required - */ - description: FormControl, - - /** - * Start date of the leave (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - startDate: FormControl, - - /** - * End date of the leave (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - endDate: FormControl, - - /** UTC timestamp of last update to the leave type note */ - updatedDateUTC: FormControl, - } - export function CreateEmployeeLeaveFormGroup() { - return new FormGroup({ - leaveID: new FormControl(undefined), - leaveTypeID: new FormControl(undefined, [Validators.required]), - description: new FormControl(undefined, [Validators.required]), - startDate: CreateDateOnlyFormControl(), - endDate: CreateDateOnlyFormControl(), - updatedDateUTC: new FormControl(undefined), - }); - - } - - export interface LeavePeriod { - - /** - * The Pay Period Start Date (YYYY-MM-DD) - * Type: DateOnly - */ - periodStartDate?: Date | null; - - /** - * The Pay Period End Date (YYYY-MM-DD) - * Type: DateOnly - */ - periodEndDate?: Date | null; - - /** - * The Number of Units for the leave - * Type: double - */ - numberOfUnits?: number | null; - - /** Period Status */ - periodStatus?: LeavePeriodPeriodStatus | null; - } - export interface LeavePeriodFormProperties { - - /** - * The Pay Period Start Date (YYYY-MM-DD) - * Type: DateOnly - */ - periodStartDate: FormControl, - - /** - * The Pay Period End Date (YYYY-MM-DD) - * Type: DateOnly - */ - periodEndDate: FormControl, - - /** - * The Number of Units for the leave - * Type: double - */ - numberOfUnits: FormControl, - - /** Period Status */ - periodStatus: FormControl, - } - export function CreateLeavePeriodFormGroup() { - return new FormGroup({ - periodStartDate: new FormControl(undefined), - periodEndDate: new FormControl(undefined), - numberOfUnits: new FormControl(undefined), - periodStatus: new FormControl(undefined), - }); - - } - - export enum LeavePeriodPeriodStatus { Approved = 0, Completed = 1 } - - export interface EmployeeLeaveObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leave?: EmployeeLeave; - } - export interface EmployeeLeaveObjectFormProperties { - } - export function CreateEmployeeLeaveObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface LeavePeriods { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - periods?: Array; - } - export interface LeavePeriodsFormProperties { - } - export function CreateLeavePeriodsFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeLeaveBalances { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveBalances?: Array; - } - export interface EmployeeLeaveBalancesFormProperties { - } - export function CreateEmployeeLeaveBalancesFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeLeaveBalance { - - /** Name of the leave type. */ - name?: string | null; - - /** The Xero identifier for leave type */ - leaveTypeID?: string | null; - - /** - * The employees current balance for the corresponding leave type. - * Type: double - */ - balance?: number | null; - - /** The type of the units of the leave. */ - typeOfUnits?: string | null; - } - export interface EmployeeLeaveBalanceFormProperties { - - /** Name of the leave type. */ - name: FormControl, - - /** The Xero identifier for leave type */ - leaveTypeID: FormControl, - - /** - * The employees current balance for the corresponding leave type. - * Type: double - */ - balance: FormControl, - - /** The type of the units of the leave. */ - typeOfUnits: FormControl, - } - export function CreateEmployeeLeaveBalanceFormGroup() { - return new FormGroup({ - name: new FormControl(undefined), - leaveTypeID: new FormControl(undefined), - balance: new FormControl(undefined), - typeOfUnits: new FormControl(undefined), - }); - - } - - export interface EmployeeStatutoryLeaveBalanceObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveBalance?: EmployeeStatutoryLeaveBalance; - } - export interface EmployeeStatutoryLeaveBalanceObjectFormProperties { - } - export function CreateEmployeeStatutoryLeaveBalanceObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeStatutoryLeaveBalance { - - /** The type of statutory leave */ - leaveType?: EmployeeStatutoryLeaveBalanceLeaveType | null; - - /** - * The balance remaining for the corresponding leave type as of specified date. - * Type: double - */ - balanceRemaining?: number | null; - - /** The units will be "Hours" */ - units?: EmployeeStatutoryLeaveBalanceUnits | null; - } - export interface EmployeeStatutoryLeaveBalanceFormProperties { - - /** The type of statutory leave */ - leaveType: FormControl, - - /** - * The balance remaining for the corresponding leave type as of specified date. - * Type: double - */ - balanceRemaining: FormControl, - - /** The units will be "Hours" */ - units: FormControl, - } - export function CreateEmployeeStatutoryLeaveBalanceFormGroup() { - return new FormGroup({ - leaveType: new FormControl(undefined), - balanceRemaining: new FormControl(undefined), - units: new FormControl(undefined), - }); - - } - - export enum EmployeeStatutoryLeaveBalanceLeaveType { Sick = 0, Adoption = 1, Maternity = 2, Paternity = 3, Sharedparental = 4 } - - export enum EmployeeStatutoryLeaveBalanceUnits { Hours = 0 } - - export interface EmployeeStatutoryLeavesSummaries { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutoryLeaves?: Array; - } - export interface EmployeeStatutoryLeavesSummariesFormProperties { - } - export function CreateEmployeeStatutoryLeavesSummariesFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeStatutoryLeaveSummary { - - /** The unique identifier (guid) of a statutory leave. */ - statutoryLeaveID?: string | null; - - /** The unique identifier (guid) of the employee */ - employeeID?: string | null; - - /** The category of statutory leave */ - type?: EmployeeStatutoryLeaveBalanceLeaveType | null; - - /** - * The date when the leave starts - * Type: DateOnly - */ - startDate?: Date | null; - - /** - * The date when the leave ends - * Type: DateOnly - */ - endDate?: Date | null; - - /** Whether the leave was entitled to receive payment */ - isEntitled?: boolean | null; - - /** The status of the leave */ - status?: EmployeeStatutoryLeaveSummaryStatus | null; - } - export interface EmployeeStatutoryLeaveSummaryFormProperties { - - /** The unique identifier (guid) of a statutory leave. */ - statutoryLeaveID: FormControl, - - /** The unique identifier (guid) of the employee */ - employeeID: FormControl, - - /** The category of statutory leave */ - type: FormControl, - - /** - * The date when the leave starts - * Type: DateOnly - */ - startDate: FormControl, - - /** - * The date when the leave ends - * Type: DateOnly - */ - endDate: FormControl, - - /** Whether the leave was entitled to receive payment */ - isEntitled: FormControl, - - /** The status of the leave */ - status: FormControl, - } - export function CreateEmployeeStatutoryLeaveSummaryFormGroup() { - return new FormGroup({ - statutoryLeaveID: new FormControl(undefined), - employeeID: new FormControl(undefined), - type: new FormControl(undefined), - startDate: new FormControl(undefined), - endDate: new FormControl(undefined), - isEntitled: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export enum EmployeeStatutoryLeaveSummaryStatus { Pending = 0, 'In-Progress' = 1, Completed = 2 } - - export interface EmployeeStatutorySickLeaves { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutorySickLeave?: Array; - } - export interface EmployeeStatutorySickLeavesFormProperties { - } - export function CreateEmployeeStatutorySickLeavesFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeStatutorySickLeave { - - /** The unique identifier (guid) of a statutory leave */ - statutoryLeaveID?: string | null; - - /** - * The unique identifier (guid) of the employee - * Required - */ - employeeID: string; - - /** - * The unique identifier (guid) of the "Statutory Sick Leave (non-pensionable)" pay item - * Required - */ - leaveTypeID: string; - - /** - * The date when the leave starts - * Required - * Type: DateOnly - */ - startDate: Date; - - /** - * The date when the leave ends - * Required - * Type: DateOnly - */ - endDate: Date; - - /** the type of statutory leave */ - type?: string | null; - - /** the type of statutory leave */ - status?: string | null; - - /** - * The days of the work week the employee is scheduled to work at the time the leave is taken - * Required - */ - workPattern: Array; - - /** - * Whether the sick leave was pregnancy related - * Required - */ - isPregnancyRelated: boolean; - - /** - * Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request - * Required - */ - sufficientNotice: boolean; - - /** Whether the leave was entitled to receive payment */ - isEntitled?: boolean | null; - - /** - * The amount of requested time (in weeks) - * Type: double - */ - entitlementWeeksRequested?: number | null; - - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested - * Type: double - */ - entitlementWeeksQualified?: number | null; - - /** - * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * Type: double - */ - entitlementWeeksRemaining?: number | null; - - /** Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts */ - overlapsWithOtherLeave?: boolean | null; - - /** If the leave requested was considered "not entitled", the reasons why are listed here. */ - entitlementFailureReasons?: Array; - } - export interface EmployeeStatutorySickLeaveFormProperties { - - /** The unique identifier (guid) of a statutory leave */ - statutoryLeaveID: FormControl, - - /** - * The unique identifier (guid) of the employee - * Required - */ - employeeID: FormControl, - - /** - * The unique identifier (guid) of the "Statutory Sick Leave (non-pensionable)" pay item - * Required - */ - leaveTypeID: FormControl, - - /** - * The date when the leave starts - * Required - * Type: DateOnly - */ - startDate: FormControl, - - /** - * The date when the leave ends - * Required - * Type: DateOnly - */ - endDate: FormControl, - - /** the type of statutory leave */ - type: FormControl, - - /** the type of statutory leave */ - status: FormControl, - - /** - * Whether the sick leave was pregnancy related - * Required - */ - isPregnancyRelated: FormControl, - - /** - * Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request - * Required - */ - sufficientNotice: FormControl, - - /** Whether the leave was entitled to receive payment */ - isEntitled: FormControl, - - /** - * The amount of requested time (in weeks) - * Type: double - */ - entitlementWeeksRequested: FormControl, - - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested - * Type: double - */ - entitlementWeeksQualified: FormControl, - - /** - * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * Type: double - */ - entitlementWeeksRemaining: FormControl, - - /** Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts */ - overlapsWithOtherLeave: FormControl, - } - export function CreateEmployeeStatutorySickLeaveFormGroup() { - return new FormGroup({ - statutoryLeaveID: new FormControl(undefined), - employeeID: new FormControl(undefined, [Validators.required]), - leaveTypeID: new FormControl(undefined, [Validators.required]), - startDate: CreateDateOnlyFormControl(), - endDate: CreateDateOnlyFormControl(), - type: new FormControl(undefined), - status: new FormControl(undefined), - isPregnancyRelated: new FormControl(undefined, [Validators.required]), - sufficientNotice: new FormControl(undefined, [Validators.required]), - isEntitled: new FormControl(undefined), - entitlementWeeksRequested: new FormControl(undefined), - entitlementWeeksQualified: new FormControl(undefined), - entitlementWeeksRemaining: new FormControl(undefined), - overlapsWithOtherLeave: new FormControl(undefined), - }); - - } - - export interface EmployeeStatutorySickLeaveObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutorySickLeave?: EmployeeStatutorySickLeave; - } - export interface EmployeeStatutorySickLeaveObjectFormProperties { - } - export function CreateEmployeeStatutorySickLeaveObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeLeaveTypes { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveTypes?: Array; - } - export interface EmployeeLeaveTypesFormProperties { - } - export function CreateEmployeeLeaveTypesFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeeLeaveType { - - /** - * The Xero identifier for leave type - * Required - */ - leaveTypeID: string; - - /** - * The schedule of accrual - * Required - */ - scheduleOfAccrual: EmployeeLeaveTypeScheduleOfAccrual; - - /** - * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is "OnHourWorked" - * Type: double - */ - hoursAccruedAnnually?: number | null; - - /** - * The maximum number of hours that can be accrued for the leave - * Type: double - */ - maximumToAccrue?: number | null; - - /** - * The initial number of hours assigned when the leave was added to the employee - * Type: double - */ - openingBalance?: number | null; - - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is "OnHourWorked" - * Type: double - */ - rateAccruedHourly?: number | null; - } - export interface EmployeeLeaveTypeFormProperties { - - /** - * The Xero identifier for leave type - * Required - */ - leaveTypeID: FormControl, - - /** - * The schedule of accrual - * Required - */ - scheduleOfAccrual: FormControl, - - /** - * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is "OnHourWorked" - * Type: double - */ - hoursAccruedAnnually: FormControl, - - /** - * The maximum number of hours that can be accrued for the leave - * Type: double - */ - maximumToAccrue: FormControl, - - /** - * The initial number of hours assigned when the leave was added to the employee - * Type: double - */ - openingBalance: FormControl, - - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is "OnHourWorked" - * Type: double - */ - rateAccruedHourly: FormControl, - } - export function CreateEmployeeLeaveTypeFormGroup() { - return new FormGroup({ - leaveTypeID: new FormControl(undefined, [Validators.required]), - scheduleOfAccrual: new FormControl(undefined, [Validators.required]), - hoursAccruedAnnually: new FormControl(undefined), - maximumToAccrue: new FormControl(undefined), - openingBalance: new FormControl(undefined), - rateAccruedHourly: new FormControl(undefined), - }); - - } - - export enum EmployeeLeaveTypeScheduleOfAccrual { BeginningOfCalendarYear = 0, OnAnniversaryDate = 1, EachPayPeriod = 2, OnHourWorked = 3 } - - export interface EmployeeLeaveTypeObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveType?: EmployeeLeaveType; - } - export interface EmployeeLeaveTypeObjectFormProperties { - } - export function CreateEmployeeLeaveTypeObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeePayTemplateObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payTemplate?: EmployeePayTemplate; - } - export interface EmployeePayTemplateObjectFormProperties { - } - export function CreateEmployeePayTemplateObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EmployeePayTemplate { - - /** Unique identifier for the employee */ - employeeID?: string | null; - earningTemplates?: Array; - } - export interface EmployeePayTemplateFormProperties { - - /** Unique identifier for the employee */ - employeeID: FormControl, - } - export function CreateEmployeePayTemplateFormGroup() { - return new FormGroup({ - employeeID: new FormControl(undefined), - }); - - } - - export interface EarningsTemplate { - - /** The Xero identifier for the earnings template */ - payTemplateEarningID?: string | null; - - /** - * The rate per unit - * Type: double - */ - ratePerUnit?: number | null; - - /** - * The rate per unit - * Type: double - */ - numberOfUnits?: number | null; - - /** - * The fixed amount per period - * Type: double - */ - fixedAmount?: number | null; - - /** The corresponding earnings rate identifier */ - earningsRateID?: string | null; - - /** The read-only name of the Earning Template. */ - name?: string | null; - } - export interface EarningsTemplateFormProperties { - - /** The Xero identifier for the earnings template */ - payTemplateEarningID: FormControl, - - /** - * The rate per unit - * Type: double - */ - ratePerUnit: FormControl, - - /** - * The rate per unit - * Type: double - */ - numberOfUnits: FormControl, - - /** - * The fixed amount per period - * Type: double - */ - fixedAmount: FormControl, - - /** The corresponding earnings rate identifier */ - earningsRateID: FormControl, - - /** The read-only name of the Earning Template. */ - name: FormControl, - } - export function CreateEarningsTemplateFormGroup() { - return new FormGroup({ - payTemplateEarningID: new FormControl(undefined), - ratePerUnit: new FormControl(undefined), - numberOfUnits: new FormControl(undefined), - fixedAmount: new FormControl(undefined), - earningsRateID: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - export interface EmployeePayTemplates { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningTemplates?: Array; - } - export interface EmployeePayTemplatesFormProperties { - } - export function CreateEmployeePayTemplatesFormGroup() { - return new FormGroup({ - }); - - } - - export interface EarningsTemplateObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningTemplate?: EarningsTemplate; - } - export interface EarningsTemplateObjectFormProperties { - } - export function CreateEarningsTemplateObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Benefits { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - benefits?: Array; - } - export interface BenefitsFormProperties { - } - export function CreateBenefitsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Benefit { - - /** unique identifier in Xero */ - id?: string | null; - - /** - * Name of the employer pension - * Required - */ - name: string; - - /** - * Category type of the employer pension - * Required - */ - category: BenefitCategory; - - /** - * Xero identifier for Liability Account - * Required - */ - liabilityAccountId: string; - - /** - * Xero identifier for Expense Account - * Required - */ - expenseAccountId: string; - - /** - * Standard amount of the employer pension - * Required - * Type: double - */ - standardAmount: number; - - /** - * Percentage of gross of the employer pension - * Required - * Type: double - */ - percentage: number; - - /** - * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). - * Required - */ - calculationType: BenefitCalculationType; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - - /** Identifier of subject To NIC */ - subjectToNIC?: boolean | null; - - /** Identifier of subject To pension */ - subjectToPension?: boolean | null; - - /** Identifier of subject To Tax */ - subjectToTax?: boolean | null; - - /** Identifier of calculating on qualifying earnings */ - isCalculatingOnQualifyingEarnings?: boolean | null; - - /** display the balance to employee */ - showBalanceToEmployee?: boolean | null; - } - export interface BenefitFormProperties { - - /** unique identifier in Xero */ - id: FormControl, - - /** - * Name of the employer pension - * Required - */ - name: FormControl, - - /** - * Category type of the employer pension - * Required - */ - category: FormControl, - - /** - * Xero identifier for Liability Account - * Required - */ - liabilityAccountId: FormControl, - - /** - * Xero identifier for Expense Account - * Required - */ - expenseAccountId: FormControl, - - /** - * Standard amount of the employer pension - * Required - * Type: double - */ - standardAmount: FormControl, - - /** - * Percentage of gross of the employer pension - * Required - * Type: double - */ - percentage: FormControl, - - /** - * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). - * Required - */ - calculationType: FormControl, - - /** Identifier of a record is active or not. */ - currentRecord: FormControl, - - /** Identifier of subject To NIC */ - subjectToNIC: FormControl, - - /** Identifier of subject To pension */ - subjectToPension: FormControl, - - /** Identifier of subject To Tax */ - subjectToTax: FormControl, - - /** Identifier of calculating on qualifying earnings */ - isCalculatingOnQualifyingEarnings: FormControl, - - /** display the balance to employee */ - showBalanceToEmployee: FormControl, - } - export function CreateBenefitFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - category: new FormControl(undefined, [Validators.required]), - liabilityAccountId: new FormControl(undefined, [Validators.required]), - expenseAccountId: new FormControl(undefined, [Validators.required]), - standardAmount: new FormControl(undefined, [Validators.required]), - percentage: new FormControl(undefined, [Validators.required]), - calculationType: new FormControl(undefined, [Validators.required]), - currentRecord: new FormControl(undefined), - subjectToNIC: new FormControl(undefined), - subjectToPension: new FormControl(undefined), - subjectToTax: new FormControl(undefined), - isCalculatingOnQualifyingEarnings: new FormControl(undefined), - showBalanceToEmployee: new FormControl(undefined), - }); - - } - - export enum BenefitCategory { StakeholderPension = 0, Other = 1 } - - export enum BenefitCalculationType { FixedAmount = 0, PercentageOfGross = 1 } - - export interface BenefitObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - benefit?: Benefit; - } - export interface BenefitObjectFormProperties { - } - export function CreateBenefitObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Deductions { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - deductions?: Array; - } - export interface DeductionsFormProperties { - } - export function CreateDeductionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Deduction { - - /** The Xero identifier for Deduction */ - deductionId?: string | null; - - /** - * Name of the deduction - * Required - */ - deductionName: string; - - /** - * Deduction Category type - * Required - */ - deductionCategory: DeductionDeductionCategory; - - /** - * Xero identifier for Liability Account - * Required - */ - liabilityAccountId: string; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - - /** - * Standard amount of the deduction - * Type: double - */ - standardAmount?: number | null; - - /** Identifier of reduces super liability */ - reducesSuperLiability?: boolean | null; - - /** Identifier of reduces tax liability */ - reducesTaxLiability?: boolean | null; - - /** - * determine the calculation type whether fixed amount or percentage of gross - * Required - */ - calculationType: BenefitCalculationType; - - /** - * Percentage of gross - * Type: double - */ - percentage?: number | null; - - /** Identifier of subject To NIC */ - subjectToNIC?: boolean | null; - - /** Identifier of subject To Tax */ - subjectToTax?: boolean | null; - - /** Identifier of reduced by basic rate applicable or not */ - isReducedByBasicRate?: boolean | null; - - /** Identifier for apply to pension calculations */ - applyToPensionCalculations?: boolean | null; - - /** Identifier of calculating on qualifying earnings */ - isCalculatingOnQualifyingEarnings?: boolean | null; - - /** Identifier of applicable for pension or not */ - isPension?: boolean | null; - } - export interface DeductionFormProperties { - - /** The Xero identifier for Deduction */ - deductionId: FormControl, - - /** - * Name of the deduction - * Required - */ - deductionName: FormControl, - - /** - * Deduction Category type - * Required - */ - deductionCategory: FormControl, - - /** - * Xero identifier for Liability Account - * Required - */ - liabilityAccountId: FormControl, - - /** Identifier of a record is active or not. */ - currentRecord: FormControl, - - /** - * Standard amount of the deduction - * Type: double - */ - standardAmount: FormControl, - - /** Identifier of reduces super liability */ - reducesSuperLiability: FormControl, - - /** Identifier of reduces tax liability */ - reducesTaxLiability: FormControl, - - /** - * determine the calculation type whether fixed amount or percentage of gross - * Required - */ - calculationType: FormControl, - - /** - * Percentage of gross - * Type: double - */ - percentage: FormControl, - - /** Identifier of subject To NIC */ - subjectToNIC: FormControl, - - /** Identifier of subject To Tax */ - subjectToTax: FormControl, - - /** Identifier of reduced by basic rate applicable or not */ - isReducedByBasicRate: FormControl, - - /** Identifier for apply to pension calculations */ - applyToPensionCalculations: FormControl, - - /** Identifier of calculating on qualifying earnings */ - isCalculatingOnQualifyingEarnings: FormControl, - - /** Identifier of applicable for pension or not */ - isPension: FormControl, - } - export function CreateDeductionFormGroup() { - return new FormGroup({ - deductionId: new FormControl(undefined), - deductionName: new FormControl(undefined, [Validators.required]), - deductionCategory: new FormControl(undefined, [Validators.required]), - liabilityAccountId: new FormControl(undefined, [Validators.required]), - currentRecord: new FormControl(undefined), - standardAmount: new FormControl(undefined), - reducesSuperLiability: new FormControl(undefined), - reducesTaxLiability: new FormControl(undefined), - calculationType: new FormControl(undefined, [Validators.required]), - percentage: new FormControl(undefined), - subjectToNIC: new FormControl(undefined), - subjectToTax: new FormControl(undefined), - isReducedByBasicRate: new FormControl(undefined), - applyToPensionCalculations: new FormControl(undefined), - isCalculatingOnQualifyingEarnings: new FormControl(undefined), - isPension: new FormControl(undefined), - }); - - } - - export enum DeductionDeductionCategory { StakeholderPension = 0, StakeholderPensionPostTax = 1, ChildCareVoucher = 2, SalarySacrifice = 3, UkOther = 4 } - - export interface DeductionObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - deduction?: Deduction; - } - export interface DeductionObjectFormProperties { - } - export function CreateDeductionObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface StatutoryDeduction { - - /** The Xero identifier for earnings order */ - id?: string | null; - - /** Name of the earnings order */ - name?: string | null; - - /** Statutory Deduction Category */ - statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; - - /** Xero identifier for Liability Account */ - liabilityAccountId?: string | null; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - } - export interface StatutoryDeductionFormProperties { - - /** The Xero identifier for earnings order */ - id: FormControl, - - /** Name of the earnings order */ - name: FormControl, - - /** Statutory Deduction Category */ - statutoryDeductionCategory: FormControl, - - /** Xero identifier for Liability Account */ - liabilityAccountId: FormControl, - - /** Identifier of a record is active or not. */ - currentRecord: FormControl, - } - export function CreateStatutoryDeductionFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined), - statutoryDeductionCategory: new FormControl(undefined), - liabilityAccountId: new FormControl(undefined), - currentRecord: new FormControl(undefined), - }); - - } - - export enum StatutoryDeductionStatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } - - - /** Statutory Deduction Category */ - export enum StatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } - - export interface EarningsOrders { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutoryDeductions?: Array; - } - export interface EarningsOrdersFormProperties { - } - export function CreateEarningsOrdersFormGroup() { - return new FormGroup({ - }); - - } - - export interface EarningsOrder { - - /** Xero unique identifier for an earning rate */ - id?: string | null; - - /** - * Name of the earning order - * Required - */ - name: string; - - /** Statutory Deduction Category */ - statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; - - /** Xero identifier for Liability Account */ - liabilityAccountId?: string | null; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - } - export interface EarningsOrderFormProperties { - - /** Xero unique identifier for an earning rate */ - id: FormControl, - - /** - * Name of the earning order - * Required - */ - name: FormControl, - - /** Statutory Deduction Category */ - statutoryDeductionCategory: FormControl, - - /** Xero identifier for Liability Account */ - liabilityAccountId: FormControl, - - /** Identifier of a record is active or not. */ - currentRecord: FormControl, - } - export function CreateEarningsOrderFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - statutoryDeductionCategory: new FormControl(undefined), - liabilityAccountId: new FormControl(undefined), - currentRecord: new FormControl(undefined), - }); - - } - - export interface EarningsOrderObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutoryDeduction?: EarningsOrder; - } - export interface EarningsOrderObjectFormProperties { - } - export function CreateEarningsOrderObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface EarningsRates { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningsRates?: Array; - } - export interface EarningsRatesFormProperties { - } - export function CreateEarningsRatesFormGroup() { - return new FormGroup({ - }); - - } - - export interface EarningsRate { - - /** Xero unique identifier for an earning rate */ - earningsRateID?: string | null; - - /** - * Name of the earning rate - * Required - */ - name: string; - - /** - * Indicates how an employee will be paid when taking this type of earning - * Required - */ - earningsType: EarningsRateEarningsType; - - /** - * Indicates the type of the earning rate - * Required - */ - rateType: EarningsRateRateType; - - /** - * The type of units used to record earnings - * Required - */ - typeOfUnits: string; - - /** Indicates whether an earning type is active */ - currentRecord?: boolean | null; - - /** - * The account that will be used for the earnings rate - * Required - */ - expenseAccountID: string; - - /** - * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * Type: double - */ - ratePerUnit?: number | null; - - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate - * Type: double - */ - multipleOfOrdinaryEarningsRate?: number | null; - - /** - * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * Type: double - */ - fixedAmount?: number | null; - } - export interface EarningsRateFormProperties { - - /** Xero unique identifier for an earning rate */ - earningsRateID: FormControl, - - /** - * Name of the earning rate - * Required - */ - name: FormControl, - - /** - * Indicates how an employee will be paid when taking this type of earning - * Required - */ - earningsType: FormControl, - - /** - * Indicates the type of the earning rate - * Required - */ - rateType: FormControl, - - /** - * The type of units used to record earnings - * Required - */ - typeOfUnits: FormControl, - - /** Indicates whether an earning type is active */ - currentRecord: FormControl, - - /** - * The account that will be used for the earnings rate - * Required - */ - expenseAccountID: FormControl, - - /** - * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * Type: double - */ - ratePerUnit: FormControl, - - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate - * Type: double - */ - multipleOfOrdinaryEarningsRate: FormControl, - - /** - * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * Type: double - */ - fixedAmount: FormControl, - } - export function CreateEarningsRateFormGroup() { - return new FormGroup({ - earningsRateID: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - earningsType: new FormControl(undefined, [Validators.required]), - rateType: new FormControl(undefined, [Validators.required]), - typeOfUnits: new FormControl(undefined, [Validators.required]), - currentRecord: new FormControl(undefined), - expenseAccountID: new FormControl(undefined, [Validators.required]), - ratePerUnit: new FormControl(undefined), - multipleOfOrdinaryEarningsRate: new FormControl(undefined), - fixedAmount: new FormControl(undefined), - }); - - } - - export enum EarningsRateEarningsType { OvertimeEarnings = 0, Allowance = 1, RegularEarnings = 2, Commission = 3, Bonus = 4, 'Tips(Direct)' = 5, 'Tips(Non-Direct)' = 6, Backpay = 7, OtherEarnings = 8, LumpSum = 9 } - - export enum EarningsRateRateType { RatePerUnit = 0, MultipleOfOrdinaryEarningsRate = 1, FixedAmount = 2 } - - export interface EarningsRateObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningsRate?: EarningsRate; - } - export interface EarningsRateObjectFormProperties { - } - export function CreateEarningsRateObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface LeaveTypes { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveTypes?: Array; - } - export interface LeaveTypesFormProperties { - } - export function CreateLeaveTypesFormGroup() { - return new FormGroup({ - }); - - } - - export interface LeaveType { - - /** Xero unique identifier for the leave */ - leaveID?: string | null; - - /** Xero unique identifier for the leave type */ - leaveTypeID?: string | null; - - /** - * Name of the leave type - * Required - */ - name: string; - - /** - * Indicate that an employee will be paid when taking this type of leave - * Required - */ - isPaidLeave: boolean; - - /** - * Indicate that a balance for this leave type to be shown on the employee’s payslips - * Required - */ - showOnPayslip: boolean; - - /** UTC timestamp of last update to the leave type note */ - updatedDateUTC?: Date | null; - - /** Shows whether the leave type is active or not */ - isActive?: boolean | null; - - /** Shows whether the leave type is a statutory leave type or not */ - isStatutoryLeave?: boolean | null; - } - export interface LeaveTypeFormProperties { - - /** Xero unique identifier for the leave */ - leaveID: FormControl, - - /** Xero unique identifier for the leave type */ - leaveTypeID: FormControl, - - /** - * Name of the leave type - * Required - */ - name: FormControl, - - /** - * Indicate that an employee will be paid when taking this type of leave - * Required - */ - isPaidLeave: FormControl, - - /** - * Indicate that a balance for this leave type to be shown on the employee’s payslips - * Required - */ - showOnPayslip: FormControl, - - /** UTC timestamp of last update to the leave type note */ - updatedDateUTC: FormControl, - - /** Shows whether the leave type is active or not */ - isActive: FormControl, - - /** Shows whether the leave type is a statutory leave type or not */ - isStatutoryLeave: FormControl, - } - export function CreateLeaveTypeFormGroup() { - return new FormGroup({ - leaveID: new FormControl(undefined), - leaveTypeID: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - isPaidLeave: new FormControl(undefined, [Validators.required]), - showOnPayslip: new FormControl(undefined, [Validators.required]), - updatedDateUTC: new FormControl(undefined), - isActive: new FormControl(undefined), - isStatutoryLeave: new FormControl(undefined), - }); - - } - - export interface LeaveTypeObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveType?: LeaveType; - } - export interface LeaveTypeObjectFormProperties { - } - export function CreateLeaveTypeObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Reimbursements { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - reimbursements?: Array; - } - export interface ReimbursementsFormProperties { - } - export function CreateReimbursementsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Reimbursement { - - /** Xero unique identifier for a reimbursement */ - reimbursementID?: string | null; - - /** - * Name of the reimbursement - * Required - */ - name: string; - - /** - * Xero unique identifier for the account used for the reimbursement - * Required - */ - accountID: string; - - /** Indicates that whether the reimbursement is active */ - currentRecord?: boolean | null; - } - export interface ReimbursementFormProperties { - - /** Xero unique identifier for a reimbursement */ - reimbursementID: FormControl, - - /** - * Name of the reimbursement - * Required - */ - name: FormControl, - - /** - * Xero unique identifier for the account used for the reimbursement - * Required - */ - accountID: FormControl, - - /** Indicates that whether the reimbursement is active */ - currentRecord: FormControl, - } - export function CreateReimbursementFormGroup() { - return new FormGroup({ - reimbursementID: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - accountID: new FormControl(undefined, [Validators.required]), - currentRecord: new FormControl(undefined), - }); - - } - - export interface ReimbursementObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - reimbursement?: Reimbursement; - } - export interface ReimbursementObjectFormProperties { - } - export function CreateReimbursementObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Timesheets { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - timesheets?: Array; - } - export interface TimesheetsFormProperties { - } - export function CreateTimesheetsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Timesheet { - - /** The Xero identifier for a Timesheet */ - timesheetID?: string | null; - - /** - * The Xero identifier for the Payroll Calandar that the Timesheet applies to - * Required - */ - payrollCalendarID: string; - - /** - * The Xero identifier for the Employee that the Timesheet is for - * Required - */ - employeeID: string; - - /** - * The Start Date of the Timesheet period (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - startDate: Date; - - /** - * The End Date of the Timesheet period (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - endDate: Date; - - /** Status of the timesheet */ - status?: TimesheetStatus | null; - - /** - * The Total Hours of the Timesheet - * Type: double - */ - totalHours?: number | null; - - /** The UTC date time that the Timesheet was last updated */ - updatedDateUTC?: Date | null; - timesheetLines?: Array; - } - export interface TimesheetFormProperties { - - /** The Xero identifier for a Timesheet */ - timesheetID: FormControl, - - /** - * The Xero identifier for the Payroll Calandar that the Timesheet applies to - * Required - */ - payrollCalendarID: FormControl, - - /** - * The Xero identifier for the Employee that the Timesheet is for - * Required - */ - employeeID: FormControl, - - /** - * The Start Date of the Timesheet period (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - startDate: FormControl, - - /** - * The End Date of the Timesheet period (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - endDate: FormControl, - - /** Status of the timesheet */ - status: FormControl, - - /** - * The Total Hours of the Timesheet - * Type: double - */ - totalHours: FormControl, - - /** The UTC date time that the Timesheet was last updated */ - updatedDateUTC: FormControl, - } - export function CreateTimesheetFormGroup() { - return new FormGroup({ - timesheetID: new FormControl(undefined), - payrollCalendarID: new FormControl(undefined, [Validators.required]), - employeeID: new FormControl(undefined, [Validators.required]), - startDate: CreateDateOnlyFormControl(), - endDate: CreateDateOnlyFormControl(), - status: new FormControl(undefined), - totalHours: new FormControl(undefined), - updatedDateUTC: new FormControl(undefined), - }); - - } - - export enum TimesheetStatus { Draft = 0, Approved = 1, Completed = 2 } - - export interface TimesheetLine { - - /** The Xero identifier for a Timesheet Line */ - timesheetLineID?: string | null; - - /** - * The Date that this Timesheet Line is for (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - date: Date; - - /** - * The Xero identifier for the Earnings Rate that the Timesheet is for - * Required - */ - earningsRateID: string; - - /** The Xero identifier for the Tracking Item that the Timesheet is for */ - trackingItemID?: string | null; - - /** - * The Number of Units of the Timesheet Line - * Required - * Type: double - */ - numberOfUnits: number; - } - export interface TimesheetLineFormProperties { - - /** The Xero identifier for a Timesheet Line */ - timesheetLineID: FormControl, - - /** - * The Date that this Timesheet Line is for (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - date: FormControl, - - /** - * The Xero identifier for the Earnings Rate that the Timesheet is for - * Required - */ - earningsRateID: FormControl, - - /** The Xero identifier for the Tracking Item that the Timesheet is for */ - trackingItemID: FormControl, - - /** - * The Number of Units of the Timesheet Line - * Required - * Type: double - */ - numberOfUnits: FormControl, - } - export function CreateTimesheetLineFormGroup() { - return new FormGroup({ - timesheetLineID: new FormControl(undefined), - date: CreateDateOnlyFormControl(), - earningsRateID: new FormControl(undefined, [Validators.required]), - trackingItemID: new FormControl(undefined), - numberOfUnits: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface TimesheetObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - timesheet?: Timesheet; - } - export interface TimesheetObjectFormProperties { - } - export function CreateTimesheetObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface TimesheetLineObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - timesheetLine?: TimesheetLine; - } - export interface TimesheetLineObjectFormProperties { - } - export function CreateTimesheetLineObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayRunCalendars { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRunCalendars?: Array; - } - export interface PayRunCalendarsFormProperties { - } - export function CreatePayRunCalendarsFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayRunCalendar { - - /** Xero unique identifier for the payroll calendar */ - payrollCalendarID?: string | null; - - /** - * Name of the calendar - * Required - */ - name: string; - - /** - * Type of the calendar - * Required - */ - calendarType: PayRunCalendarCalendarType; - - /** - * Period start date of the calendar - * Required - * Type: DateOnly - */ - periodStartDate: Date; - - /** - * Period end date of the calendar - * Type: DateOnly - */ - periodEndDate?: Date | null; - - /** - * Payment date of the calendar - * Required - * Type: DateOnly - */ - paymentDate: Date; - - /** UTC timestamp of the last update to the pay run calendar */ - updatedDateUTC?: Date | null; - } - export interface PayRunCalendarFormProperties { - - /** Xero unique identifier for the payroll calendar */ - payrollCalendarID: FormControl, - - /** - * Name of the calendar - * Required - */ - name: FormControl, - - /** - * Type of the calendar - * Required - */ - calendarType: FormControl, - - /** - * Period start date of the calendar - * Required - * Type: DateOnly - */ - periodStartDate: FormControl, - - /** - * Period end date of the calendar - * Type: DateOnly - */ - periodEndDate: FormControl, - - /** - * Payment date of the calendar - * Required - * Type: DateOnly - */ - paymentDate: FormControl, - - /** UTC timestamp of the last update to the pay run calendar */ - updatedDateUTC: FormControl, - } - export function CreatePayRunCalendarFormGroup() { - return new FormGroup({ - payrollCalendarID: new FormControl(undefined), - name: new FormControl(undefined, [Validators.required]), - calendarType: new FormControl(undefined, [Validators.required]), - periodStartDate: CreateDateOnlyFormControl(), - periodEndDate: new FormControl(undefined), - paymentDate: CreateDateOnlyFormControl(), - updatedDateUTC: new FormControl(undefined), - }); - - } - - export enum PayRunCalendarCalendarType { Weekly = 0, Fortnightly = 1, FourWeekly = 2, Monthly = 3, Annual = 4, Quarterly = 5 } - - export interface PayRunCalendarObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRunCalendar?: PayRunCalendar; - } - export interface PayRunCalendarObjectFormProperties { - } - export function CreatePayRunCalendarObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface PaymentMethodObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - paymentMethod?: PaymentMethod; - } - export interface PaymentMethodObjectFormProperties { - } - export function CreatePaymentMethodObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface PaymentMethod { - - /** - * The payment method code - * Required - */ - paymentMethod: PaymentMethodPaymentMethod; - bankAccounts?: Array; - } - export interface PaymentMethodFormProperties { - - /** - * The payment method code - * Required - */ - paymentMethod: FormControl, - } - export function CreatePaymentMethodFormGroup() { - return new FormGroup({ - paymentMethod: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum PaymentMethodPaymentMethod { Cheque = 0, Electronically = 1, Manual = 2 } - - export interface BankAccount { - - /** - * Bank account name (max length = 32) - * Required - */ - accountName: string; - - /** - * Bank account number (digits only; max length = 8) - * Required - */ - accountNumber: string; - - /** - * Bank account sort code (6 digits) - * Required - */ - sortCode: string; - } - export interface BankAccountFormProperties { - - /** - * Bank account name (max length = 32) - * Required - */ - accountName: FormControl, - - /** - * Bank account number (digits only; max length = 8) - * Required - */ - accountNumber: FormControl, - - /** - * Bank account sort code (6 digits) - * Required - */ - sortCode: FormControl, - } - export function CreateBankAccountFormGroup() { - return new FormGroup({ - accountName: new FormControl(undefined, [Validators.required]), - accountNumber: new FormControl(undefined, [Validators.required]), - sortCode: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface SalaryAndWages { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - salaryAndWages?: Array; - } - export interface SalaryAndWagesFormProperties { - } - export function CreateSalaryAndWagesFormGroup() { - return new FormGroup({ - }); - - } - - export interface SalaryAndWage { - - /** Xero unique identifier for a salary and wages record */ - salaryAndWagesID?: string | null; - - /** - * Xero unique identifier for an earnings rate - * Required - */ - earningsRateID: string; - - /** - * The Number of Units per week for the corresponding salary and wages - * Required - * Type: double - */ - numberOfUnitsPerWeek: number; - - /** - * The rate of each unit for the corresponding salary and wages - * Required - * Type: double - */ - ratePerUnit: number; - - /** - * The Number of Units per day for the corresponding salary and wages - * Required - * Type: double - */ - numberOfUnitsPerDay: number; - - /** - * The effective date of the corresponding salary and wages - * Required - * Type: DateOnly - */ - effectiveFrom: Date; - - /** - * The annual salary - * Required - * Type: double - */ - annualSalary: number; - - /** - * The current status of the corresponding salary and wages - * Required - */ - status: SalaryAndWageStatus; - - /** - * The type of the payment of the corresponding salary and wages - * Required - */ - paymentType: SalaryAndWagePaymentType; - } - export interface SalaryAndWageFormProperties { - - /** Xero unique identifier for a salary and wages record */ - salaryAndWagesID: FormControl, - - /** - * Xero unique identifier for an earnings rate - * Required - */ - earningsRateID: FormControl, - - /** - * The Number of Units per week for the corresponding salary and wages - * Required - * Type: double - */ - numberOfUnitsPerWeek: FormControl, - - /** - * The rate of each unit for the corresponding salary and wages - * Required - * Type: double - */ - ratePerUnit: FormControl, - - /** - * The Number of Units per day for the corresponding salary and wages - * Required - * Type: double - */ - numberOfUnitsPerDay: FormControl, - - /** - * The effective date of the corresponding salary and wages - * Required - * Type: DateOnly - */ - effectiveFrom: FormControl, - - /** - * The annual salary - * Required - * Type: double - */ - annualSalary: FormControl, - - /** - * The current status of the corresponding salary and wages - * Required - */ - status: FormControl, - - /** - * The type of the payment of the corresponding salary and wages - * Required - */ - paymentType: FormControl, - } - export function CreateSalaryAndWageFormGroup() { - return new FormGroup({ - salaryAndWagesID: new FormControl(undefined), - earningsRateID: new FormControl(undefined, [Validators.required]), - numberOfUnitsPerWeek: new FormControl(undefined, [Validators.required]), - ratePerUnit: new FormControl(undefined, [Validators.required]), - numberOfUnitsPerDay: new FormControl(undefined, [Validators.required]), - effectiveFrom: CreateDateOnlyFormControl(), - annualSalary: new FormControl(undefined, [Validators.required]), - status: new FormControl(undefined, [Validators.required]), - paymentType: new FormControl(undefined, [Validators.required]), - }); - - } - - export enum SalaryAndWageStatus { Active = 0, Pending = 1 } - - export enum SalaryAndWagePaymentType { Salary = 0 } - - export interface SalaryAndWageObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - salaryAndWages?: SalaryAndWage; - } - export interface SalaryAndWageObjectFormProperties { - } - export function CreateSalaryAndWageObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayRuns { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRuns?: Array; - } - export interface PayRunsFormProperties { - } - export function CreatePayRunsFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayRun { - - /** Xero unique identifier for the pay run */ - payRunID?: string | null; - - /** Xero unique identifier for the payroll calendar */ - payrollCalendarID?: string | null; - - /** - * Period start date of the payroll calendar - * Type: DateOnly - */ - periodStartDate?: Date | null; - - /** - * Period end date of the payroll calendar - * Type: DateOnly - */ - periodEndDate?: Date | null; - - /** - * Payment date of the pay run - * Type: DateOnly - */ - paymentDate?: Date | null; - - /** - * Total cost of the pay run - * Type: double - */ - totalCost?: number | null; - - /** - * Total pay of the pay run - * Type: double - */ - totalPay?: number | null; - - /** Pay run status */ - payRunStatus?: PayRunPayRunStatus | null; - - /** Pay run type */ - payRunType?: PayRunPayRunType | null; - - /** Calendar type of the pay run */ - calendarType?: PayRunCalendarCalendarType | null; - - /** - * Posted date time of the pay run - * Type: DateOnly - */ - postedDateTime?: Date | null; - paySlips?: Array; - } - export interface PayRunFormProperties { - - /** Xero unique identifier for the pay run */ - payRunID: FormControl, - - /** Xero unique identifier for the payroll calendar */ - payrollCalendarID: FormControl, - - /** - * Period start date of the payroll calendar - * Type: DateOnly - */ - periodStartDate: FormControl, - - /** - * Period end date of the payroll calendar - * Type: DateOnly - */ - periodEndDate: FormControl, - - /** - * Payment date of the pay run - * Type: DateOnly - */ - paymentDate: FormControl, - - /** - * Total cost of the pay run - * Type: double - */ - totalCost: FormControl, - - /** - * Total pay of the pay run - * Type: double - */ - totalPay: FormControl, - - /** Pay run status */ - payRunStatus: FormControl, - - /** Pay run type */ - payRunType: FormControl, - - /** Calendar type of the pay run */ - calendarType: FormControl, - - /** - * Posted date time of the pay run - * Type: DateOnly - */ - postedDateTime: FormControl, - } - export function CreatePayRunFormGroup() { - return new FormGroup({ - payRunID: new FormControl(undefined), - payrollCalendarID: new FormControl(undefined), - periodStartDate: new FormControl(undefined), - periodEndDate: new FormControl(undefined), - paymentDate: new FormControl(undefined), - totalCost: new FormControl(undefined), - totalPay: new FormControl(undefined), - payRunStatus: new FormControl(undefined), - payRunType: new FormControl(undefined), - calendarType: new FormControl(undefined), - postedDateTime: new FormControl(undefined), - }); - - } - - export enum PayRunPayRunStatus { Draft = 0, Posted = 1 } - - export enum PayRunPayRunType { Scheduled = 0, Unscheduled = 1, EarlierYearUpdate = 2 } - - export interface Payslip { - - /** The Xero identifier for a Payslip */ - paySlipID?: string | null; - - /** The Xero identifier for payroll employee */ - employeeID?: string | null; - - /** The Xero identifier for the associated payrun */ - payRunID?: string | null; - - /** - * The date payslip was last updated - * Type: DateOnly - */ - lastEdited?: Date | null; - - /** Employee first name */ - firstName?: string | null; - - /** Employee last name */ - lastName?: string | null; - - /** - * Total earnings before any deductions. Same as gross earnings for UK. - * Type: double - */ - totalEarnings?: number | null; - - /** - * Total earnings before any deductions. Same as total earnings for UK. - * Type: double - */ - grossEarnings?: number | null; - - /** - * The employee net pay - * Type: double - */ - totalPay?: number | null; - - /** - * The employer's tax obligation - * Type: double - */ - totalEmployerTaxes?: number | null; - - /** - * The part of an employee's earnings that is deducted for tax purposes - * Type: double - */ - totalEmployeeTaxes?: number | null; - - /** - * Total amount subtracted from an employee's earnings to reach total pay - * Type: double - */ - totalDeductions?: number | null; - - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment - * Type: double - */ - totalReimbursements?: number | null; - - /** - * Total amounts required by law to subtract from the employee's earnings - * Type: double - */ - totalCourtOrders?: number | null; - - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries - * Type: double - */ - totalBenefits?: number | null; - - /** BACS Service User Number */ - bacsHash?: string | null; - - /** The payment method code */ - paymentMethod?: PaymentMethodPaymentMethod | null; - earningsLines?: Array; - leaveEarningsLines?: Array; - timesheetEarningsLines?: Array; - deductionLines?: Array; - reimbursementLines?: Array; - leaveAccrualLines?: Array; - benefitLines?: Array; - paymentLines?: Array; - employeeTaxLines?: Array; - courtOrderLines?: Array; - } - export interface PayslipFormProperties { - - /** The Xero identifier for a Payslip */ - paySlipID: FormControl, - - /** The Xero identifier for payroll employee */ - employeeID: FormControl, - - /** The Xero identifier for the associated payrun */ - payRunID: FormControl, - - /** - * The date payslip was last updated - * Type: DateOnly - */ - lastEdited: FormControl, - - /** Employee first name */ - firstName: FormControl, - - /** Employee last name */ - lastName: FormControl, - - /** - * Total earnings before any deductions. Same as gross earnings for UK. - * Type: double - */ - totalEarnings: FormControl, - - /** - * Total earnings before any deductions. Same as total earnings for UK. - * Type: double - */ - grossEarnings: FormControl, - - /** - * The employee net pay - * Type: double - */ - totalPay: FormControl, - - /** - * The employer's tax obligation - * Type: double - */ - totalEmployerTaxes: FormControl, - - /** - * The part of an employee's earnings that is deducted for tax purposes - * Type: double - */ - totalEmployeeTaxes: FormControl, - - /** - * Total amount subtracted from an employee's earnings to reach total pay - * Type: double - */ - totalDeductions: FormControl, - - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment - * Type: double - */ - totalReimbursements: FormControl, - - /** - * Total amounts required by law to subtract from the employee's earnings - * Type: double - */ - totalCourtOrders: FormControl, - - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries - * Type: double - */ - totalBenefits: FormControl, - - /** BACS Service User Number */ - bacsHash: FormControl, - - /** The payment method code */ - paymentMethod: FormControl, - } - export function CreatePayslipFormGroup() { - return new FormGroup({ - paySlipID: new FormControl(undefined), - employeeID: new FormControl(undefined), - payRunID: new FormControl(undefined), - lastEdited: new FormControl(undefined), - firstName: new FormControl(undefined), - lastName: new FormControl(undefined), - totalEarnings: new FormControl(undefined), - grossEarnings: new FormControl(undefined), - totalPay: new FormControl(undefined), - totalEmployerTaxes: new FormControl(undefined), - totalEmployeeTaxes: new FormControl(undefined), - totalDeductions: new FormControl(undefined), - totalReimbursements: new FormControl(undefined), - totalCourtOrders: new FormControl(undefined), - totalBenefits: new FormControl(undefined), - bacsHash: new FormControl(undefined), - paymentMethod: new FormControl(undefined), - }); - - } - - export interface EarningsLine { - - /** Xero identifier for payroll earnings line */ - earningsLineID?: string | null; - - /** Xero identifier for payroll earnings rate */ - earningsRateID?: string | null; - - /** name of earnings rate for display in UI */ - displayName?: string | null; - - /** - * Rate per unit for earnings line - * Type: double - */ - ratePerUnit?: number | null; - - /** - * Earnings number of units - * Type: double - */ - numberOfUnits?: number | null; - - /** - * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount?: number | null; - - /** - * The amount of the earnings line. - * Type: double - */ - amount?: number | null; - - /** Identifies if the earnings is taken from the timesheet. False for earnings line */ - isLinkedToTimesheet?: boolean | null; - - /** Identifies if the earnings is using an average daily pay rate */ - isAverageDailyPayRate?: boolean | null; - } - export interface EarningsLineFormProperties { - - /** Xero identifier for payroll earnings line */ - earningsLineID: FormControl, - - /** Xero identifier for payroll earnings rate */ - earningsRateID: FormControl, - - /** name of earnings rate for display in UI */ - displayName: FormControl, - - /** - * Rate per unit for earnings line - * Type: double - */ - ratePerUnit: FormControl, - - /** - * Earnings number of units - * Type: double - */ - numberOfUnits: FormControl, - - /** - * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount: FormControl, - - /** - * The amount of the earnings line. - * Type: double - */ - amount: FormControl, - - /** Identifies if the earnings is taken from the timesheet. False for earnings line */ - isLinkedToTimesheet: FormControl, - - /** Identifies if the earnings is using an average daily pay rate */ - isAverageDailyPayRate: FormControl, - } - export function CreateEarningsLineFormGroup() { - return new FormGroup({ - earningsLineID: new FormControl(undefined), - earningsRateID: new FormControl(undefined), - displayName: new FormControl(undefined), - ratePerUnit: new FormControl(undefined), - numberOfUnits: new FormControl(undefined), - fixedAmount: new FormControl(undefined), - amount: new FormControl(undefined), - isLinkedToTimesheet: new FormControl(undefined), - isAverageDailyPayRate: new FormControl(undefined), - }); - - } - - export interface LeaveEarningsLine { - - /** Xero identifier for payroll leave earnings rate */ - earningsRateID?: string | null; - - /** - * Rate per unit for leave earnings line - * Type: double - */ - ratePerUnit?: number | null; - - /** - * Leave earnings number of units - * Type: double - */ - numberOfUnits?: number | null; - - /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount?: number | null; - - /** - * The amount of the earnings line. - * Type: double - */ - amount?: number | null; - - /** Identifies if the leave earnings is taken from the timesheet. False for leave earnings line */ - isLinkedToTimesheet?: boolean | null; - } - export interface LeaveEarningsLineFormProperties { - - /** Xero identifier for payroll leave earnings rate */ - earningsRateID: FormControl, - - /** - * Rate per unit for leave earnings line - * Type: double - */ - ratePerUnit: FormControl, - - /** - * Leave earnings number of units - * Type: double - */ - numberOfUnits: FormControl, - - /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount: FormControl, - - /** - * The amount of the earnings line. - * Type: double - */ - amount: FormControl, - - /** Identifies if the leave earnings is taken from the timesheet. False for leave earnings line */ - isLinkedToTimesheet: FormControl, - } - export function CreateLeaveEarningsLineFormGroup() { - return new FormGroup({ - earningsRateID: new FormControl(undefined), - ratePerUnit: new FormControl(undefined), - numberOfUnits: new FormControl(undefined), - fixedAmount: new FormControl(undefined), - amount: new FormControl(undefined), - isLinkedToTimesheet: new FormControl(undefined), - }); - - } - - export interface TimesheetEarningsLine { - - /** Xero identifier for payroll timesheet earnings rate */ - earningsRateID?: string | null; - - /** - * Rate per unit for timesheet earnings line - * Type: double - */ - ratePerUnit?: number | null; - - /** - * Timesheet earnings number of units - * Type: double - */ - numberOfUnits?: number | null; - - /** - * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount?: number | null; - - /** - * The amount of the timesheet earnings line. - * Type: double - */ - amount?: number | null; - - /** Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line */ - isLinkedToTimesheet?: boolean | null; - } - export interface TimesheetEarningsLineFormProperties { - - /** Xero identifier for payroll timesheet earnings rate */ - earningsRateID: FormControl, - - /** - * Rate per unit for timesheet earnings line - * Type: double - */ - ratePerUnit: FormControl, - - /** - * Timesheet earnings number of units - * Type: double - */ - numberOfUnits: FormControl, - - /** - * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount: FormControl, - - /** - * The amount of the timesheet earnings line. - * Type: double - */ - amount: FormControl, - - /** Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line */ - isLinkedToTimesheet: FormControl, - } - export function CreateTimesheetEarningsLineFormGroup() { - return new FormGroup({ - earningsRateID: new FormControl(undefined), - ratePerUnit: new FormControl(undefined), - numberOfUnits: new FormControl(undefined), - fixedAmount: new FormControl(undefined), - amount: new FormControl(undefined), - isLinkedToTimesheet: new FormControl(undefined), - }); - - } - - export interface DeductionLine { - - /** Xero identifier for payroll deduction */ - deductionTypeID?: string | null; - - /** - * The amount of the deduction line - * Type: double - */ - amount?: number | null; - - /** Identifies if the deduction is subject to tax */ - subjectToTax?: boolean | null; - - /** - * Deduction rate percentage - * Type: double - */ - percentage?: number | null; - } - export interface DeductionLineFormProperties { - - /** Xero identifier for payroll deduction */ - deductionTypeID: FormControl, - - /** - * The amount of the deduction line - * Type: double - */ - amount: FormControl, - - /** Identifies if the deduction is subject to tax */ - subjectToTax: FormControl, - - /** - * Deduction rate percentage - * Type: double - */ - percentage: FormControl, - } - export function CreateDeductionLineFormGroup() { - return new FormGroup({ - deductionTypeID: new FormControl(undefined), - amount: new FormControl(undefined), - subjectToTax: new FormControl(undefined), - percentage: new FormControl(undefined), - }); - - } - - export interface ReimbursementLine { - - /** Xero identifier for payroll reimbursement */ - reimbursementTypeID?: string | null; - - /** Reimbursement line description */ - description?: string | null; - - /** - * Reimbursement amount - * Type: double - */ - amount?: number | null; - } - export interface ReimbursementLineFormProperties { - - /** Xero identifier for payroll reimbursement */ - reimbursementTypeID: FormControl, - - /** Reimbursement line description */ - description: FormControl, - - /** - * Reimbursement amount - * Type: double - */ - amount: FormControl, - } - export function CreateReimbursementLineFormGroup() { - return new FormGroup({ - reimbursementTypeID: new FormControl(undefined), - description: new FormControl(undefined), - amount: new FormControl(undefined), - }); - - } - - export interface LeaveAccrualLine { - - /** Xero identifier for the Leave type */ - leaveTypeID?: string | null; - - /** - * Leave accrual number of units - * Type: double - */ - numberOfUnits?: number | null; - } - export interface LeaveAccrualLineFormProperties { - - /** Xero identifier for the Leave type */ - leaveTypeID: FormControl, - - /** - * Leave accrual number of units - * Type: double - */ - numberOfUnits: FormControl, - } - export function CreateLeaveAccrualLineFormGroup() { - return new FormGroup({ - leaveTypeID: new FormControl(undefined), - numberOfUnits: new FormControl(undefined), - }); - - } - - export interface BenefitLine { - - /** Xero identifier for payroll benefit type */ - benefitTypeID?: string | null; - - /** Benefit display name */ - displayName?: string | null; - - /** - * The amount of the benefit line. - * Type: double - */ - amount?: number | null; - - /** - * Benefit fixed amount - * Type: double - */ - fixedAmount?: number | null; - - /** - * Benefit rate percentage - * Type: double - */ - percentage?: number | null; - } - export interface BenefitLineFormProperties { - - /** Xero identifier for payroll benefit type */ - benefitTypeID: FormControl, - - /** Benefit display name */ - displayName: FormControl, - - /** - * The amount of the benefit line. - * Type: double - */ - amount: FormControl, - - /** - * Benefit fixed amount - * Type: double - */ - fixedAmount: FormControl, - - /** - * Benefit rate percentage - * Type: double - */ - percentage: FormControl, - } - export function CreateBenefitLineFormGroup() { - return new FormGroup({ - benefitTypeID: new FormControl(undefined), - displayName: new FormControl(undefined), - amount: new FormControl(undefined), - fixedAmount: new FormControl(undefined), - percentage: new FormControl(undefined), - }); - - } - - export interface PaymentLine { - - /** Xero identifier for payroll payment line */ - paymentLineID?: string | null; - - /** - * The amount of the payment line - * Type: double - */ - amount?: number | null; - - /** The account number */ - accountNumber?: string | null; - - /** The account sort code */ - sortCode?: string | null; - - /** The account name */ - accountName?: string | null; - } - export interface PaymentLineFormProperties { - - /** Xero identifier for payroll payment line */ - paymentLineID: FormControl, - - /** - * The amount of the payment line - * Type: double - */ - amount: FormControl, - - /** The account number */ - accountNumber: FormControl, - - /** The account sort code */ - sortCode: FormControl, - - /** The account name */ - accountName: FormControl, - } - export function CreatePaymentLineFormGroup() { - return new FormGroup({ - paymentLineID: new FormControl(undefined), - amount: new FormControl(undefined), - accountNumber: new FormControl(undefined), - sortCode: new FormControl(undefined), - accountName: new FormControl(undefined), - }); - - } - - export interface TaxLine { - - /** Xero identifier for payroll tax line */ - taxLineID?: string | null; - - /** Tax line description */ - description?: string | null; - - /** Identifies if the amount is paid for by the employee or employer. True if employer pays the tax */ - isEmployerTax?: boolean | null; - - /** - * The amount of the tax line - * Type: double - */ - amount?: number | null; - - /** Tax type ID */ - globalTaxTypeID?: string | null; - - /** Identifies if the tax line is a manual adjustment */ - manualAdjustment?: boolean | null; - } - export interface TaxLineFormProperties { - - /** Xero identifier for payroll tax line */ - taxLineID: FormControl, - - /** Tax line description */ - description: FormControl, - - /** Identifies if the amount is paid for by the employee or employer. True if employer pays the tax */ - isEmployerTax: FormControl, - - /** - * The amount of the tax line - * Type: double - */ - amount: FormControl, - - /** Tax type ID */ - globalTaxTypeID: FormControl, - - /** Identifies if the tax line is a manual adjustment */ - manualAdjustment: FormControl, - } - export function CreateTaxLineFormGroup() { - return new FormGroup({ - taxLineID: new FormControl(undefined), - description: new FormControl(undefined), - isEmployerTax: new FormControl(undefined), - amount: new FormControl(undefined), - globalTaxTypeID: new FormControl(undefined), - manualAdjustment: new FormControl(undefined), - }); - - } - - export interface CourtOrderLine { - - /** Xero identifier for payroll court order type */ - courtOrderTypeID?: string | null; - - /** - * Amount - * Type: double - */ - amount?: number | null; - } - export interface CourtOrderLineFormProperties { - - /** Xero identifier for payroll court order type */ - courtOrderTypeID: FormControl, - - /** - * Amount - * Type: double - */ - amount: FormControl, - } - export function CreateCourtOrderLineFormGroup() { - return new FormGroup({ - courtOrderTypeID: new FormControl(undefined), - amount: new FormControl(undefined), - }); - - } - - export interface PayRunObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRun?: PayRun; - } - export interface PayRunObjectFormProperties { - } - export function CreatePayRunObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface PayslipObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - paySlip?: Payslip; - } - export interface PayslipObjectFormProperties { - } - export function CreatePayslipObjectFormGroup() { - return new FormGroup({ - }); - - } - - export interface Payslips { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - paySlips?: Array; - } - export interface PayslipsFormProperties { - } - export function CreatePayslipsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Settings { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - settings?: Accounts; - } - export interface SettingsFormProperties { - } - export function CreateSettingsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Accounts { - accounts?: Array; - } - export interface AccountsFormProperties { - } - export function CreateAccountsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Account { - - /** The Xero identifier for Settings. */ - accountID?: string | null; - - /** The assigned AccountType */ - type?: AccountType | null; - - /** A unique 3 digit number for each Account */ - code?: string | null; - - /** Name of the Account. */ - name?: string | null; - } - export interface AccountFormProperties { - - /** The Xero identifier for Settings. */ - accountID: FormControl, - - /** The assigned AccountType */ - type: FormControl, - - /** A unique 3 digit number for each Account */ - code: FormControl, - - /** Name of the Account. */ - name: FormControl, - } - export function CreateAccountFormGroup() { - return new FormGroup({ - accountID: new FormControl(undefined), - type: new FormControl(undefined), - code: new FormControl(undefined), - name: new FormControl(undefined), - }); - - } - - export enum AccountType { BANK = 0, EMPLOYERSNIC = 1, NICLIABILITY = 2, PAYEECONTRIBUTION = 3, PAYELIABILITY = 4, WAGESPAYABLE = 5, WAGESEXPENSE = 6 } - - export interface TrackingCategories { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - trackingCategories?: TrackingCategory; - } - export interface TrackingCategoriesFormProperties { - } - export function CreateTrackingCategoriesFormGroup() { - return new FormGroup({ - }); - - } - - export interface TrackingCategory { - - /** The Xero identifier for Employee groups tracking category. */ - employeeGroupsTrackingCategoryID?: string | null; - - /** The Xero identifier for Timesheet tracking category. */ - timesheetTrackingCategoryID?: string | null; - } - export interface TrackingCategoryFormProperties { - - /** The Xero identifier for Employee groups tracking category. */ - employeeGroupsTrackingCategoryID: FormControl, - - /** The Xero identifier for Timesheet tracking category. */ - timesheetTrackingCategoryID: FormControl, - } - export function CreateTrackingCategoryFormGroup() { - return new FormGroup({ - employeeGroupsTrackingCategoryID: new FormControl(undefined), - timesheetTrackingCategoryID: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches employees - * Get Employees - * @param {string} firstName Filter by first name - * @param {string} lastName Filter by last name - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Employees} search results matching criteria - */ - GetEmployees(firstName: string | null | undefined, lastName: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees?firstName=' + (firstName == null ? '' : encodeURIComponent(firstName)) + '&lastName=' + (lastName == null ? '' : encodeURIComponent(lastName)) + '&page=' + page, {}); - } - - /** - * creates employees - * Post Employees - * @return {EmployeeObject} search results matching criteria - */ - CreateEmployee(requestBody: Employee): Observable { - return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches employees - * Get Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeObject} search results matching criteria - */ - GetEmployee(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); - } - - /** - * updates employee - * Put Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeObject} successful response - */ - UpdateEmployee(EmployeeId: string, requestBody: Employee): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * creates employment - * Post Employees/{EmployeeId}/Employment - * @param {string} EmployeeId Employee id for single object - * @return {EmploymentObject} search results matching criteria - */ - CreateEmployment(EmployeeId: string, requestBody: Employment): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Employment', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches tax records for an employee - * Get Employees/{EmployeeId}/Tax - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeTaxObject} search results matching criteria - */ - GetEmployeeTax(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Tax', {}); - } - - /** - * retrieve employee openingbalances - * Get Employees/{EmployeeId}/ukopeningbalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeOpeningBalancesObject} search results matching criteria - */ - GetEmployeeOpeningBalances(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', {}); - } - - /** - * creates employee opening balances - * Post Employees/{EmployeeId}/ukopeningbalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeOpeningBalancesObject} search results matching criteria - */ - CreateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * updates employee opening balances - * Put Employees/{EmployeeId}/ukopeningbalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeOpeningBalancesObject} successful response - */ - UpdateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * search employee leave records - * Get Employees/{EmployeeId}/Leave - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaves} search results matching criteria - */ - GetEmployeeLeaves(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', {}); - } - - /** - * creates employee leave records - * Post Employees/{EmployeeId}/Leave - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveObject} search results matching criteria - */ - CreateEmployeeLeave(EmployeeId: string, requestBody: EmployeeLeave): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single employee leave record - * Get Employees/{EmployeeId}/Leave/{LeaveID} - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveID Leave id for single object - * @return {EmployeeLeaveObject} search results matching criteria - */ - GetEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); - } - - /** - * updates employee leave records - * Put Employees/{EmployeeId}/Leave/{LeaveID} - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveID Leave id for single object - * @return {EmployeeLeaveObject} successful response - */ - UpdateEmployeeLeave(EmployeeId: string, LeaveID: string, requestBody: EmployeeLeave): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * deletes an employee leave record - * Delete Employees/{EmployeeId}/Leave/{LeaveID} - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveID Leave id for single object - * @return {EmployeeLeaveObject} successful response - */ - DeleteEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { - return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); - } - - /** - * search employee leave balances - * Get Employees/{EmployeeId}/LeaveBalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveBalances} search results matching criteria - */ - GetEmployeeLeaveBalances(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveBalances', {}); - } - - /** - * search employee leave balances - * Get Employees/{EmployeeId}/StatutoryLeaveBalance - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveType Filter by the type of statutory leave - * @param {Date} AsOfDate The date from which to calculate balance remaining. If not specified, current date UTC is used. - * Type: DateOnly - * @return {EmployeeStatutoryLeaveBalanceObject} search results matching criteria - */ - GetEmployeeStatutoryLeaveBalances(EmployeeId: string, LeaveType: string | null | undefined, AsOfDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/StatutoryLeaveBalance&LeaveType=' + (LeaveType == null ? '' : encodeURIComponent(LeaveType)) + '&AsOfDate=' + AsOfDate?.toISOString(), {}); - } - - /** - * retrieve a summary of statutory leaves for an employee - * Get statutoryleaves/summary/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @param {boolean} activeOnly Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned - * @return {EmployeeStatutoryLeavesSummaries} search results matching criteria - */ - GetStatutoryLeaveSummary(EmployeeId: string, activeOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'statutoryleaves/summary/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '&activeOnly=' + activeOnly, {}); - } - - /** - * creates employee statutory sick leave records - * Post StatutoryLeaves/Sick - * @return {EmployeeStatutorySickLeaveObject} search results matching criteria - */ - CreateEmployeeStatutorySickLeave(requestBody: EmployeeStatutorySickLeave): Observable { - return this.http.post(this.baseUri + 'StatutoryLeaves/Sick', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a statutory sick leave for an employee - * Get StatutoryLeaves/Sick/{StatutorySickLeaveID} - * @param {string} StatutorySickLeaveID Statutory sick leave id for single object - * @return {EmployeeStatutorySickLeaveObject} search results matching criteria - */ - GetEmployeeStatutorySickLeave(StatutorySickLeaveID: string): Observable { - return this.http.get(this.baseUri + 'StatutoryLeaves/Sick/' + (StatutorySickLeaveID == null ? '' : encodeURIComponent(StatutorySickLeaveID)), {}); - } - - /** - * searches employee leave periods - * Get Employees/{EmployeeId}/LeavePeriods - * @param {string} EmployeeId Employee id for single object - * @param {Date} startDate Filter by start date - * Type: DateOnly - * @param {Date} endDate Filter by end date - * Type: DateOnly - * @return {LeavePeriods} search results matching criteria - */ - GetEmployeeLeavePeriods(EmployeeId: string, startDate: Date | null | undefined, endDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeavePeriods&startDate=' + startDate?.toISOString() + '&endDate=' + endDate?.toISOString(), {}); - } - - /** - * searches employee leave types - * Get Employees/{EmployeeId}/LeaveTypes - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveTypes} search results matching criteria - */ - GetEmployeeLeaveTypes(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', {}); - } - - /** - * creates employee leave type records - * Post Employees/{EmployeeId}/LeaveTypes - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveTypeObject} search results matching criteria - */ - CreateEmployeeLeaveType(EmployeeId: string, requestBody: EmployeeLeaveType): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieves an employee's payment method - * Get Employees/{EmployeeId}/PaymentMethods - * @param {string} EmployeeId Employee id for single object - * @return {PaymentMethodObject} search results matching criteria - */ - GetEmployeePaymentMethod(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', {}); - } - - /** - * creates employee payment method - * Post Employees/{EmployeeId}/PaymentMethods - * @param {string} EmployeeId Employee id for single object - * @return {PaymentMethodObject} search results matching criteria - */ - CreateEmployeePaymentMethod(EmployeeId: string, requestBody: PaymentMethod): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches employee pay templates - * Get Employees/{EmployeeId}/PayTemplates - * @param {string} EmployeeId Employee id for single object - * @return {EmployeePayTemplateObject} search results matching criteria - */ - GetEmployeePayTemplate(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates', {}); - } - - /** - * creates employee earnings template records - * Post Employees/{EmployeeId}/PayTemplates/earnings - * @param {string} EmployeeId Employee id for single object - * @return {EarningsTemplateObject} search results matching criteria - */ - CreateEmployeeEarningsTemplate(EmployeeId: string, requestBody: EarningsTemplate): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * updates employee earnings template records - * Put Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} - * @param {string} EmployeeId Employee id for single object - * @param {string} PayTemplateEarningID Id for single pay template earnings object - * @return {EarningsTemplateObject} search results matching criteria - */ - UpdateEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string, requestBody: EarningsTemplate): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * deletes an employee earnings template record - * Delete Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} - * @param {string} EmployeeId Employee id for single object - * @param {string} PayTemplateEarningID Id for single pay template earnings object - * @return {void} deletion successful - */ - DeleteEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string): Observable> { - return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), { observe: 'response', responseType: 'text' }); - } - - /** - * creates multiple employee earnings template records - * Post Employees/{EmployeeId}/paytemplateearnings - * @param {string} EmployeeId Employee id for single object - * @return {EmployeePayTemplates} search results matching criteria - */ - CreateMultipleEmployeeEarningsTemplate(EmployeeId: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/paytemplateearnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches benefits - * Get Benefits - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Benefits} search results matching criteria - */ - GetBenefits(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Benefits?page=' + page, {}); - } - - /** - * create a new benefit - * Post Benefits - * @return {BenefitObject} search results matching criteria - */ - CreateBenefit(requestBody: Benefit): Observable { - return this.http.post(this.baseUri + 'Benefits', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single benefit by id - * Get Benefits/{id} - * @param {string} id Identifier for the benefit - * @return {BenefitObject} search results matching criteria - */ - GetBenefit(id: string): Observable { - return this.http.get(this.baseUri + 'Benefits/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * searches deductions - * Get Deductions - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Deductions} search results matching criteria - */ - GetDeductions(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Deductions?page=' + page, {}); - } - - /** - * create a new deduction - * Post Deductions - * @return {DeductionObject} search results matching criteria - */ - CreateDeduction(requestBody: Deduction): Observable { - return this.http.post(this.baseUri + 'Deductions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single deduction by id - * Get Deductions/{deductionId} - * @param {string} deductionId Identifier for the deduction - * @return {DeductionObject} search results matching criteria - */ - GetDeduction(deductionId: string): Observable { - return this.http.get(this.baseUri + 'Deductions/' + (deductionId == null ? '' : encodeURIComponent(deductionId)), {}); - } - - /** - * searches earnings orders - * Get EarningsOrders - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {EarningsOrders} search results matching criteria - */ - GetEarningsOrders(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'EarningsOrders?page=' + page, {}); - } - - /** - * retrieve a single deduction by id - * Get EarningsOrders/{id} - * @param {string} id Identifier for the deduction - * @return {EarningsOrderObject} search results matching criteria - */ - GetEarningsOrder(id: string): Observable { - return this.http.get(this.baseUri + 'EarningsOrders/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * searches earnings rates - * Get EarningsRates - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {EarningsRates} search results matching criteria - */ - GetEarningsRates(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'EarningsRates?page=' + page, {}); - } - - /** - * create a new earnings rate - * Post EarningsRates - * @return {EarningsRateObject} search results matching criteria - */ - CreateEarningsRate(requestBody: EarningsRate): Observable { - return this.http.post(this.baseUri + 'EarningsRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single earnings rates by id - * Get EarningsRates/{EarningsRateID} - * @param {string} EarningsRateID Identifier for the earnings rate - * @return {EarningsRateObject} search results matching criteria - */ - GetEarningsRate(EarningsRateID: string): Observable { - return this.http.get(this.baseUri + 'EarningsRates/' + (EarningsRateID == null ? '' : encodeURIComponent(EarningsRateID)), {}); - } - - /** - * searches leave types - * Get LeaveTypes - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} ActiveOnly Filters leave types by active status. By default the API returns all leave types. - * @return {LeaveTypes} search results matching criteria - */ - GetLeaveTypes(page: number | null | undefined, ActiveOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'LeaveTypes?page=' + page + '&ActiveOnly=' + ActiveOnly, {}); - } - - /** - * create a new leave type - * Post LeaveTypes - * @return {LeaveTypeObject} search results matching criteria - */ - CreateLeaveType(requestBody: LeaveType): Observable { - return this.http.post(this.baseUri + 'LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single leave type by id - * Get LeaveTypes/{LeaveTypeID} - * @param {string} LeaveTypeID Identifier for the leave type - * @return {LeaveTypeObject} search results matching criteria - */ - GetLeaveType(LeaveTypeID: string): Observable { - return this.http.get(this.baseUri + 'LeaveTypes/' + (LeaveTypeID == null ? '' : encodeURIComponent(LeaveTypeID)), {}); - } - - /** - * searches reimbursements - * Get Reimbursements - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Reimbursements} search results matching criteria - */ - GetReimbursements(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reimbursements?page=' + page, {}); - } - - /** - * create a new reimbursement - * Post Reimbursements - * @return {ReimbursementObject} search results matching criteria - */ - CreateReimbursement(requestBody: Reimbursement): Observable { - return this.http.post(this.baseUri + 'Reimbursements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single reimbursement by id - * Get Reimbursements/{ReimbursementID} - * @param {string} ReimbursementID Identifier for the reimbursement - * @return {ReimbursementObject} search results matching criteria - */ - GetReimbursement(ReimbursementID: string): Observable { - return this.http.get(this.baseUri + 'Reimbursements/' + (ReimbursementID == null ? '' : encodeURIComponent(ReimbursementID)), {}); - } - - /** - * searches timesheets - * Get Timesheets - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} employeeId By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. - * @param {string} payrollCalendarId By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id - * @return {Timesheets} search results matching criteria - */ - GetTimesheets(page: number | null | undefined, employeeId: string | null | undefined, payrollCalendarId: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Timesheets?page=' + page + '&employeeId=' + (employeeId == null ? '' : encodeURIComponent(employeeId)) + '&payrollCalendarId=' + (payrollCalendarId == null ? '' : encodeURIComponent(payrollCalendarId)), {}); - } - - /** - * create a new timesheet - * Post Timesheets - * @return {TimesheetObject} search results matching criteria - */ - CreateTimesheet(requestBody: Timesheet): Observable { - return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single timesheet by id - * Get Timesheets/{TimesheetID} - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetObject} search results matching criteria - */ - GetTimesheet(TimesheetID: string): Observable { - return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); - } - - /** - * delete a timesheet - * Delete Timesheets/{TimesheetID} - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetLine} search results matching criteria - */ - DeleteTimesheet(TimesheetID: string): Observable { - return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); - } - - /** - * create a new timesheet line - * Post Timesheets/{TimesheetID}/Lines - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetLineObject} search results matching criteria - */ - CreateTimesheetLine(TimesheetID: string, requestBody: TimesheetLine): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * approve a timesheet - * Post Timesheets/{TimesheetID}/Approve - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetObject} search results matching criteria - */ - ApproveTimesheet(TimesheetID: string): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Approve', null, {}); - } - - /** - * revert a timesheet to draft - * Post Timesheets/{TimesheetID}/RevertToDraft - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetObject} search results matching criteria - */ - RevertTimesheet(TimesheetID: string): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/RevertToDraft', null, {}); - } - - /** - * update a timesheet line - * Put Timesheets/{TimesheetID}/Lines/{TimesheetLineID} - * @param {string} TimesheetID Identifier for the timesheet - * @param {string} TimesheetLineID Identifier for the timesheet line - * @return {TimesheetLineObject} search results matching criteria - */ - UpdateTimesheetLine(TimesheetID: string, TimesheetLineID: string, requestBody: TimesheetLine): Observable { - return this.http.put(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * delete a timesheet line - * Delete Timesheets/{TimesheetID}/Lines/{TimesheetLineID} - * @param {string} TimesheetID Identifier for the timesheet - * @param {string} TimesheetLineID Identifier for the timesheet line - * @return {TimesheetLine} search results matching criteria - */ - DeleteTimesheetLine(TimesheetID: string, TimesheetLineID: string): Observable { - return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), {}); - } - - /** - * searches payrun calendars - * Get PayRunCalendars - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayRunCalendars} search results matching criteria - */ - GetPayRunCalendars(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayRunCalendars?page=' + page, {}); - } - - /** - * create a new payrun calendar - * Post PayRunCalendars - * @return {PayRunCalendarObject} search results matching criteria - */ - CreatePayRunCalendar(requestBody: PayRunCalendar): Observable { - return this.http.post(this.baseUri + 'PayRunCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single payrun calendar by id - * Get PayRunCalendars/{PayRunCalendarID} - * @param {string} PayRunCalendarID Identifier for the payrun calendars - * @return {PayRunCalendarObject} search results matching criteria - */ - GetPayRunCalendar(PayRunCalendarID: string): Observable { - return this.http.get(this.baseUri + 'PayRunCalendars/' + (PayRunCalendarID == null ? '' : encodeURIComponent(PayRunCalendarID)), {}); - } - - /** - * retrieves an employee's salary and wages - * Get Employees/{EmployeeId}/SalaryAndWages - * @param {string} EmployeeId Employee id for single object - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {SalaryAndWages} search results matching criteria - */ - GetEmployeeSalaryAndWages(EmployeeId: string, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages&page=' + page, {}); - } - - /** - * creates employee salary and wage record - * Post Employees/{EmployeeId}/SalaryAndWages - * @param {string} EmployeeId Employee id for single object - * @return {SalaryAndWageObject} search results matching criteria - */ - CreateEmployeeSalaryAndWage(EmployeeId: string, requestBody: SalaryAndWage): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * get employee salary and wages record by id - * Get Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} - * @param {string} EmployeeId Employee id for single object - * @param {string} SalaryAndWagesID Id for single pay template earnings object - * @return {SalaryAndWages} search results matching criteria - */ - GetEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), {}); - } - - /** - * updates employee salary and wages record - * Put Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} - * @param {string} EmployeeId Employee id for single object - * @param {string} SalaryAndWagesID Id for single pay template earnings object - * @return {SalaryAndWageObject} search results matching criteria - */ - UpdateEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string, requestBody: SalaryAndWage): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * deletes an employee salary and wages record - * Delete Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} - * @param {string} EmployeeId Employee id for single object - * @param {string} SalaryAndWagesID Id for single salary and wages object - * @return {void} deletion successful - */ - DeleteEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable> { - return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), { observe: 'response', responseType: 'text' }); - } - - /** - * searches pay runs - * Get PayRuns - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {PayRunPayRunStatus} status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. - * @return {PayRuns} search results matching criteria - */ - GetPayRuns(page: number | null | undefined, status: PayRunPayRunStatus | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayRuns?page=' + page + '&status=' + status, {}); - } - - /** - * retrieve a single pay run by id - * Get PayRuns/{PayRunID} - * @param {string} PayRunID Identifier for the pay run - * @return {PayRunObject} search results matching criteria - */ - GetPayRun(PayRunID: string): Observable { - return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); - } - - /** - * update a pay run - * Put PayRuns/{PayRunID} - * @param {string} PayRunID Identifier for the pay run - * @return {PayRunObject} search results matching criteria - */ - UpdatePayRun(PayRunID: string, requestBody: PayRun): Observable { - return this.http.put(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches payslips - * Get Payslips - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} PayRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. - * @return {Payslips} search results matching criteria - */ - GetPayslips(page: number | null | undefined, PayRunID: string): Observable { - return this.http.get(this.baseUri + 'Payslips?page=' + page + '&PayRunID=' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); - } - - /** - * retrieve a single payslip by id - * Get Payslips/{PayslipID} - * @param {string} PayslipID Identifier for the payslip - * @return {PayslipObject} search results matching criteria - */ - GetPaySlip(PayslipID: string): Observable { - return this.http.get(this.baseUri + 'Payslips/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); - } - - /** - * searches settings - * Get Settings - * @return {Settings} search results matching criteria - */ - GetSettings(): Observable { - return this.http.get(this.baseUri + 'Settings', {}); - } - - /** - * searches tracking categories - * Get settings/trackingCategories - * @return {TrackingCategories} search results matching criteria - */ - GetTrackingCategories(): Observable { - return this.http.get(this.baseUri + 'settings/trackingCategories', {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Pagination { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + page?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageSize?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageCount?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + itemCount?: number | null; + } + export interface PaginationFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + page: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageSize: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageCount: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + itemCount: FormControl, + } + export function CreatePaginationFormGroup() { + return new FormGroup({ + page: new FormControl(undefined), + pageSize: new FormControl(undefined), + pageCount: new FormControl(undefined), + itemCount: new FormControl(undefined), + }); + + } + + + /** The object returned for a bad request */ + export interface Problem { + + /** The type of error format */ + type?: string | null; + + /** The type of the error */ + title?: string | null; + + /** The error status code */ + status?: string | null; + + /** A description of the error */ + detail?: string | null; + instance?: string | null; + invalidFields?: Array; + } + + /** The object returned for a bad request */ + export interface ProblemFormProperties { + + /** The type of error format */ + type: FormControl, + + /** The type of the error */ + title: FormControl, + + /** The error status code */ + status: FormControl, + + /** A description of the error */ + detail: FormControl, + instance: FormControl, + } + export function CreateProblemFormGroup() { + return new FormGroup({ + type: new FormControl(undefined), + title: new FormControl(undefined), + status: new FormControl(undefined), + detail: new FormControl(undefined), + instance: new FormControl(undefined), + }); + + } + + export interface InvalidField { + + /** The name of the field that caused the error */ + name?: string | null; + + /** The reason the error occurred */ + reason?: string | null; + } + export interface InvalidFieldFormProperties { + + /** The name of the field that caused the error */ + name: FormControl, + + /** The reason the error occurred */ + reason: FormControl, + } + export function CreateInvalidFieldFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + reason: new FormControl(undefined), + }); + + } + + export interface Employees { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + employees?: Array; + } + export interface EmployeesFormProperties { + } + export function CreateEmployeesFormGroup() { + return new FormGroup({ + }); + + } + + export interface Employee { + + /** Xero unique identifier for the employee */ + employeeID?: string | null; + + /** Title of the employee */ + title?: string | null; + + /** First name of employee */ + firstName?: string | null; + + /** Last name of employee */ + lastName?: string | null; + + /** + * Date of birth of the employee (YYYY-MM-DD) + * Type: DateOnly + */ + dateOfBirth?: Date | null; + address?: Address; + + /** The email address for the employee */ + email?: string | null; + + /** The employee’s gender */ + gender?: EmployeeGender | null; + + /** Employee phone number */ + phoneNumber?: string | null; + + /** + * Employment start date of the employee at the time it was requested + * Type: DateOnly + */ + startDate?: Date | null; + + /** + * Employment end date of the employee at the time it was requested + * Type: DateOnly + */ + endDate?: Date | null; + + /** Xero unique identifier for the payroll calendar of the employee */ + payrollCalendarID?: string | null; + + /** UTC timestamp of last update to the employee */ + updatedDateUTC?: Date | null; + + /** UTC timestamp when the employee was created in Xero */ + createdDateUTC?: Date | null; + + /** National insurance number of the employee */ + nationalInsuranceNumber?: string | null; + } + export interface EmployeeFormProperties { + + /** Xero unique identifier for the employee */ + employeeID: FormControl, + + /** Title of the employee */ + title: FormControl, + + /** First name of employee */ + firstName: FormControl, + + /** Last name of employee */ + lastName: FormControl, + + /** + * Date of birth of the employee (YYYY-MM-DD) + * Type: DateOnly + */ + dateOfBirth: FormControl, + + /** The email address for the employee */ + email: FormControl, + + /** The employee’s gender */ + gender: FormControl, + + /** Employee phone number */ + phoneNumber: FormControl, + + /** + * Employment start date of the employee at the time it was requested + * Type: DateOnly + */ + startDate: FormControl, + + /** + * Employment end date of the employee at the time it was requested + * Type: DateOnly + */ + endDate: FormControl, + + /** Xero unique identifier for the payroll calendar of the employee */ + payrollCalendarID: FormControl, + + /** UTC timestamp of last update to the employee */ + updatedDateUTC: FormControl, + + /** UTC timestamp when the employee was created in Xero */ + createdDateUTC: FormControl, + + /** National insurance number of the employee */ + nationalInsuranceNumber: FormControl, + } + export function CreateEmployeeFormGroup() { + return new FormGroup({ + employeeID: new FormControl(undefined), + title: new FormControl(undefined), + firstName: new FormControl(undefined), + lastName: new FormControl(undefined), + dateOfBirth: CreateDateOnlyFormControl(), + email: new FormControl(undefined), + gender: new FormControl(undefined), + phoneNumber: new FormControl(undefined), + startDate: CreateDateOnlyFormControl(), + endDate: CreateDateOnlyFormControl(), + payrollCalendarID: new FormControl(undefined), + updatedDateUTC: new FormControl(undefined), + createdDateUTC: new FormControl(undefined), + nationalInsuranceNumber: new FormControl(undefined), + }); + + } + + export interface Address { + + /** + * Address line 1 for employee home address + * Required + */ + addressLine1: string; + + /** Address line 2 for employee home address */ + addressLine2?: string | null; + + /** + * Suburb for employee home address + * Required + */ + city: string; + + /** + * PostCode for employee home address + * Required + */ + postCode: string; + + /** Country of HomeAddress */ + countryName?: string | null; + } + export interface AddressFormProperties { + + /** + * Address line 1 for employee home address + * Required + */ + addressLine1: FormControl, + + /** Address line 2 for employee home address */ + addressLine2: FormControl, + + /** + * Suburb for employee home address + * Required + */ + city: FormControl, + + /** + * PostCode for employee home address + * Required + */ + postCode: FormControl, + + /** Country of HomeAddress */ + countryName: FormControl, + } + export function CreateAddressFormGroup() { + return new FormGroup({ + addressLine1: new FormControl(undefined, [Validators.required]), + addressLine2: new FormControl(undefined), + city: new FormControl(undefined, [Validators.required]), + postCode: new FormControl(undefined, [Validators.required]), + countryName: new FormControl(undefined), + }); + + } + + export enum EmployeeGender { M = 0, F = 1 } + + export interface EmployeeObject { + pagination?: Pagination; + employee?: Employee; + + /** The object returned for a bad request */ + problem?: Problem; + } + export interface EmployeeObjectFormProperties { + } + export function CreateEmployeeObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmploymentObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + employment?: Employment; + } + export interface EmploymentObjectFormProperties { + } + export function CreateEmploymentObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Employment { + + /** Xero unique identifier for the payroll calendar of the employee */ + payrollCalendarID?: string | null; + + /** + * Start date of the employment (YYYY-MM-DD) + * Type: DateOnly + */ + startDate?: Date | null; + + /** The employment number of the employee */ + employeeNumber?: string | null; + + /** The NI Category of the employee */ + niCategory?: EmploymentNiCategory | null; + } + export interface EmploymentFormProperties { + + /** Xero unique identifier for the payroll calendar of the employee */ + payrollCalendarID: FormControl, + + /** + * Start date of the employment (YYYY-MM-DD) + * Type: DateOnly + */ + startDate: FormControl, + + /** The employment number of the employee */ + employeeNumber: FormControl, + + /** The NI Category of the employee */ + niCategory: FormControl, + } + export function CreateEmploymentFormGroup() { + return new FormGroup({ + payrollCalendarID: new FormControl(undefined), + startDate: CreateDateOnlyFormControl(), + employeeNumber: new FormControl(undefined), + niCategory: new FormControl(undefined), + }); + + } + + export enum EmploymentNiCategory { A = 0, B = 1, C = 2, H = 3, J = 4, M = 5, Z = 6, X = 7 } + + export interface EmployeeTaxObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + employeeTax?: EmployeeTax; + } + export interface EmployeeTaxObjectFormProperties { + } + export function CreateEmployeeTaxObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeTax { + + /** The Starter type. */ + starterType?: string | null; + + /** Starter declaration. */ + starterDeclaration?: string | null; + + /** The Tax code. */ + taxCode?: string | null; + + /** Describes whether the tax settings is W1M1 */ + w1M1?: boolean | null; + + /** + * The previous taxable pay + * Type: double + */ + previousTaxablePay?: number | null; + + /** + * The tax amount previously paid + * Type: double + */ + previousTaxPaid?: number | null; + + /** The employee's student loan deduction type */ + studentLoanDeduction?: string | null; + + /** Describes whether the employee has post graduate loans */ + hasPostGraduateLoans?: boolean | null; + + /** Describes whether the employee is director */ + isDirector?: boolean | null; + + /** + * The directorship start date + * Type: DateOnly + */ + directorshipStartDate?: Date | null; + + /** NICs calculation method */ + nicCalculationMethod?: string | null; + } + export interface EmployeeTaxFormProperties { + + /** The Starter type. */ + starterType: FormControl, + + /** Starter declaration. */ + starterDeclaration: FormControl, + + /** The Tax code. */ + taxCode: FormControl, + + /** Describes whether the tax settings is W1M1 */ + w1M1: FormControl, + + /** + * The previous taxable pay + * Type: double + */ + previousTaxablePay: FormControl, + + /** + * The tax amount previously paid + * Type: double + */ + previousTaxPaid: FormControl, + + /** The employee's student loan deduction type */ + studentLoanDeduction: FormControl, + + /** Describes whether the employee has post graduate loans */ + hasPostGraduateLoans: FormControl, + + /** Describes whether the employee is director */ + isDirector: FormControl, + + /** + * The directorship start date + * Type: DateOnly + */ + directorshipStartDate: FormControl, + + /** NICs calculation method */ + nicCalculationMethod: FormControl, + } + export function CreateEmployeeTaxFormGroup() { + return new FormGroup({ + starterType: new FormControl(undefined), + starterDeclaration: new FormControl(undefined), + taxCode: new FormControl(undefined), + w1M1: new FormControl(undefined), + previousTaxablePay: new FormControl(undefined), + previousTaxPaid: new FormControl(undefined), + studentLoanDeduction: new FormControl(undefined), + hasPostGraduateLoans: new FormControl(undefined), + isDirector: new FormControl(undefined), + directorshipStartDate: CreateDateOnlyFormControl(), + nicCalculationMethod: new FormControl(undefined), + }); + + } + + export interface EmployeeOpeningBalancesObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + openingBalances?: EmployeeOpeningBalances; + } + export interface EmployeeOpeningBalancesObjectFormProperties { + } + export function CreateEmployeeOpeningBalancesObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeOpeningBalances { + + /** + * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryAdoptionPay?: number | null; + + /** + * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryMaternityPay?: number | null; + + /** + * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryPaternityPay?: number | null; + + /** + * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutorySharedParentalPay?: number | null; + + /** + * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutorySickPay?: number | null; + + /** + * The unique employee number issued by the employee's former employer + * Type: double + */ + priorEmployeeNumber?: number | null; + } + export interface EmployeeOpeningBalancesFormProperties { + + /** + * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryAdoptionPay: FormControl, + + /** + * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryMaternityPay: FormControl, + + /** + * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryPaternityPay: FormControl, + + /** + * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutorySharedParentalPay: FormControl, + + /** + * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutorySickPay: FormControl, + + /** + * The unique employee number issued by the employee's former employer + * Type: double + */ + priorEmployeeNumber: FormControl, + } + export function CreateEmployeeOpeningBalancesFormGroup() { + return new FormGroup({ + statutoryAdoptionPay: new FormControl(undefined), + statutoryMaternityPay: new FormControl(undefined), + statutoryPaternityPay: new FormControl(undefined), + statutorySharedParentalPay: new FormControl(undefined), + statutorySickPay: new FormControl(undefined), + priorEmployeeNumber: new FormControl(undefined), + }); + + } + + export interface EmployeeLeaves { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leave?: Array; + } + export interface EmployeeLeavesFormProperties { + } + export function CreateEmployeeLeavesFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeLeave { + + /** The Xero identifier for LeaveType */ + leaveID?: string | null; + + /** + * The Xero identifier for LeaveType + * Required + */ + leaveTypeID: string; + + /** + * The description of the leave (max length = 50) + * Required + */ + description: string; + + /** + * Start date of the leave (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + startDate: Date; + + /** + * End date of the leave (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + endDate: Date; + + /** The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. */ + periods?: Array; + + /** UTC timestamp of last update to the leave type note */ + updatedDateUTC?: Date | null; + } + export interface EmployeeLeaveFormProperties { + + /** The Xero identifier for LeaveType */ + leaveID: FormControl, + + /** + * The Xero identifier for LeaveType + * Required + */ + leaveTypeID: FormControl, + + /** + * The description of the leave (max length = 50) + * Required + */ + description: FormControl, + + /** + * Start date of the leave (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + startDate: FormControl, + + /** + * End date of the leave (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + endDate: FormControl, + + /** UTC timestamp of last update to the leave type note */ + updatedDateUTC: FormControl, + } + export function CreateEmployeeLeaveFormGroup() { + return new FormGroup({ + leaveID: new FormControl(undefined), + leaveTypeID: new FormControl(undefined, [Validators.required]), + description: new FormControl(undefined, [Validators.required]), + startDate: CreateDateOnlyFormControl(), + endDate: CreateDateOnlyFormControl(), + updatedDateUTC: new FormControl(undefined), + }); + + } + + export interface LeavePeriod { + + /** + * The Pay Period Start Date (YYYY-MM-DD) + * Type: DateOnly + */ + periodStartDate?: Date | null; + + /** + * The Pay Period End Date (YYYY-MM-DD) + * Type: DateOnly + */ + periodEndDate?: Date | null; + + /** + * The Number of Units for the leave + * Type: double + */ + numberOfUnits?: number | null; + + /** Period Status */ + periodStatus?: LeavePeriodPeriodStatus | null; + } + export interface LeavePeriodFormProperties { + + /** + * The Pay Period Start Date (YYYY-MM-DD) + * Type: DateOnly + */ + periodStartDate: FormControl, + + /** + * The Pay Period End Date (YYYY-MM-DD) + * Type: DateOnly + */ + periodEndDate: FormControl, + + /** + * The Number of Units for the leave + * Type: double + */ + numberOfUnits: FormControl, + + /** Period Status */ + periodStatus: FormControl, + } + export function CreateLeavePeriodFormGroup() { + return new FormGroup({ + periodStartDate: CreateDateOnlyFormControl(), + periodEndDate: CreateDateOnlyFormControl(), + numberOfUnits: new FormControl(undefined), + periodStatus: new FormControl(undefined), + }); + + } + + export enum LeavePeriodPeriodStatus { Approved = 0, Completed = 1 } + + export interface EmployeeLeaveObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leave?: EmployeeLeave; + } + export interface EmployeeLeaveObjectFormProperties { + } + export function CreateEmployeeLeaveObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface LeavePeriods { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + periods?: Array; + } + export interface LeavePeriodsFormProperties { + } + export function CreateLeavePeriodsFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeLeaveBalances { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveBalances?: Array; + } + export interface EmployeeLeaveBalancesFormProperties { + } + export function CreateEmployeeLeaveBalancesFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeLeaveBalance { + + /** Name of the leave type. */ + name?: string | null; + + /** The Xero identifier for leave type */ + leaveTypeID?: string | null; + + /** + * The employees current balance for the corresponding leave type. + * Type: double + */ + balance?: number | null; + + /** The type of the units of the leave. */ + typeOfUnits?: string | null; + } + export interface EmployeeLeaveBalanceFormProperties { + + /** Name of the leave type. */ + name: FormControl, + + /** The Xero identifier for leave type */ + leaveTypeID: FormControl, + + /** + * The employees current balance for the corresponding leave type. + * Type: double + */ + balance: FormControl, + + /** The type of the units of the leave. */ + typeOfUnits: FormControl, + } + export function CreateEmployeeLeaveBalanceFormGroup() { + return new FormGroup({ + name: new FormControl(undefined), + leaveTypeID: new FormControl(undefined), + balance: new FormControl(undefined), + typeOfUnits: new FormControl(undefined), + }); + + } + + export interface EmployeeStatutoryLeaveBalanceObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveBalance?: EmployeeStatutoryLeaveBalance; + } + export interface EmployeeStatutoryLeaveBalanceObjectFormProperties { + } + export function CreateEmployeeStatutoryLeaveBalanceObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeStatutoryLeaveBalance { + + /** The type of statutory leave */ + leaveType?: EmployeeStatutoryLeaveBalanceLeaveType | null; + + /** + * The balance remaining for the corresponding leave type as of specified date. + * Type: double + */ + balanceRemaining?: number | null; + + /** The units will be "Hours" */ + units?: EmployeeStatutoryLeaveBalanceUnits | null; + } + export interface EmployeeStatutoryLeaveBalanceFormProperties { + + /** The type of statutory leave */ + leaveType: FormControl, + + /** + * The balance remaining for the corresponding leave type as of specified date. + * Type: double + */ + balanceRemaining: FormControl, + + /** The units will be "Hours" */ + units: FormControl, + } + export function CreateEmployeeStatutoryLeaveBalanceFormGroup() { + return new FormGroup({ + leaveType: new FormControl(undefined), + balanceRemaining: new FormControl(undefined), + units: new FormControl(undefined), + }); + + } + + export enum EmployeeStatutoryLeaveBalanceLeaveType { Sick = 0, Adoption = 1, Maternity = 2, Paternity = 3, Sharedparental = 4 } + + export enum EmployeeStatutoryLeaveBalanceUnits { Hours = 0 } + + export interface EmployeeStatutoryLeavesSummaries { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutoryLeaves?: Array; + } + export interface EmployeeStatutoryLeavesSummariesFormProperties { + } + export function CreateEmployeeStatutoryLeavesSummariesFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeStatutoryLeaveSummary { + + /** The unique identifier (guid) of a statutory leave. */ + statutoryLeaveID?: string | null; + + /** The unique identifier (guid) of the employee */ + employeeID?: string | null; + + /** The category of statutory leave */ + type?: EmployeeStatutoryLeaveBalanceLeaveType | null; + + /** + * The date when the leave starts + * Type: DateOnly + */ + startDate?: Date | null; + + /** + * The date when the leave ends + * Type: DateOnly + */ + endDate?: Date | null; + + /** Whether the leave was entitled to receive payment */ + isEntitled?: boolean | null; + + /** The status of the leave */ + status?: EmployeeStatutoryLeaveSummaryStatus | null; + } + export interface EmployeeStatutoryLeaveSummaryFormProperties { + + /** The unique identifier (guid) of a statutory leave. */ + statutoryLeaveID: FormControl, + + /** The unique identifier (guid) of the employee */ + employeeID: FormControl, + + /** The category of statutory leave */ + type: FormControl, + + /** + * The date when the leave starts + * Type: DateOnly + */ + startDate: FormControl, + + /** + * The date when the leave ends + * Type: DateOnly + */ + endDate: FormControl, + + /** Whether the leave was entitled to receive payment */ + isEntitled: FormControl, + + /** The status of the leave */ + status: FormControl, + } + export function CreateEmployeeStatutoryLeaveSummaryFormGroup() { + return new FormGroup({ + statutoryLeaveID: new FormControl(undefined), + employeeID: new FormControl(undefined), + type: new FormControl(undefined), + startDate: CreateDateOnlyFormControl(), + endDate: CreateDateOnlyFormControl(), + isEntitled: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export enum EmployeeStatutoryLeaveSummaryStatus { Pending = 0, 'In-Progress' = 1, Completed = 2 } + + export interface EmployeeStatutorySickLeaves { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutorySickLeave?: Array; + } + export interface EmployeeStatutorySickLeavesFormProperties { + } + export function CreateEmployeeStatutorySickLeavesFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeStatutorySickLeave { + + /** The unique identifier (guid) of a statutory leave */ + statutoryLeaveID?: string | null; + + /** + * The unique identifier (guid) of the employee + * Required + */ + employeeID: string; + + /** + * The unique identifier (guid) of the "Statutory Sick Leave (non-pensionable)" pay item + * Required + */ + leaveTypeID: string; + + /** + * The date when the leave starts + * Required + * Type: DateOnly + */ + startDate: Date; + + /** + * The date when the leave ends + * Required + * Type: DateOnly + */ + endDate: Date; + + /** the type of statutory leave */ + type?: string | null; + + /** the type of statutory leave */ + status?: string | null; + + /** + * The days of the work week the employee is scheduled to work at the time the leave is taken + * Required + */ + workPattern: Array; + + /** + * Whether the sick leave was pregnancy related + * Required + */ + isPregnancyRelated: boolean; + + /** + * Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request + * Required + */ + sufficientNotice: boolean; + + /** Whether the leave was entitled to receive payment */ + isEntitled?: boolean | null; + + /** + * The amount of requested time (in weeks) + * Type: double + */ + entitlementWeeksRequested?: number | null; + + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + * Type: double + */ + entitlementWeeksQualified?: number | null; + + /** + * A calculated amount of time (in weeks) that remains for the statutory sick leave period + * Type: double + */ + entitlementWeeksRemaining?: number | null; + + /** Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts */ + overlapsWithOtherLeave?: boolean | null; + + /** If the leave requested was considered "not entitled", the reasons why are listed here. */ + entitlementFailureReasons?: Array; + } + export interface EmployeeStatutorySickLeaveFormProperties { + + /** The unique identifier (guid) of a statutory leave */ + statutoryLeaveID: FormControl, + + /** + * The unique identifier (guid) of the employee + * Required + */ + employeeID: FormControl, + + /** + * The unique identifier (guid) of the "Statutory Sick Leave (non-pensionable)" pay item + * Required + */ + leaveTypeID: FormControl, + + /** + * The date when the leave starts + * Required + * Type: DateOnly + */ + startDate: FormControl, + + /** + * The date when the leave ends + * Required + * Type: DateOnly + */ + endDate: FormControl, + + /** the type of statutory leave */ + type: FormControl, + + /** the type of statutory leave */ + status: FormControl, + + /** + * Whether the sick leave was pregnancy related + * Required + */ + isPregnancyRelated: FormControl, + + /** + * Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request + * Required + */ + sufficientNotice: FormControl, + + /** Whether the leave was entitled to receive payment */ + isEntitled: FormControl, + + /** + * The amount of requested time (in weeks) + * Type: double + */ + entitlementWeeksRequested: FormControl, + + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + * Type: double + */ + entitlementWeeksQualified: FormControl, + + /** + * A calculated amount of time (in weeks) that remains for the statutory sick leave period + * Type: double + */ + entitlementWeeksRemaining: FormControl, + + /** Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts */ + overlapsWithOtherLeave: FormControl, + } + export function CreateEmployeeStatutorySickLeaveFormGroup() { + return new FormGroup({ + statutoryLeaveID: new FormControl(undefined), + employeeID: new FormControl(undefined, [Validators.required]), + leaveTypeID: new FormControl(undefined, [Validators.required]), + startDate: CreateDateOnlyFormControl(), + endDate: CreateDateOnlyFormControl(), + type: new FormControl(undefined), + status: new FormControl(undefined), + isPregnancyRelated: new FormControl(undefined, [Validators.required]), + sufficientNotice: new FormControl(undefined, [Validators.required]), + isEntitled: new FormControl(undefined), + entitlementWeeksRequested: new FormControl(undefined), + entitlementWeeksQualified: new FormControl(undefined), + entitlementWeeksRemaining: new FormControl(undefined), + overlapsWithOtherLeave: new FormControl(undefined), + }); + + } + + export interface EmployeeStatutorySickLeaveObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutorySickLeave?: EmployeeStatutorySickLeave; + } + export interface EmployeeStatutorySickLeaveObjectFormProperties { + } + export function CreateEmployeeStatutorySickLeaveObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeLeaveTypes { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveTypes?: Array; + } + export interface EmployeeLeaveTypesFormProperties { + } + export function CreateEmployeeLeaveTypesFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeeLeaveType { + + /** + * The Xero identifier for leave type + * Required + */ + leaveTypeID: string; + + /** + * The schedule of accrual + * Required + */ + scheduleOfAccrual: EmployeeLeaveTypeScheduleOfAccrual; + + /** + * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is "OnHourWorked" + * Type: double + */ + hoursAccruedAnnually?: number | null; + + /** + * The maximum number of hours that can be accrued for the leave + * Type: double + */ + maximumToAccrue?: number | null; + + /** + * The initial number of hours assigned when the leave was added to the employee + * Type: double + */ + openingBalance?: number | null; + + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is "OnHourWorked" + * Type: double + */ + rateAccruedHourly?: number | null; + } + export interface EmployeeLeaveTypeFormProperties { + + /** + * The Xero identifier for leave type + * Required + */ + leaveTypeID: FormControl, + + /** + * The schedule of accrual + * Required + */ + scheduleOfAccrual: FormControl, + + /** + * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is "OnHourWorked" + * Type: double + */ + hoursAccruedAnnually: FormControl, + + /** + * The maximum number of hours that can be accrued for the leave + * Type: double + */ + maximumToAccrue: FormControl, + + /** + * The initial number of hours assigned when the leave was added to the employee + * Type: double + */ + openingBalance: FormControl, + + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is "OnHourWorked" + * Type: double + */ + rateAccruedHourly: FormControl, + } + export function CreateEmployeeLeaveTypeFormGroup() { + return new FormGroup({ + leaveTypeID: new FormControl(undefined, [Validators.required]), + scheduleOfAccrual: new FormControl(undefined, [Validators.required]), + hoursAccruedAnnually: new FormControl(undefined), + maximumToAccrue: new FormControl(undefined), + openingBalance: new FormControl(undefined), + rateAccruedHourly: new FormControl(undefined), + }); + + } + + export enum EmployeeLeaveTypeScheduleOfAccrual { BeginningOfCalendarYear = 0, OnAnniversaryDate = 1, EachPayPeriod = 2, OnHourWorked = 3 } + + export interface EmployeeLeaveTypeObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveType?: EmployeeLeaveType; + } + export interface EmployeeLeaveTypeObjectFormProperties { + } + export function CreateEmployeeLeaveTypeObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeePayTemplateObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payTemplate?: EmployeePayTemplate; + } + export interface EmployeePayTemplateObjectFormProperties { + } + export function CreateEmployeePayTemplateObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EmployeePayTemplate { + + /** Unique identifier for the employee */ + employeeID?: string | null; + earningTemplates?: Array; + } + export interface EmployeePayTemplateFormProperties { + + /** Unique identifier for the employee */ + employeeID: FormControl, + } + export function CreateEmployeePayTemplateFormGroup() { + return new FormGroup({ + employeeID: new FormControl(undefined), + }); + + } + + export interface EarningsTemplate { + + /** The Xero identifier for the earnings template */ + payTemplateEarningID?: string | null; + + /** + * The rate per unit + * Type: double + */ + ratePerUnit?: number | null; + + /** + * The rate per unit + * Type: double + */ + numberOfUnits?: number | null; + + /** + * The fixed amount per period + * Type: double + */ + fixedAmount?: number | null; + + /** The corresponding earnings rate identifier */ + earningsRateID?: string | null; + + /** The read-only name of the Earning Template. */ + name?: string | null; + } + export interface EarningsTemplateFormProperties { + + /** The Xero identifier for the earnings template */ + payTemplateEarningID: FormControl, + + /** + * The rate per unit + * Type: double + */ + ratePerUnit: FormControl, + + /** + * The rate per unit + * Type: double + */ + numberOfUnits: FormControl, + + /** + * The fixed amount per period + * Type: double + */ + fixedAmount: FormControl, + + /** The corresponding earnings rate identifier */ + earningsRateID: FormControl, + + /** The read-only name of the Earning Template. */ + name: FormControl, + } + export function CreateEarningsTemplateFormGroup() { + return new FormGroup({ + payTemplateEarningID: new FormControl(undefined), + ratePerUnit: new FormControl(undefined), + numberOfUnits: new FormControl(undefined), + fixedAmount: new FormControl(undefined), + earningsRateID: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + export interface EmployeePayTemplates { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningTemplates?: Array; + } + export interface EmployeePayTemplatesFormProperties { + } + export function CreateEmployeePayTemplatesFormGroup() { + return new FormGroup({ + }); + + } + + export interface EarningsTemplateObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningTemplate?: EarningsTemplate; + } + export interface EarningsTemplateObjectFormProperties { + } + export function CreateEarningsTemplateObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Benefits { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + benefits?: Array; + } + export interface BenefitsFormProperties { + } + export function CreateBenefitsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Benefit { + + /** unique identifier in Xero */ + id?: string | null; + + /** + * Name of the employer pension + * Required + */ + name: string; + + /** + * Category type of the employer pension + * Required + */ + category: BenefitCategory; + + /** + * Xero identifier for Liability Account + * Required + */ + liabilityAccountId: string; + + /** + * Xero identifier for Expense Account + * Required + */ + expenseAccountId: string; + + /** + * Standard amount of the employer pension + * Required + * Type: double + */ + standardAmount: number; + + /** + * Percentage of gross of the employer pension + * Required + * Type: double + */ + percentage: number; + + /** + * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). + * Required + */ + calculationType: BenefitCalculationType; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + + /** Identifier of subject To NIC */ + subjectToNIC?: boolean | null; + + /** Identifier of subject To pension */ + subjectToPension?: boolean | null; + + /** Identifier of subject To Tax */ + subjectToTax?: boolean | null; + + /** Identifier of calculating on qualifying earnings */ + isCalculatingOnQualifyingEarnings?: boolean | null; + + /** display the balance to employee */ + showBalanceToEmployee?: boolean | null; + } + export interface BenefitFormProperties { + + /** unique identifier in Xero */ + id: FormControl, + + /** + * Name of the employer pension + * Required + */ + name: FormControl, + + /** + * Category type of the employer pension + * Required + */ + category: FormControl, + + /** + * Xero identifier for Liability Account + * Required + */ + liabilityAccountId: FormControl, + + /** + * Xero identifier for Expense Account + * Required + */ + expenseAccountId: FormControl, + + /** + * Standard amount of the employer pension + * Required + * Type: double + */ + standardAmount: FormControl, + + /** + * Percentage of gross of the employer pension + * Required + * Type: double + */ + percentage: FormControl, + + /** + * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). + * Required + */ + calculationType: FormControl, + + /** Identifier of a record is active or not. */ + currentRecord: FormControl, + + /** Identifier of subject To NIC */ + subjectToNIC: FormControl, + + /** Identifier of subject To pension */ + subjectToPension: FormControl, + + /** Identifier of subject To Tax */ + subjectToTax: FormControl, + + /** Identifier of calculating on qualifying earnings */ + isCalculatingOnQualifyingEarnings: FormControl, + + /** display the balance to employee */ + showBalanceToEmployee: FormControl, + } + export function CreateBenefitFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + category: new FormControl(undefined, [Validators.required]), + liabilityAccountId: new FormControl(undefined, [Validators.required]), + expenseAccountId: new FormControl(undefined, [Validators.required]), + standardAmount: new FormControl(undefined, [Validators.required]), + percentage: new FormControl(undefined, [Validators.required]), + calculationType: new FormControl(undefined, [Validators.required]), + currentRecord: new FormControl(undefined), + subjectToNIC: new FormControl(undefined), + subjectToPension: new FormControl(undefined), + subjectToTax: new FormControl(undefined), + isCalculatingOnQualifyingEarnings: new FormControl(undefined), + showBalanceToEmployee: new FormControl(undefined), + }); + + } + + export enum BenefitCategory { StakeholderPension = 0, Other = 1 } + + export enum BenefitCalculationType { FixedAmount = 0, PercentageOfGross = 1 } + + export interface BenefitObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + benefit?: Benefit; + } + export interface BenefitObjectFormProperties { + } + export function CreateBenefitObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Deductions { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + deductions?: Array; + } + export interface DeductionsFormProperties { + } + export function CreateDeductionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Deduction { + + /** The Xero identifier for Deduction */ + deductionId?: string | null; + + /** + * Name of the deduction + * Required + */ + deductionName: string; + + /** + * Deduction Category type + * Required + */ + deductionCategory: DeductionDeductionCategory; + + /** + * Xero identifier for Liability Account + * Required + */ + liabilityAccountId: string; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + + /** + * Standard amount of the deduction + * Type: double + */ + standardAmount?: number | null; + + /** Identifier of reduces super liability */ + reducesSuperLiability?: boolean | null; + + /** Identifier of reduces tax liability */ + reducesTaxLiability?: boolean | null; + + /** + * determine the calculation type whether fixed amount or percentage of gross + * Required + */ + calculationType: BenefitCalculationType; + + /** + * Percentage of gross + * Type: double + */ + percentage?: number | null; + + /** Identifier of subject To NIC */ + subjectToNIC?: boolean | null; + + /** Identifier of subject To Tax */ + subjectToTax?: boolean | null; + + /** Identifier of reduced by basic rate applicable or not */ + isReducedByBasicRate?: boolean | null; + + /** Identifier for apply to pension calculations */ + applyToPensionCalculations?: boolean | null; + + /** Identifier of calculating on qualifying earnings */ + isCalculatingOnQualifyingEarnings?: boolean | null; + + /** Identifier of applicable for pension or not */ + isPension?: boolean | null; + } + export interface DeductionFormProperties { + + /** The Xero identifier for Deduction */ + deductionId: FormControl, + + /** + * Name of the deduction + * Required + */ + deductionName: FormControl, + + /** + * Deduction Category type + * Required + */ + deductionCategory: FormControl, + + /** + * Xero identifier for Liability Account + * Required + */ + liabilityAccountId: FormControl, + + /** Identifier of a record is active or not. */ + currentRecord: FormControl, + + /** + * Standard amount of the deduction + * Type: double + */ + standardAmount: FormControl, + + /** Identifier of reduces super liability */ + reducesSuperLiability: FormControl, + + /** Identifier of reduces tax liability */ + reducesTaxLiability: FormControl, + + /** + * determine the calculation type whether fixed amount or percentage of gross + * Required + */ + calculationType: FormControl, + + /** + * Percentage of gross + * Type: double + */ + percentage: FormControl, + + /** Identifier of subject To NIC */ + subjectToNIC: FormControl, + + /** Identifier of subject To Tax */ + subjectToTax: FormControl, + + /** Identifier of reduced by basic rate applicable or not */ + isReducedByBasicRate: FormControl, + + /** Identifier for apply to pension calculations */ + applyToPensionCalculations: FormControl, + + /** Identifier of calculating on qualifying earnings */ + isCalculatingOnQualifyingEarnings: FormControl, + + /** Identifier of applicable for pension or not */ + isPension: FormControl, + } + export function CreateDeductionFormGroup() { + return new FormGroup({ + deductionId: new FormControl(undefined), + deductionName: new FormControl(undefined, [Validators.required]), + deductionCategory: new FormControl(undefined, [Validators.required]), + liabilityAccountId: new FormControl(undefined, [Validators.required]), + currentRecord: new FormControl(undefined), + standardAmount: new FormControl(undefined), + reducesSuperLiability: new FormControl(undefined), + reducesTaxLiability: new FormControl(undefined), + calculationType: new FormControl(undefined, [Validators.required]), + percentage: new FormControl(undefined), + subjectToNIC: new FormControl(undefined), + subjectToTax: new FormControl(undefined), + isReducedByBasicRate: new FormControl(undefined), + applyToPensionCalculations: new FormControl(undefined), + isCalculatingOnQualifyingEarnings: new FormControl(undefined), + isPension: new FormControl(undefined), + }); + + } + + export enum DeductionDeductionCategory { StakeholderPension = 0, StakeholderPensionPostTax = 1, ChildCareVoucher = 2, SalarySacrifice = 3, UkOther = 4 } + + export interface DeductionObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + deduction?: Deduction; + } + export interface DeductionObjectFormProperties { + } + export function CreateDeductionObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface StatutoryDeduction { + + /** The Xero identifier for earnings order */ + id?: string | null; + + /** Name of the earnings order */ + name?: string | null; + + /** Statutory Deduction Category */ + statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; + + /** Xero identifier for Liability Account */ + liabilityAccountId?: string | null; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + } + export interface StatutoryDeductionFormProperties { + + /** The Xero identifier for earnings order */ + id: FormControl, + + /** Name of the earnings order */ + name: FormControl, + + /** Statutory Deduction Category */ + statutoryDeductionCategory: FormControl, + + /** Xero identifier for Liability Account */ + liabilityAccountId: FormControl, + + /** Identifier of a record is active or not. */ + currentRecord: FormControl, + } + export function CreateStatutoryDeductionFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined), + statutoryDeductionCategory: new FormControl(undefined), + liabilityAccountId: new FormControl(undefined), + currentRecord: new FormControl(undefined), + }); + + } + + export enum StatutoryDeductionStatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } + + + /** Statutory Deduction Category */ + export enum StatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } + + export interface EarningsOrders { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutoryDeductions?: Array; + } + export interface EarningsOrdersFormProperties { + } + export function CreateEarningsOrdersFormGroup() { + return new FormGroup({ + }); + + } + + export interface EarningsOrder { + + /** Xero unique identifier for an earning rate */ + id?: string | null; + + /** + * Name of the earning order + * Required + */ + name: string; + + /** Statutory Deduction Category */ + statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; + + /** Xero identifier for Liability Account */ + liabilityAccountId?: string | null; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + } + export interface EarningsOrderFormProperties { + + /** Xero unique identifier for an earning rate */ + id: FormControl, + + /** + * Name of the earning order + * Required + */ + name: FormControl, + + /** Statutory Deduction Category */ + statutoryDeductionCategory: FormControl, + + /** Xero identifier for Liability Account */ + liabilityAccountId: FormControl, + + /** Identifier of a record is active or not. */ + currentRecord: FormControl, + } + export function CreateEarningsOrderFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + statutoryDeductionCategory: new FormControl(undefined), + liabilityAccountId: new FormControl(undefined), + currentRecord: new FormControl(undefined), + }); + + } + + export interface EarningsOrderObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutoryDeduction?: EarningsOrder; + } + export interface EarningsOrderObjectFormProperties { + } + export function CreateEarningsOrderObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface EarningsRates { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningsRates?: Array; + } + export interface EarningsRatesFormProperties { + } + export function CreateEarningsRatesFormGroup() { + return new FormGroup({ + }); + + } + + export interface EarningsRate { + + /** Xero unique identifier for an earning rate */ + earningsRateID?: string | null; + + /** + * Name of the earning rate + * Required + */ + name: string; + + /** + * Indicates how an employee will be paid when taking this type of earning + * Required + */ + earningsType: EarningsRateEarningsType; + + /** + * Indicates the type of the earning rate + * Required + */ + rateType: EarningsRateRateType; + + /** + * The type of units used to record earnings + * Required + */ + typeOfUnits: string; + + /** Indicates whether an earning type is active */ + currentRecord?: boolean | null; + + /** + * The account that will be used for the earnings rate + * Required + */ + expenseAccountID: string; + + /** + * Default rate per unit (optional). Only applicable if RateType is RatePerUnit + * Type: double + */ + ratePerUnit?: number | null; + + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + * Type: double + */ + multipleOfOrdinaryEarningsRate?: number | null; + + /** + * Optional Fixed Rate Amount. Applicable for FixedAmount Rate + * Type: double + */ + fixedAmount?: number | null; + } + export interface EarningsRateFormProperties { + + /** Xero unique identifier for an earning rate */ + earningsRateID: FormControl, + + /** + * Name of the earning rate + * Required + */ + name: FormControl, + + /** + * Indicates how an employee will be paid when taking this type of earning + * Required + */ + earningsType: FormControl, + + /** + * Indicates the type of the earning rate + * Required + */ + rateType: FormControl, + + /** + * The type of units used to record earnings + * Required + */ + typeOfUnits: FormControl, + + /** Indicates whether an earning type is active */ + currentRecord: FormControl, + + /** + * The account that will be used for the earnings rate + * Required + */ + expenseAccountID: FormControl, + + /** + * Default rate per unit (optional). Only applicable if RateType is RatePerUnit + * Type: double + */ + ratePerUnit: FormControl, + + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + * Type: double + */ + multipleOfOrdinaryEarningsRate: FormControl, + + /** + * Optional Fixed Rate Amount. Applicable for FixedAmount Rate + * Type: double + */ + fixedAmount: FormControl, + } + export function CreateEarningsRateFormGroup() { + return new FormGroup({ + earningsRateID: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + earningsType: new FormControl(undefined, [Validators.required]), + rateType: new FormControl(undefined, [Validators.required]), + typeOfUnits: new FormControl(undefined, [Validators.required]), + currentRecord: new FormControl(undefined), + expenseAccountID: new FormControl(undefined, [Validators.required]), + ratePerUnit: new FormControl(undefined), + multipleOfOrdinaryEarningsRate: new FormControl(undefined), + fixedAmount: new FormControl(undefined), + }); + + } + + export enum EarningsRateEarningsType { OvertimeEarnings = 0, Allowance = 1, RegularEarnings = 2, Commission = 3, Bonus = 4, 'Tips(Direct)' = 5, 'Tips(Non-Direct)' = 6, Backpay = 7, OtherEarnings = 8, LumpSum = 9 } + + export enum EarningsRateRateType { RatePerUnit = 0, MultipleOfOrdinaryEarningsRate = 1, FixedAmount = 2 } + + export interface EarningsRateObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningsRate?: EarningsRate; + } + export interface EarningsRateObjectFormProperties { + } + export function CreateEarningsRateObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface LeaveTypes { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveTypes?: Array; + } + export interface LeaveTypesFormProperties { + } + export function CreateLeaveTypesFormGroup() { + return new FormGroup({ + }); + + } + + export interface LeaveType { + + /** Xero unique identifier for the leave */ + leaveID?: string | null; + + /** Xero unique identifier for the leave type */ + leaveTypeID?: string | null; + + /** + * Name of the leave type + * Required + */ + name: string; + + /** + * Indicate that an employee will be paid when taking this type of leave + * Required + */ + isPaidLeave: boolean; + + /** + * Indicate that a balance for this leave type to be shown on the employee’s payslips + * Required + */ + showOnPayslip: boolean; + + /** UTC timestamp of last update to the leave type note */ + updatedDateUTC?: Date | null; + + /** Shows whether the leave type is active or not */ + isActive?: boolean | null; + + /** Shows whether the leave type is a statutory leave type or not */ + isStatutoryLeave?: boolean | null; + } + export interface LeaveTypeFormProperties { + + /** Xero unique identifier for the leave */ + leaveID: FormControl, + + /** Xero unique identifier for the leave type */ + leaveTypeID: FormControl, + + /** + * Name of the leave type + * Required + */ + name: FormControl, + + /** + * Indicate that an employee will be paid when taking this type of leave + * Required + */ + isPaidLeave: FormControl, + + /** + * Indicate that a balance for this leave type to be shown on the employee’s payslips + * Required + */ + showOnPayslip: FormControl, + + /** UTC timestamp of last update to the leave type note */ + updatedDateUTC: FormControl, + + /** Shows whether the leave type is active or not */ + isActive: FormControl, + + /** Shows whether the leave type is a statutory leave type or not */ + isStatutoryLeave: FormControl, + } + export function CreateLeaveTypeFormGroup() { + return new FormGroup({ + leaveID: new FormControl(undefined), + leaveTypeID: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + isPaidLeave: new FormControl(undefined, [Validators.required]), + showOnPayslip: new FormControl(undefined, [Validators.required]), + updatedDateUTC: new FormControl(undefined), + isActive: new FormControl(undefined), + isStatutoryLeave: new FormControl(undefined), + }); + + } + + export interface LeaveTypeObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveType?: LeaveType; + } + export interface LeaveTypeObjectFormProperties { + } + export function CreateLeaveTypeObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Reimbursements { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + reimbursements?: Array; + } + export interface ReimbursementsFormProperties { + } + export function CreateReimbursementsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Reimbursement { + + /** Xero unique identifier for a reimbursement */ + reimbursementID?: string | null; + + /** + * Name of the reimbursement + * Required + */ + name: string; + + /** + * Xero unique identifier for the account used for the reimbursement + * Required + */ + accountID: string; + + /** Indicates that whether the reimbursement is active */ + currentRecord?: boolean | null; + } + export interface ReimbursementFormProperties { + + /** Xero unique identifier for a reimbursement */ + reimbursementID: FormControl, + + /** + * Name of the reimbursement + * Required + */ + name: FormControl, + + /** + * Xero unique identifier for the account used for the reimbursement + * Required + */ + accountID: FormControl, + + /** Indicates that whether the reimbursement is active */ + currentRecord: FormControl, + } + export function CreateReimbursementFormGroup() { + return new FormGroup({ + reimbursementID: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + accountID: new FormControl(undefined, [Validators.required]), + currentRecord: new FormControl(undefined), + }); + + } + + export interface ReimbursementObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + reimbursement?: Reimbursement; + } + export interface ReimbursementObjectFormProperties { + } + export function CreateReimbursementObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Timesheets { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + timesheets?: Array; + } + export interface TimesheetsFormProperties { + } + export function CreateTimesheetsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Timesheet { + + /** The Xero identifier for a Timesheet */ + timesheetID?: string | null; + + /** + * The Xero identifier for the Payroll Calandar that the Timesheet applies to + * Required + */ + payrollCalendarID: string; + + /** + * The Xero identifier for the Employee that the Timesheet is for + * Required + */ + employeeID: string; + + /** + * The Start Date of the Timesheet period (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + startDate: Date; + + /** + * The End Date of the Timesheet period (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + endDate: Date; + + /** Status of the timesheet */ + status?: TimesheetStatus | null; + + /** + * The Total Hours of the Timesheet + * Type: double + */ + totalHours?: number | null; + + /** The UTC date time that the Timesheet was last updated */ + updatedDateUTC?: Date | null; + timesheetLines?: Array; + } + export interface TimesheetFormProperties { + + /** The Xero identifier for a Timesheet */ + timesheetID: FormControl, + + /** + * The Xero identifier for the Payroll Calandar that the Timesheet applies to + * Required + */ + payrollCalendarID: FormControl, + + /** + * The Xero identifier for the Employee that the Timesheet is for + * Required + */ + employeeID: FormControl, + + /** + * The Start Date of the Timesheet period (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + startDate: FormControl, + + /** + * The End Date of the Timesheet period (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + endDate: FormControl, + + /** Status of the timesheet */ + status: FormControl, + + /** + * The Total Hours of the Timesheet + * Type: double + */ + totalHours: FormControl, + + /** The UTC date time that the Timesheet was last updated */ + updatedDateUTC: FormControl, + } + export function CreateTimesheetFormGroup() { + return new FormGroup({ + timesheetID: new FormControl(undefined), + payrollCalendarID: new FormControl(undefined, [Validators.required]), + employeeID: new FormControl(undefined, [Validators.required]), + startDate: CreateDateOnlyFormControl(), + endDate: CreateDateOnlyFormControl(), + status: new FormControl(undefined), + totalHours: new FormControl(undefined), + updatedDateUTC: new FormControl(undefined), + }); + + } + + export enum TimesheetStatus { Draft = 0, Approved = 1, Completed = 2 } + + export interface TimesheetLine { + + /** The Xero identifier for a Timesheet Line */ + timesheetLineID?: string | null; + + /** + * The Date that this Timesheet Line is for (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + date: Date; + + /** + * The Xero identifier for the Earnings Rate that the Timesheet is for + * Required + */ + earningsRateID: string; + + /** The Xero identifier for the Tracking Item that the Timesheet is for */ + trackingItemID?: string | null; + + /** + * The Number of Units of the Timesheet Line + * Required + * Type: double + */ + numberOfUnits: number; + } + export interface TimesheetLineFormProperties { + + /** The Xero identifier for a Timesheet Line */ + timesheetLineID: FormControl, + + /** + * The Date that this Timesheet Line is for (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + date: FormControl, + + /** + * The Xero identifier for the Earnings Rate that the Timesheet is for + * Required + */ + earningsRateID: FormControl, + + /** The Xero identifier for the Tracking Item that the Timesheet is for */ + trackingItemID: FormControl, + + /** + * The Number of Units of the Timesheet Line + * Required + * Type: double + */ + numberOfUnits: FormControl, + } + export function CreateTimesheetLineFormGroup() { + return new FormGroup({ + timesheetLineID: new FormControl(undefined), + date: CreateDateOnlyFormControl(), + earningsRateID: new FormControl(undefined, [Validators.required]), + trackingItemID: new FormControl(undefined), + numberOfUnits: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface TimesheetObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + timesheet?: Timesheet; + } + export interface TimesheetObjectFormProperties { + } + export function CreateTimesheetObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface TimesheetLineObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + timesheetLine?: TimesheetLine; + } + export interface TimesheetLineObjectFormProperties { + } + export function CreateTimesheetLineObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayRunCalendars { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRunCalendars?: Array; + } + export interface PayRunCalendarsFormProperties { + } + export function CreatePayRunCalendarsFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayRunCalendar { + + /** Xero unique identifier for the payroll calendar */ + payrollCalendarID?: string | null; + + /** + * Name of the calendar + * Required + */ + name: string; + + /** + * Type of the calendar + * Required + */ + calendarType: PayRunCalendarCalendarType; + + /** + * Period start date of the calendar + * Required + * Type: DateOnly + */ + periodStartDate: Date; + + /** + * Period end date of the calendar + * Type: DateOnly + */ + periodEndDate?: Date | null; + + /** + * Payment date of the calendar + * Required + * Type: DateOnly + */ + paymentDate: Date; + + /** UTC timestamp of the last update to the pay run calendar */ + updatedDateUTC?: Date | null; + } + export interface PayRunCalendarFormProperties { + + /** Xero unique identifier for the payroll calendar */ + payrollCalendarID: FormControl, + + /** + * Name of the calendar + * Required + */ + name: FormControl, + + /** + * Type of the calendar + * Required + */ + calendarType: FormControl, + + /** + * Period start date of the calendar + * Required + * Type: DateOnly + */ + periodStartDate: FormControl, + + /** + * Period end date of the calendar + * Type: DateOnly + */ + periodEndDate: FormControl, + + /** + * Payment date of the calendar + * Required + * Type: DateOnly + */ + paymentDate: FormControl, + + /** UTC timestamp of the last update to the pay run calendar */ + updatedDateUTC: FormControl, + } + export function CreatePayRunCalendarFormGroup() { + return new FormGroup({ + payrollCalendarID: new FormControl(undefined), + name: new FormControl(undefined, [Validators.required]), + calendarType: new FormControl(undefined, [Validators.required]), + periodStartDate: CreateDateOnlyFormControl(), + periodEndDate: CreateDateOnlyFormControl(), + paymentDate: CreateDateOnlyFormControl(), + updatedDateUTC: new FormControl(undefined), + }); + + } + + export enum PayRunCalendarCalendarType { Weekly = 0, Fortnightly = 1, FourWeekly = 2, Monthly = 3, Annual = 4, Quarterly = 5 } + + export interface PayRunCalendarObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRunCalendar?: PayRunCalendar; + } + export interface PayRunCalendarObjectFormProperties { + } + export function CreatePayRunCalendarObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface PaymentMethodObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + paymentMethod?: PaymentMethod; + } + export interface PaymentMethodObjectFormProperties { + } + export function CreatePaymentMethodObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface PaymentMethod { + + /** + * The payment method code + * Required + */ + paymentMethod: PaymentMethodPaymentMethod; + bankAccounts?: Array; + } + export interface PaymentMethodFormProperties { + + /** + * The payment method code + * Required + */ + paymentMethod: FormControl, + } + export function CreatePaymentMethodFormGroup() { + return new FormGroup({ + paymentMethod: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum PaymentMethodPaymentMethod { Cheque = 0, Electronically = 1, Manual = 2 } + + export interface BankAccount { + + /** + * Bank account name (max length = 32) + * Required + */ + accountName: string; + + /** + * Bank account number (digits only; max length = 8) + * Required + */ + accountNumber: string; + + /** + * Bank account sort code (6 digits) + * Required + */ + sortCode: string; + } + export interface BankAccountFormProperties { + + /** + * Bank account name (max length = 32) + * Required + */ + accountName: FormControl, + + /** + * Bank account number (digits only; max length = 8) + * Required + */ + accountNumber: FormControl, + + /** + * Bank account sort code (6 digits) + * Required + */ + sortCode: FormControl, + } + export function CreateBankAccountFormGroup() { + return new FormGroup({ + accountName: new FormControl(undefined, [Validators.required]), + accountNumber: new FormControl(undefined, [Validators.required]), + sortCode: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface SalaryAndWages { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + salaryAndWages?: Array; + } + export interface SalaryAndWagesFormProperties { + } + export function CreateSalaryAndWagesFormGroup() { + return new FormGroup({ + }); + + } + + export interface SalaryAndWage { + + /** Xero unique identifier for a salary and wages record */ + salaryAndWagesID?: string | null; + + /** + * Xero unique identifier for an earnings rate + * Required + */ + earningsRateID: string; + + /** + * The Number of Units per week for the corresponding salary and wages + * Required + * Type: double + */ + numberOfUnitsPerWeek: number; + + /** + * The rate of each unit for the corresponding salary and wages + * Required + * Type: double + */ + ratePerUnit: number; + + /** + * The Number of Units per day for the corresponding salary and wages + * Required + * Type: double + */ + numberOfUnitsPerDay: number; + + /** + * The effective date of the corresponding salary and wages + * Required + * Type: DateOnly + */ + effectiveFrom: Date; + + /** + * The annual salary + * Required + * Type: double + */ + annualSalary: number; + + /** + * The current status of the corresponding salary and wages + * Required + */ + status: SalaryAndWageStatus; + + /** + * The type of the payment of the corresponding salary and wages + * Required + */ + paymentType: SalaryAndWagePaymentType; + } + export interface SalaryAndWageFormProperties { + + /** Xero unique identifier for a salary and wages record */ + salaryAndWagesID: FormControl, + + /** + * Xero unique identifier for an earnings rate + * Required + */ + earningsRateID: FormControl, + + /** + * The Number of Units per week for the corresponding salary and wages + * Required + * Type: double + */ + numberOfUnitsPerWeek: FormControl, + + /** + * The rate of each unit for the corresponding salary and wages + * Required + * Type: double + */ + ratePerUnit: FormControl, + + /** + * The Number of Units per day for the corresponding salary and wages + * Required + * Type: double + */ + numberOfUnitsPerDay: FormControl, + + /** + * The effective date of the corresponding salary and wages + * Required + * Type: DateOnly + */ + effectiveFrom: FormControl, + + /** + * The annual salary + * Required + * Type: double + */ + annualSalary: FormControl, + + /** + * The current status of the corresponding salary and wages + * Required + */ + status: FormControl, + + /** + * The type of the payment of the corresponding salary and wages + * Required + */ + paymentType: FormControl, + } + export function CreateSalaryAndWageFormGroup() { + return new FormGroup({ + salaryAndWagesID: new FormControl(undefined), + earningsRateID: new FormControl(undefined, [Validators.required]), + numberOfUnitsPerWeek: new FormControl(undefined, [Validators.required]), + ratePerUnit: new FormControl(undefined, [Validators.required]), + numberOfUnitsPerDay: new FormControl(undefined, [Validators.required]), + effectiveFrom: CreateDateOnlyFormControl(), + annualSalary: new FormControl(undefined, [Validators.required]), + status: new FormControl(undefined, [Validators.required]), + paymentType: new FormControl(undefined, [Validators.required]), + }); + + } + + export enum SalaryAndWageStatus { Active = 0, Pending = 1 } + + export enum SalaryAndWagePaymentType { Salary = 0 } + + export interface SalaryAndWageObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + salaryAndWages?: SalaryAndWage; + } + export interface SalaryAndWageObjectFormProperties { + } + export function CreateSalaryAndWageObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayRuns { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRuns?: Array; + } + export interface PayRunsFormProperties { + } + export function CreatePayRunsFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayRun { + + /** Xero unique identifier for the pay run */ + payRunID?: string | null; + + /** Xero unique identifier for the payroll calendar */ + payrollCalendarID?: string | null; + + /** + * Period start date of the payroll calendar + * Type: DateOnly + */ + periodStartDate?: Date | null; + + /** + * Period end date of the payroll calendar + * Type: DateOnly + */ + periodEndDate?: Date | null; + + /** + * Payment date of the pay run + * Type: DateOnly + */ + paymentDate?: Date | null; + + /** + * Total cost of the pay run + * Type: double + */ + totalCost?: number | null; + + /** + * Total pay of the pay run + * Type: double + */ + totalPay?: number | null; + + /** Pay run status */ + payRunStatus?: PayRunPayRunStatus | null; + + /** Pay run type */ + payRunType?: PayRunPayRunType | null; + + /** Calendar type of the pay run */ + calendarType?: PayRunCalendarCalendarType | null; + + /** + * Posted date time of the pay run + * Type: DateOnly + */ + postedDateTime?: Date | null; + paySlips?: Array; + } + export interface PayRunFormProperties { + + /** Xero unique identifier for the pay run */ + payRunID: FormControl, + + /** Xero unique identifier for the payroll calendar */ + payrollCalendarID: FormControl, + + /** + * Period start date of the payroll calendar + * Type: DateOnly + */ + periodStartDate: FormControl, + + /** + * Period end date of the payroll calendar + * Type: DateOnly + */ + periodEndDate: FormControl, + + /** + * Payment date of the pay run + * Type: DateOnly + */ + paymentDate: FormControl, + + /** + * Total cost of the pay run + * Type: double + */ + totalCost: FormControl, + + /** + * Total pay of the pay run + * Type: double + */ + totalPay: FormControl, + + /** Pay run status */ + payRunStatus: FormControl, + + /** Pay run type */ + payRunType: FormControl, + + /** Calendar type of the pay run */ + calendarType: FormControl, + + /** + * Posted date time of the pay run + * Type: DateOnly + */ + postedDateTime: FormControl, + } + export function CreatePayRunFormGroup() { + return new FormGroup({ + payRunID: new FormControl(undefined), + payrollCalendarID: new FormControl(undefined), + periodStartDate: CreateDateOnlyFormControl(), + periodEndDate: CreateDateOnlyFormControl(), + paymentDate: CreateDateOnlyFormControl(), + totalCost: new FormControl(undefined), + totalPay: new FormControl(undefined), + payRunStatus: new FormControl(undefined), + payRunType: new FormControl(undefined), + calendarType: new FormControl(undefined), + postedDateTime: CreateDateOnlyFormControl(), + }); + + } + + export enum PayRunPayRunStatus { Draft = 0, Posted = 1 } + + export enum PayRunPayRunType { Scheduled = 0, Unscheduled = 1, EarlierYearUpdate = 2 } + + export interface Payslip { + + /** The Xero identifier for a Payslip */ + paySlipID?: string | null; + + /** The Xero identifier for payroll employee */ + employeeID?: string | null; + + /** The Xero identifier for the associated payrun */ + payRunID?: string | null; + + /** + * The date payslip was last updated + * Type: DateOnly + */ + lastEdited?: Date | null; + + /** Employee first name */ + firstName?: string | null; + + /** Employee last name */ + lastName?: string | null; + + /** + * Total earnings before any deductions. Same as gross earnings for UK. + * Type: double + */ + totalEarnings?: number | null; + + /** + * Total earnings before any deductions. Same as total earnings for UK. + * Type: double + */ + grossEarnings?: number | null; + + /** + * The employee net pay + * Type: double + */ + totalPay?: number | null; + + /** + * The employer's tax obligation + * Type: double + */ + totalEmployerTaxes?: number | null; + + /** + * The part of an employee's earnings that is deducted for tax purposes + * Type: double + */ + totalEmployeeTaxes?: number | null; + + /** + * Total amount subtracted from an employee's earnings to reach total pay + * Type: double + */ + totalDeductions?: number | null; + + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + * Type: double + */ + totalReimbursements?: number | null; + + /** + * Total amounts required by law to subtract from the employee's earnings + * Type: double + */ + totalCourtOrders?: number | null; + + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + * Type: double + */ + totalBenefits?: number | null; + + /** BACS Service User Number */ + bacsHash?: string | null; + + /** The payment method code */ + paymentMethod?: PaymentMethodPaymentMethod | null; + earningsLines?: Array; + leaveEarningsLines?: Array; + timesheetEarningsLines?: Array; + deductionLines?: Array; + reimbursementLines?: Array; + leaveAccrualLines?: Array; + benefitLines?: Array; + paymentLines?: Array; + employeeTaxLines?: Array; + courtOrderLines?: Array; + } + export interface PayslipFormProperties { + + /** The Xero identifier for a Payslip */ + paySlipID: FormControl, + + /** The Xero identifier for payroll employee */ + employeeID: FormControl, + + /** The Xero identifier for the associated payrun */ + payRunID: FormControl, + + /** + * The date payslip was last updated + * Type: DateOnly + */ + lastEdited: FormControl, + + /** Employee first name */ + firstName: FormControl, + + /** Employee last name */ + lastName: FormControl, + + /** + * Total earnings before any deductions. Same as gross earnings for UK. + * Type: double + */ + totalEarnings: FormControl, + + /** + * Total earnings before any deductions. Same as total earnings for UK. + * Type: double + */ + grossEarnings: FormControl, + + /** + * The employee net pay + * Type: double + */ + totalPay: FormControl, + + /** + * The employer's tax obligation + * Type: double + */ + totalEmployerTaxes: FormControl, + + /** + * The part of an employee's earnings that is deducted for tax purposes + * Type: double + */ + totalEmployeeTaxes: FormControl, + + /** + * Total amount subtracted from an employee's earnings to reach total pay + * Type: double + */ + totalDeductions: FormControl, + + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + * Type: double + */ + totalReimbursements: FormControl, + + /** + * Total amounts required by law to subtract from the employee's earnings + * Type: double + */ + totalCourtOrders: FormControl, + + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + * Type: double + */ + totalBenefits: FormControl, + + /** BACS Service User Number */ + bacsHash: FormControl, + + /** The payment method code */ + paymentMethod: FormControl, + } + export function CreatePayslipFormGroup() { + return new FormGroup({ + paySlipID: new FormControl(undefined), + employeeID: new FormControl(undefined), + payRunID: new FormControl(undefined), + lastEdited: CreateDateOnlyFormControl(), + firstName: new FormControl(undefined), + lastName: new FormControl(undefined), + totalEarnings: new FormControl(undefined), + grossEarnings: new FormControl(undefined), + totalPay: new FormControl(undefined), + totalEmployerTaxes: new FormControl(undefined), + totalEmployeeTaxes: new FormControl(undefined), + totalDeductions: new FormControl(undefined), + totalReimbursements: new FormControl(undefined), + totalCourtOrders: new FormControl(undefined), + totalBenefits: new FormControl(undefined), + bacsHash: new FormControl(undefined), + paymentMethod: new FormControl(undefined), + }); + + } + + export interface EarningsLine { + + /** Xero identifier for payroll earnings line */ + earningsLineID?: string | null; + + /** Xero identifier for payroll earnings rate */ + earningsRateID?: string | null; + + /** name of earnings rate for display in UI */ + displayName?: string | null; + + /** + * Rate per unit for earnings line + * Type: double + */ + ratePerUnit?: number | null; + + /** + * Earnings number of units + * Type: double + */ + numberOfUnits?: number | null; + + /** + * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount?: number | null; + + /** + * The amount of the earnings line. + * Type: double + */ + amount?: number | null; + + /** Identifies if the earnings is taken from the timesheet. False for earnings line */ + isLinkedToTimesheet?: boolean | null; + + /** Identifies if the earnings is using an average daily pay rate */ + isAverageDailyPayRate?: boolean | null; + } + export interface EarningsLineFormProperties { + + /** Xero identifier for payroll earnings line */ + earningsLineID: FormControl, + + /** Xero identifier for payroll earnings rate */ + earningsRateID: FormControl, + + /** name of earnings rate for display in UI */ + displayName: FormControl, + + /** + * Rate per unit for earnings line + * Type: double + */ + ratePerUnit: FormControl, + + /** + * Earnings number of units + * Type: double + */ + numberOfUnits: FormControl, + + /** + * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount: FormControl, + + /** + * The amount of the earnings line. + * Type: double + */ + amount: FormControl, + + /** Identifies if the earnings is taken from the timesheet. False for earnings line */ + isLinkedToTimesheet: FormControl, + + /** Identifies if the earnings is using an average daily pay rate */ + isAverageDailyPayRate: FormControl, + } + export function CreateEarningsLineFormGroup() { + return new FormGroup({ + earningsLineID: new FormControl(undefined), + earningsRateID: new FormControl(undefined), + displayName: new FormControl(undefined), + ratePerUnit: new FormControl(undefined), + numberOfUnits: new FormControl(undefined), + fixedAmount: new FormControl(undefined), + amount: new FormControl(undefined), + isLinkedToTimesheet: new FormControl(undefined), + isAverageDailyPayRate: new FormControl(undefined), + }); + + } + + export interface LeaveEarningsLine { + + /** Xero identifier for payroll leave earnings rate */ + earningsRateID?: string | null; + + /** + * Rate per unit for leave earnings line + * Type: double + */ + ratePerUnit?: number | null; + + /** + * Leave earnings number of units + * Type: double + */ + numberOfUnits?: number | null; + + /** + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount?: number | null; + + /** + * The amount of the earnings line. + * Type: double + */ + amount?: number | null; + + /** Identifies if the leave earnings is taken from the timesheet. False for leave earnings line */ + isLinkedToTimesheet?: boolean | null; + } + export interface LeaveEarningsLineFormProperties { + + /** Xero identifier for payroll leave earnings rate */ + earningsRateID: FormControl, + + /** + * Rate per unit for leave earnings line + * Type: double + */ + ratePerUnit: FormControl, + + /** + * Leave earnings number of units + * Type: double + */ + numberOfUnits: FormControl, + + /** + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount: FormControl, + + /** + * The amount of the earnings line. + * Type: double + */ + amount: FormControl, + + /** Identifies if the leave earnings is taken from the timesheet. False for leave earnings line */ + isLinkedToTimesheet: FormControl, + } + export function CreateLeaveEarningsLineFormGroup() { + return new FormGroup({ + earningsRateID: new FormControl(undefined), + ratePerUnit: new FormControl(undefined), + numberOfUnits: new FormControl(undefined), + fixedAmount: new FormControl(undefined), + amount: new FormControl(undefined), + isLinkedToTimesheet: new FormControl(undefined), + }); + + } + + export interface TimesheetEarningsLine { + + /** Xero identifier for payroll timesheet earnings rate */ + earningsRateID?: string | null; + + /** + * Rate per unit for timesheet earnings line + * Type: double + */ + ratePerUnit?: number | null; + + /** + * Timesheet earnings number of units + * Type: double + */ + numberOfUnits?: number | null; + + /** + * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount?: number | null; + + /** + * The amount of the timesheet earnings line. + * Type: double + */ + amount?: number | null; + + /** Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line */ + isLinkedToTimesheet?: boolean | null; + } + export interface TimesheetEarningsLineFormProperties { + + /** Xero identifier for payroll timesheet earnings rate */ + earningsRateID: FormControl, + + /** + * Rate per unit for timesheet earnings line + * Type: double + */ + ratePerUnit: FormControl, + + /** + * Timesheet earnings number of units + * Type: double + */ + numberOfUnits: FormControl, + + /** + * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount: FormControl, + + /** + * The amount of the timesheet earnings line. + * Type: double + */ + amount: FormControl, + + /** Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line */ + isLinkedToTimesheet: FormControl, + } + export function CreateTimesheetEarningsLineFormGroup() { + return new FormGroup({ + earningsRateID: new FormControl(undefined), + ratePerUnit: new FormControl(undefined), + numberOfUnits: new FormControl(undefined), + fixedAmount: new FormControl(undefined), + amount: new FormControl(undefined), + isLinkedToTimesheet: new FormControl(undefined), + }); + + } + + export interface DeductionLine { + + /** Xero identifier for payroll deduction */ + deductionTypeID?: string | null; + + /** + * The amount of the deduction line + * Type: double + */ + amount?: number | null; + + /** Identifies if the deduction is subject to tax */ + subjectToTax?: boolean | null; + + /** + * Deduction rate percentage + * Type: double + */ + percentage?: number | null; + } + export interface DeductionLineFormProperties { + + /** Xero identifier for payroll deduction */ + deductionTypeID: FormControl, + + /** + * The amount of the deduction line + * Type: double + */ + amount: FormControl, + + /** Identifies if the deduction is subject to tax */ + subjectToTax: FormControl, + + /** + * Deduction rate percentage + * Type: double + */ + percentage: FormControl, + } + export function CreateDeductionLineFormGroup() { + return new FormGroup({ + deductionTypeID: new FormControl(undefined), + amount: new FormControl(undefined), + subjectToTax: new FormControl(undefined), + percentage: new FormControl(undefined), + }); + + } + + export interface ReimbursementLine { + + /** Xero identifier for payroll reimbursement */ + reimbursementTypeID?: string | null; + + /** Reimbursement line description */ + description?: string | null; + + /** + * Reimbursement amount + * Type: double + */ + amount?: number | null; + } + export interface ReimbursementLineFormProperties { + + /** Xero identifier for payroll reimbursement */ + reimbursementTypeID: FormControl, + + /** Reimbursement line description */ + description: FormControl, + + /** + * Reimbursement amount + * Type: double + */ + amount: FormControl, + } + export function CreateReimbursementLineFormGroup() { + return new FormGroup({ + reimbursementTypeID: new FormControl(undefined), + description: new FormControl(undefined), + amount: new FormControl(undefined), + }); + + } + + export interface LeaveAccrualLine { + + /** Xero identifier for the Leave type */ + leaveTypeID?: string | null; + + /** + * Leave accrual number of units + * Type: double + */ + numberOfUnits?: number | null; + } + export interface LeaveAccrualLineFormProperties { + + /** Xero identifier for the Leave type */ + leaveTypeID: FormControl, + + /** + * Leave accrual number of units + * Type: double + */ + numberOfUnits: FormControl, + } + export function CreateLeaveAccrualLineFormGroup() { + return new FormGroup({ + leaveTypeID: new FormControl(undefined), + numberOfUnits: new FormControl(undefined), + }); + + } + + export interface BenefitLine { + + /** Xero identifier for payroll benefit type */ + benefitTypeID?: string | null; + + /** Benefit display name */ + displayName?: string | null; + + /** + * The amount of the benefit line. + * Type: double + */ + amount?: number | null; + + /** + * Benefit fixed amount + * Type: double + */ + fixedAmount?: number | null; + + /** + * Benefit rate percentage + * Type: double + */ + percentage?: number | null; + } + export interface BenefitLineFormProperties { + + /** Xero identifier for payroll benefit type */ + benefitTypeID: FormControl, + + /** Benefit display name */ + displayName: FormControl, + + /** + * The amount of the benefit line. + * Type: double + */ + amount: FormControl, + + /** + * Benefit fixed amount + * Type: double + */ + fixedAmount: FormControl, + + /** + * Benefit rate percentage + * Type: double + */ + percentage: FormControl, + } + export function CreateBenefitLineFormGroup() { + return new FormGroup({ + benefitTypeID: new FormControl(undefined), + displayName: new FormControl(undefined), + amount: new FormControl(undefined), + fixedAmount: new FormControl(undefined), + percentage: new FormControl(undefined), + }); + + } + + export interface PaymentLine { + + /** Xero identifier for payroll payment line */ + paymentLineID?: string | null; + + /** + * The amount of the payment line + * Type: double + */ + amount?: number | null; + + /** The account number */ + accountNumber?: string | null; + + /** The account sort code */ + sortCode?: string | null; + + /** The account name */ + accountName?: string | null; + } + export interface PaymentLineFormProperties { + + /** Xero identifier for payroll payment line */ + paymentLineID: FormControl, + + /** + * The amount of the payment line + * Type: double + */ + amount: FormControl, + + /** The account number */ + accountNumber: FormControl, + + /** The account sort code */ + sortCode: FormControl, + + /** The account name */ + accountName: FormControl, + } + export function CreatePaymentLineFormGroup() { + return new FormGroup({ + paymentLineID: new FormControl(undefined), + amount: new FormControl(undefined), + accountNumber: new FormControl(undefined), + sortCode: new FormControl(undefined), + accountName: new FormControl(undefined), + }); + + } + + export interface TaxLine { + + /** Xero identifier for payroll tax line */ + taxLineID?: string | null; + + /** Tax line description */ + description?: string | null; + + /** Identifies if the amount is paid for by the employee or employer. True if employer pays the tax */ + isEmployerTax?: boolean | null; + + /** + * The amount of the tax line + * Type: double + */ + amount?: number | null; + + /** Tax type ID */ + globalTaxTypeID?: string | null; + + /** Identifies if the tax line is a manual adjustment */ + manualAdjustment?: boolean | null; + } + export interface TaxLineFormProperties { + + /** Xero identifier for payroll tax line */ + taxLineID: FormControl, + + /** Tax line description */ + description: FormControl, + + /** Identifies if the amount is paid for by the employee or employer. True if employer pays the tax */ + isEmployerTax: FormControl, + + /** + * The amount of the tax line + * Type: double + */ + amount: FormControl, + + /** Tax type ID */ + globalTaxTypeID: FormControl, + + /** Identifies if the tax line is a manual adjustment */ + manualAdjustment: FormControl, + } + export function CreateTaxLineFormGroup() { + return new FormGroup({ + taxLineID: new FormControl(undefined), + description: new FormControl(undefined), + isEmployerTax: new FormControl(undefined), + amount: new FormControl(undefined), + globalTaxTypeID: new FormControl(undefined), + manualAdjustment: new FormControl(undefined), + }); + + } + + export interface CourtOrderLine { + + /** Xero identifier for payroll court order type */ + courtOrderTypeID?: string | null; + + /** + * Amount + * Type: double + */ + amount?: number | null; + } + export interface CourtOrderLineFormProperties { + + /** Xero identifier for payroll court order type */ + courtOrderTypeID: FormControl, + + /** + * Amount + * Type: double + */ + amount: FormControl, + } + export function CreateCourtOrderLineFormGroup() { + return new FormGroup({ + courtOrderTypeID: new FormControl(undefined), + amount: new FormControl(undefined), + }); + + } + + export interface PayRunObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRun?: PayRun; + } + export interface PayRunObjectFormProperties { + } + export function CreatePayRunObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface PayslipObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + paySlip?: Payslip; + } + export interface PayslipObjectFormProperties { + } + export function CreatePayslipObjectFormGroup() { + return new FormGroup({ + }); + + } + + export interface Payslips { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + paySlips?: Array; + } + export interface PayslipsFormProperties { + } + export function CreatePayslipsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Settings { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + settings?: Accounts; + } + export interface SettingsFormProperties { + } + export function CreateSettingsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Accounts { + accounts?: Array; + } + export interface AccountsFormProperties { + } + export function CreateAccountsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Account { + + /** The Xero identifier for Settings. */ + accountID?: string | null; + + /** The assigned AccountType */ + type?: AccountType | null; + + /** A unique 3 digit number for each Account */ + code?: string | null; + + /** Name of the Account. */ + name?: string | null; + } + export interface AccountFormProperties { + + /** The Xero identifier for Settings. */ + accountID: FormControl, + + /** The assigned AccountType */ + type: FormControl, + + /** A unique 3 digit number for each Account */ + code: FormControl, + + /** Name of the Account. */ + name: FormControl, + } + export function CreateAccountFormGroup() { + return new FormGroup({ + accountID: new FormControl(undefined), + type: new FormControl(undefined), + code: new FormControl(undefined), + name: new FormControl(undefined), + }); + + } + + export enum AccountType { BANK = 0, EMPLOYERSNIC = 1, NICLIABILITY = 2, PAYEECONTRIBUTION = 3, PAYELIABILITY = 4, WAGESPAYABLE = 5, WAGESEXPENSE = 6 } + + export interface TrackingCategories { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + trackingCategories?: TrackingCategory; + } + export interface TrackingCategoriesFormProperties { + } + export function CreateTrackingCategoriesFormGroup() { + return new FormGroup({ + }); + + } + + export interface TrackingCategory { + + /** The Xero identifier for Employee groups tracking category. */ + employeeGroupsTrackingCategoryID?: string | null; + + /** The Xero identifier for Timesheet tracking category. */ + timesheetTrackingCategoryID?: string | null; + } + export interface TrackingCategoryFormProperties { + + /** The Xero identifier for Employee groups tracking category. */ + employeeGroupsTrackingCategoryID: FormControl, + + /** The Xero identifier for Timesheet tracking category. */ + timesheetTrackingCategoryID: FormControl, + } + export function CreateTrackingCategoryFormGroup() { + return new FormGroup({ + employeeGroupsTrackingCategoryID: new FormControl(undefined), + timesheetTrackingCategoryID: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches employees + * Get Employees + * @param {string} firstName Filter by first name + * @param {string} lastName Filter by last name + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Employees} search results matching criteria + */ + GetEmployees(firstName: string | null | undefined, lastName: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees?firstName=' + (firstName == null ? '' : encodeURIComponent(firstName)) + '&lastName=' + (lastName == null ? '' : encodeURIComponent(lastName)) + '&page=' + page, {}); + } + + /** + * creates employees + * Post Employees + * @return {EmployeeObject} search results matching criteria + */ + CreateEmployee(requestBody: Employee): Observable { + return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches employees + * Get Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeObject} search results matching criteria + */ + GetEmployee(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); + } + + /** + * updates employee + * Put Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeObject} successful response + */ + UpdateEmployee(EmployeeId: string, requestBody: Employee): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * creates employment + * Post Employees/{EmployeeId}/Employment + * @param {string} EmployeeId Employee id for single object + * @return {EmploymentObject} search results matching criteria + */ + CreateEmployment(EmployeeId: string, requestBody: Employment): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Employment', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches tax records for an employee + * Get Employees/{EmployeeId}/Tax + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeTaxObject} search results matching criteria + */ + GetEmployeeTax(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Tax', {}); + } + + /** + * retrieve employee openingbalances + * Get Employees/{EmployeeId}/ukopeningbalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeOpeningBalancesObject} search results matching criteria + */ + GetEmployeeOpeningBalances(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', {}); + } + + /** + * creates employee opening balances + * Post Employees/{EmployeeId}/ukopeningbalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeOpeningBalancesObject} search results matching criteria + */ + CreateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * updates employee opening balances + * Put Employees/{EmployeeId}/ukopeningbalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeOpeningBalancesObject} successful response + */ + UpdateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * search employee leave records + * Get Employees/{EmployeeId}/Leave + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaves} search results matching criteria + */ + GetEmployeeLeaves(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', {}); + } + + /** + * creates employee leave records + * Post Employees/{EmployeeId}/Leave + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveObject} search results matching criteria + */ + CreateEmployeeLeave(EmployeeId: string, requestBody: EmployeeLeave): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single employee leave record + * Get Employees/{EmployeeId}/Leave/{LeaveID} + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveID Leave id for single object + * @return {EmployeeLeaveObject} search results matching criteria + */ + GetEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); + } + + /** + * updates employee leave records + * Put Employees/{EmployeeId}/Leave/{LeaveID} + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveID Leave id for single object + * @return {EmployeeLeaveObject} successful response + */ + UpdateEmployeeLeave(EmployeeId: string, LeaveID: string, requestBody: EmployeeLeave): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * deletes an employee leave record + * Delete Employees/{EmployeeId}/Leave/{LeaveID} + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveID Leave id for single object + * @return {EmployeeLeaveObject} successful response + */ + DeleteEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { + return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); + } + + /** + * search employee leave balances + * Get Employees/{EmployeeId}/LeaveBalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveBalances} search results matching criteria + */ + GetEmployeeLeaveBalances(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveBalances', {}); + } + + /** + * search employee leave balances + * Get Employees/{EmployeeId}/StatutoryLeaveBalance + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveType Filter by the type of statutory leave + * @param {Date} AsOfDate The date from which to calculate balance remaining. If not specified, current date UTC is used. + * Type: DateOnly + * @return {EmployeeStatutoryLeaveBalanceObject} search results matching criteria + */ + GetEmployeeStatutoryLeaveBalances(EmployeeId: string, LeaveType: string | null | undefined, AsOfDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/StatutoryLeaveBalance&LeaveType=' + (LeaveType == null ? '' : encodeURIComponent(LeaveType)) + '&AsOfDate=' + AsOfDate?.toISOString(), {}); + } + + /** + * retrieve a summary of statutory leaves for an employee + * Get statutoryleaves/summary/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @param {boolean} activeOnly Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned + * @return {EmployeeStatutoryLeavesSummaries} search results matching criteria + */ + GetStatutoryLeaveSummary(EmployeeId: string, activeOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'statutoryleaves/summary/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '&activeOnly=' + activeOnly, {}); + } + + /** + * creates employee statutory sick leave records + * Post StatutoryLeaves/Sick + * @return {EmployeeStatutorySickLeaveObject} search results matching criteria + */ + CreateEmployeeStatutorySickLeave(requestBody: EmployeeStatutorySickLeave): Observable { + return this.http.post(this.baseUri + 'StatutoryLeaves/Sick', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a statutory sick leave for an employee + * Get StatutoryLeaves/Sick/{StatutorySickLeaveID} + * @param {string} StatutorySickLeaveID Statutory sick leave id for single object + * @return {EmployeeStatutorySickLeaveObject} search results matching criteria + */ + GetEmployeeStatutorySickLeave(StatutorySickLeaveID: string): Observable { + return this.http.get(this.baseUri + 'StatutoryLeaves/Sick/' + (StatutorySickLeaveID == null ? '' : encodeURIComponent(StatutorySickLeaveID)), {}); + } + + /** + * searches employee leave periods + * Get Employees/{EmployeeId}/LeavePeriods + * @param {string} EmployeeId Employee id for single object + * @param {Date} startDate Filter by start date + * Type: DateOnly + * @param {Date} endDate Filter by end date + * Type: DateOnly + * @return {LeavePeriods} search results matching criteria + */ + GetEmployeeLeavePeriods(EmployeeId: string, startDate: Date | null | undefined, endDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeavePeriods&startDate=' + startDate?.toISOString() + '&endDate=' + endDate?.toISOString(), {}); + } + + /** + * searches employee leave types + * Get Employees/{EmployeeId}/LeaveTypes + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveTypes} search results matching criteria + */ + GetEmployeeLeaveTypes(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', {}); + } + + /** + * creates employee leave type records + * Post Employees/{EmployeeId}/LeaveTypes + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveTypeObject} search results matching criteria + */ + CreateEmployeeLeaveType(EmployeeId: string, requestBody: EmployeeLeaveType): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieves an employee's payment method + * Get Employees/{EmployeeId}/PaymentMethods + * @param {string} EmployeeId Employee id for single object + * @return {PaymentMethodObject} search results matching criteria + */ + GetEmployeePaymentMethod(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', {}); + } + + /** + * creates employee payment method + * Post Employees/{EmployeeId}/PaymentMethods + * @param {string} EmployeeId Employee id for single object + * @return {PaymentMethodObject} search results matching criteria + */ + CreateEmployeePaymentMethod(EmployeeId: string, requestBody: PaymentMethod): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches employee pay templates + * Get Employees/{EmployeeId}/PayTemplates + * @param {string} EmployeeId Employee id for single object + * @return {EmployeePayTemplateObject} search results matching criteria + */ + GetEmployeePayTemplate(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates', {}); + } + + /** + * creates employee earnings template records + * Post Employees/{EmployeeId}/PayTemplates/earnings + * @param {string} EmployeeId Employee id for single object + * @return {EarningsTemplateObject} search results matching criteria + */ + CreateEmployeeEarningsTemplate(EmployeeId: string, requestBody: EarningsTemplate): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * updates employee earnings template records + * Put Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} + * @param {string} EmployeeId Employee id for single object + * @param {string} PayTemplateEarningID Id for single pay template earnings object + * @return {EarningsTemplateObject} search results matching criteria + */ + UpdateEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string, requestBody: EarningsTemplate): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * deletes an employee earnings template record + * Delete Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} + * @param {string} EmployeeId Employee id for single object + * @param {string} PayTemplateEarningID Id for single pay template earnings object + * @return {void} deletion successful + */ + DeleteEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string): Observable> { + return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), { observe: 'response', responseType: 'text' }); + } + + /** + * creates multiple employee earnings template records + * Post Employees/{EmployeeId}/paytemplateearnings + * @param {string} EmployeeId Employee id for single object + * @return {EmployeePayTemplates} search results matching criteria + */ + CreateMultipleEmployeeEarningsTemplate(EmployeeId: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/paytemplateearnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches benefits + * Get Benefits + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Benefits} search results matching criteria + */ + GetBenefits(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Benefits?page=' + page, {}); + } + + /** + * create a new benefit + * Post Benefits + * @return {BenefitObject} search results matching criteria + */ + CreateBenefit(requestBody: Benefit): Observable { + return this.http.post(this.baseUri + 'Benefits', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single benefit by id + * Get Benefits/{id} + * @param {string} id Identifier for the benefit + * @return {BenefitObject} search results matching criteria + */ + GetBenefit(id: string): Observable { + return this.http.get(this.baseUri + 'Benefits/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * searches deductions + * Get Deductions + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Deductions} search results matching criteria + */ + GetDeductions(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Deductions?page=' + page, {}); + } + + /** + * create a new deduction + * Post Deductions + * @return {DeductionObject} search results matching criteria + */ + CreateDeduction(requestBody: Deduction): Observable { + return this.http.post(this.baseUri + 'Deductions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single deduction by id + * Get Deductions/{deductionId} + * @param {string} deductionId Identifier for the deduction + * @return {DeductionObject} search results matching criteria + */ + GetDeduction(deductionId: string): Observable { + return this.http.get(this.baseUri + 'Deductions/' + (deductionId == null ? '' : encodeURIComponent(deductionId)), {}); + } + + /** + * searches earnings orders + * Get EarningsOrders + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {EarningsOrders} search results matching criteria + */ + GetEarningsOrders(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'EarningsOrders?page=' + page, {}); + } + + /** + * retrieve a single deduction by id + * Get EarningsOrders/{id} + * @param {string} id Identifier for the deduction + * @return {EarningsOrderObject} search results matching criteria + */ + GetEarningsOrder(id: string): Observable { + return this.http.get(this.baseUri + 'EarningsOrders/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * searches earnings rates + * Get EarningsRates + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {EarningsRates} search results matching criteria + */ + GetEarningsRates(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'EarningsRates?page=' + page, {}); + } + + /** + * create a new earnings rate + * Post EarningsRates + * @return {EarningsRateObject} search results matching criteria + */ + CreateEarningsRate(requestBody: EarningsRate): Observable { + return this.http.post(this.baseUri + 'EarningsRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single earnings rates by id + * Get EarningsRates/{EarningsRateID} + * @param {string} EarningsRateID Identifier for the earnings rate + * @return {EarningsRateObject} search results matching criteria + */ + GetEarningsRate(EarningsRateID: string): Observable { + return this.http.get(this.baseUri + 'EarningsRates/' + (EarningsRateID == null ? '' : encodeURIComponent(EarningsRateID)), {}); + } + + /** + * searches leave types + * Get LeaveTypes + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} ActiveOnly Filters leave types by active status. By default the API returns all leave types. + * @return {LeaveTypes} search results matching criteria + */ + GetLeaveTypes(page: number | null | undefined, ActiveOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'LeaveTypes?page=' + page + '&ActiveOnly=' + ActiveOnly, {}); + } + + /** + * create a new leave type + * Post LeaveTypes + * @return {LeaveTypeObject} search results matching criteria + */ + CreateLeaveType(requestBody: LeaveType): Observable { + return this.http.post(this.baseUri + 'LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single leave type by id + * Get LeaveTypes/{LeaveTypeID} + * @param {string} LeaveTypeID Identifier for the leave type + * @return {LeaveTypeObject} search results matching criteria + */ + GetLeaveType(LeaveTypeID: string): Observable { + return this.http.get(this.baseUri + 'LeaveTypes/' + (LeaveTypeID == null ? '' : encodeURIComponent(LeaveTypeID)), {}); + } + + /** + * searches reimbursements + * Get Reimbursements + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Reimbursements} search results matching criteria + */ + GetReimbursements(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reimbursements?page=' + page, {}); + } + + /** + * create a new reimbursement + * Post Reimbursements + * @return {ReimbursementObject} search results matching criteria + */ + CreateReimbursement(requestBody: Reimbursement): Observable { + return this.http.post(this.baseUri + 'Reimbursements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single reimbursement by id + * Get Reimbursements/{ReimbursementID} + * @param {string} ReimbursementID Identifier for the reimbursement + * @return {ReimbursementObject} search results matching criteria + */ + GetReimbursement(ReimbursementID: string): Observable { + return this.http.get(this.baseUri + 'Reimbursements/' + (ReimbursementID == null ? '' : encodeURIComponent(ReimbursementID)), {}); + } + + /** + * searches timesheets + * Get Timesheets + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} employeeId By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + * @param {string} payrollCalendarId By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + * @return {Timesheets} search results matching criteria + */ + GetTimesheets(page: number | null | undefined, employeeId: string | null | undefined, payrollCalendarId: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Timesheets?page=' + page + '&employeeId=' + (employeeId == null ? '' : encodeURIComponent(employeeId)) + '&payrollCalendarId=' + (payrollCalendarId == null ? '' : encodeURIComponent(payrollCalendarId)), {}); + } + + /** + * create a new timesheet + * Post Timesheets + * @return {TimesheetObject} search results matching criteria + */ + CreateTimesheet(requestBody: Timesheet): Observable { + return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single timesheet by id + * Get Timesheets/{TimesheetID} + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetObject} search results matching criteria + */ + GetTimesheet(TimesheetID: string): Observable { + return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); + } + + /** + * delete a timesheet + * Delete Timesheets/{TimesheetID} + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetLine} search results matching criteria + */ + DeleteTimesheet(TimesheetID: string): Observable { + return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); + } + + /** + * create a new timesheet line + * Post Timesheets/{TimesheetID}/Lines + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetLineObject} search results matching criteria + */ + CreateTimesheetLine(TimesheetID: string, requestBody: TimesheetLine): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * approve a timesheet + * Post Timesheets/{TimesheetID}/Approve + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetObject} search results matching criteria + */ + ApproveTimesheet(TimesheetID: string): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Approve', null, {}); + } + + /** + * revert a timesheet to draft + * Post Timesheets/{TimesheetID}/RevertToDraft + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetObject} search results matching criteria + */ + RevertTimesheet(TimesheetID: string): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/RevertToDraft', null, {}); + } + + /** + * update a timesheet line + * Put Timesheets/{TimesheetID}/Lines/{TimesheetLineID} + * @param {string} TimesheetID Identifier for the timesheet + * @param {string} TimesheetLineID Identifier for the timesheet line + * @return {TimesheetLineObject} search results matching criteria + */ + UpdateTimesheetLine(TimesheetID: string, TimesheetLineID: string, requestBody: TimesheetLine): Observable { + return this.http.put(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * delete a timesheet line + * Delete Timesheets/{TimesheetID}/Lines/{TimesheetLineID} + * @param {string} TimesheetID Identifier for the timesheet + * @param {string} TimesheetLineID Identifier for the timesheet line + * @return {TimesheetLine} search results matching criteria + */ + DeleteTimesheetLine(TimesheetID: string, TimesheetLineID: string): Observable { + return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), {}); + } + + /** + * searches payrun calendars + * Get PayRunCalendars + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayRunCalendars} search results matching criteria + */ + GetPayRunCalendars(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayRunCalendars?page=' + page, {}); + } + + /** + * create a new payrun calendar + * Post PayRunCalendars + * @return {PayRunCalendarObject} search results matching criteria + */ + CreatePayRunCalendar(requestBody: PayRunCalendar): Observable { + return this.http.post(this.baseUri + 'PayRunCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single payrun calendar by id + * Get PayRunCalendars/{PayRunCalendarID} + * @param {string} PayRunCalendarID Identifier for the payrun calendars + * @return {PayRunCalendarObject} search results matching criteria + */ + GetPayRunCalendar(PayRunCalendarID: string): Observable { + return this.http.get(this.baseUri + 'PayRunCalendars/' + (PayRunCalendarID == null ? '' : encodeURIComponent(PayRunCalendarID)), {}); + } + + /** + * retrieves an employee's salary and wages + * Get Employees/{EmployeeId}/SalaryAndWages + * @param {string} EmployeeId Employee id for single object + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {SalaryAndWages} search results matching criteria + */ + GetEmployeeSalaryAndWages(EmployeeId: string, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages&page=' + page, {}); + } + + /** + * creates employee salary and wage record + * Post Employees/{EmployeeId}/SalaryAndWages + * @param {string} EmployeeId Employee id for single object + * @return {SalaryAndWageObject} search results matching criteria + */ + CreateEmployeeSalaryAndWage(EmployeeId: string, requestBody: SalaryAndWage): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * get employee salary and wages record by id + * Get Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} + * @param {string} EmployeeId Employee id for single object + * @param {string} SalaryAndWagesID Id for single pay template earnings object + * @return {SalaryAndWages} search results matching criteria + */ + GetEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), {}); + } + + /** + * updates employee salary and wages record + * Put Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} + * @param {string} EmployeeId Employee id for single object + * @param {string} SalaryAndWagesID Id for single pay template earnings object + * @return {SalaryAndWageObject} search results matching criteria + */ + UpdateEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string, requestBody: SalaryAndWage): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * deletes an employee salary and wages record + * Delete Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} + * @param {string} EmployeeId Employee id for single object + * @param {string} SalaryAndWagesID Id for single salary and wages object + * @return {void} deletion successful + */ + DeleteEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable> { + return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), { observe: 'response', responseType: 'text' }); + } + + /** + * searches pay runs + * Get PayRuns + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {PayRunPayRunStatus} status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + * @return {PayRuns} search results matching criteria + */ + GetPayRuns(page: number | null | undefined, status: PayRunPayRunStatus | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayRuns?page=' + page + '&status=' + status, {}); + } + + /** + * retrieve a single pay run by id + * Get PayRuns/{PayRunID} + * @param {string} PayRunID Identifier for the pay run + * @return {PayRunObject} search results matching criteria + */ + GetPayRun(PayRunID: string): Observable { + return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); + } + + /** + * update a pay run + * Put PayRuns/{PayRunID} + * @param {string} PayRunID Identifier for the pay run + * @return {PayRunObject} search results matching criteria + */ + UpdatePayRun(PayRunID: string, requestBody: PayRun): Observable { + return this.http.put(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches payslips + * Get Payslips + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} PayRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + * @return {Payslips} search results matching criteria + */ + GetPayslips(page: number | null | undefined, PayRunID: string): Observable { + return this.http.get(this.baseUri + 'Payslips?page=' + page + '&PayRunID=' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); + } + + /** + * retrieve a single payslip by id + * Get Payslips/{PayslipID} + * @param {string} PayslipID Identifier for the payslip + * @return {PayslipObject} search results matching criteria + */ + GetPaySlip(PayslipID: string): Observable { + return this.http.get(this.baseUri + 'Payslips/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); + } + + /** + * searches settings + * Get Settings + * @return {Settings} search results matching criteria + */ + GetSettings(): Observable { + return this.http.get(this.baseUri + 'Settings', {}); + } + + /** + * searches tracking categories + * Get settings/trackingCategories + * @return {TrackingCategories} search results matching criteria + */ + GetTrackingCategories(): Observable { + return this.http.get(this.baseUri + 'settings/trackingCategories', {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/xero_accounting.txt b/Tests/SwagTsTests/NG2FormGroupResults/xero_accounting.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/xero_accounting.txt rename to Tests/SwagTsTests/NG2FormGroupResults/xero_accounting.ts index 29238c29..d9c6d803 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/xero_accounting.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/xero_accounting.ts @@ -1,8415 +1,8415 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Address { - - /** define the type of address */ - AddressType?: AddressAddressType | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine1?: string | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine2?: string | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine3?: string | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine4?: string | null; - - /** - * max length = 255 - * Max length: 255 - */ - City?: string | null; - - /** - * max length = 255 - * Max length: 255 - */ - Region?: string | null; - - /** - * max length = 50 - * Max length: 50 - */ - PostalCode?: string | null; - - /** - * max length = 50, [A-Z], [a-z] only - * Max length: 50 - */ - Country?: string | null; - - /** - * max length = 255 - * Max length: 255 - */ - AttentionTo?: string | null; - } - export interface AddressFormProperties { - - /** define the type of address */ - AddressType: FormControl, - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine1: FormControl, - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine2: FormControl, - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine3: FormControl, - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine4: FormControl, - - /** - * max length = 255 - * Max length: 255 - */ - City: FormControl, - - /** - * max length = 255 - * Max length: 255 - */ - Region: FormControl, - - /** - * max length = 50 - * Max length: 50 - */ - PostalCode: FormControl, - - /** - * max length = 50, [A-Z], [a-z] only - * Max length: 50 - */ - Country: FormControl, - - /** - * max length = 255 - * Max length: 255 - */ - AttentionTo: FormControl, - } - export function CreateAddressFormGroup() { - return new FormGroup({ - AddressType: new FormControl(undefined), - AddressLine1: new FormControl(undefined, [Validators.maxLength(500)]), - AddressLine2: new FormControl(undefined, [Validators.maxLength(500)]), - AddressLine3: new FormControl(undefined, [Validators.maxLength(500)]), - AddressLine4: new FormControl(undefined, [Validators.maxLength(500)]), - City: new FormControl(undefined, [Validators.maxLength(255)]), - Region: new FormControl(undefined, [Validators.maxLength(255)]), - PostalCode: new FormControl(undefined, [Validators.maxLength(50)]), - Country: new FormControl(undefined, [Validators.maxLength(50)]), - AttentionTo: new FormControl(undefined, [Validators.maxLength(255)]), - }); - - } - - export enum AddressAddressType { POBOX = 0, STREET = 1, DELIVERY = 2 } - - export interface Phone { - PhoneType?: PhonePhoneType | null; - - /** - * max length = 50 - * Max length: 50 - */ - PhoneNumber?: string | null; - - /** - * max length = 10 - * Max length: 10 - */ - PhoneAreaCode?: string | null; - - /** - * max length = 20 - * Max length: 20 - */ - PhoneCountryCode?: string | null; - } - export interface PhoneFormProperties { - PhoneType: FormControl, - - /** - * max length = 50 - * Max length: 50 - */ - PhoneNumber: FormControl, - - /** - * max length = 10 - * Max length: 10 - */ - PhoneAreaCode: FormControl, - - /** - * max length = 20 - * Max length: 20 - */ - PhoneCountryCode: FormControl, - } - export function CreatePhoneFormGroup() { - return new FormGroup({ - PhoneType: new FormControl(undefined), - PhoneNumber: new FormControl(undefined, [Validators.maxLength(50)]), - PhoneAreaCode: new FormControl(undefined, [Validators.maxLength(10)]), - PhoneCountryCode: new FormControl(undefined, [Validators.maxLength(20)]), - }); - - } - - export enum PhonePhoneType { DEFAULT = 0, DDI = 1, MOBILE = 2, FAX = 3, OFFICE = 4 } - - export interface Accounts { - Accounts1?: Array; - } - export interface AccountsFormProperties { - } - export function CreateAccountsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Account { - - /** - * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - * Max length: 10 - */ - Code?: string | null; - - /** - * Name of account (max length = 150) - * Max length: 150 - */ - Name?: string | null; - - /** The Xero identifier for an account � specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - AccountID?: string | null; - - /** See Account Types */ - Type?: AccountType | null; - - /** For bank accounts only (Account Type BANK) */ - BankAccountNumber?: string | null; - - /** Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes */ - Status?: AccountStatus | null; - - /** Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) */ - Description?: string | null; - - /** For bank accounts only. See Bank Account types */ - BankAccountType?: AccountBankAccountType | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** Boolean � describes whether account can have payments applied to it */ - EnablePaymentsToAccount?: boolean | null; - - /** Boolean � describes whether account code is available for use with expense claims */ - ShowInExpenseClaims?: boolean | null; - - /** See Account Class Types */ - Class?: AccountClass | null; - - /** If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either �� or null. */ - SystemAccount?: AccountSystemAccount | null; - - /** Shown if set */ - ReportingCode?: string | null; - - /** Shown if set */ - ReportingCodeName?: string | null; - - /** boolean to indicate if an account has an attachment (read only) */ - HasAttachments?: boolean | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Boolean � describes whether the account is shown in the watchlist widget on the dashboard */ - AddToWatchlist?: boolean | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface AccountFormProperties { - - /** - * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - * Max length: 10 - */ - Code: FormControl, - - /** - * Name of account (max length = 150) - * Max length: 150 - */ - Name: FormControl, - - /** The Xero identifier for an account � specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - AccountID: FormControl, - - /** See Account Types */ - Type: FormControl, - - /** For bank accounts only (Account Type BANK) */ - BankAccountNumber: FormControl, - - /** Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes */ - Status: FormControl, - - /** Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) */ - Description: FormControl, - - /** For bank accounts only. See Bank Account types */ - BankAccountType: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** The tax type from TaxRates */ - TaxType: FormControl, - - /** Boolean � describes whether account can have payments applied to it */ - EnablePaymentsToAccount: FormControl, - - /** Boolean � describes whether account code is available for use with expense claims */ - ShowInExpenseClaims: FormControl, - - /** See Account Class Types */ - Class: FormControl, - - /** If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either �� or null. */ - SystemAccount: FormControl, - - /** Shown if set */ - ReportingCode: FormControl, - - /** Shown if set */ - ReportingCodeName: FormControl, - - /** boolean to indicate if an account has an attachment (read only) */ - HasAttachments: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** Boolean � describes whether the account is shown in the watchlist widget on the dashboard */ - AddToWatchlist: FormControl, - } - export function CreateAccountFormGroup() { - return new FormGroup({ - Code: new FormControl(undefined, [Validators.maxLength(10)]), - Name: new FormControl(undefined, [Validators.maxLength(150)]), - AccountID: new FormControl(undefined), - Type: new FormControl(undefined), - BankAccountNumber: new FormControl(undefined), - Status: new FormControl(undefined), - Description: new FormControl(undefined), - BankAccountType: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - TaxType: new FormControl(undefined), - EnablePaymentsToAccount: new FormControl(undefined), - ShowInExpenseClaims: new FormControl(undefined), - Class: new FormControl(undefined), - SystemAccount: new FormControl(undefined), - ReportingCode: new FormControl(undefined), - ReportingCodeName: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - AddToWatchlist: new FormControl(undefined), - }); - - } - - export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21 } - - export enum AccountStatus { ACTIVE = 0, ARCHIVED = 1, DELETED = 2 } - - export enum AccountBankAccountType { BANK = 0, CREDITCARD = 1, PAYPAL = 2, NONE = 3, '' = 4 } - - export enum AccountCurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - export enum AccountClass { ASSET = 0, EQUITY = 1, EXPENSE = 2, LIABILITY = 3, REVENUE = 4 } - - export enum AccountSystemAccount { DEBTORS = 0, CREDITORS = 1, BANKCURRENCYGAIN = 2, GST = 3, GSTONIMPORTS = 4, HISTORICAL = 5, REALISEDCURRENCYGAIN = 6, RETAINEDEARNINGS = 7, ROUNDING = 8, TRACKINGTRANSFERS = 9, UNPAIDEXPCLM = 10, UNREALISEDCURRENCYGAIN = 11, WAGEPAYABLES = 12, CISASSETS = 13, CISASSET = 14, CISLABOUR = 15, CISLABOUREXPENSE = 16, CISLABOURINCOME = 17, CISLIABILITY = 18, CISMATERIALS = 19, '' = 20 } - - export interface ValidationError { - - /** Validation error message */ - Message?: string | null; - } - export interface ValidationErrorFormProperties { - - /** Validation error message */ - Message: FormControl, - } - export function CreateValidationErrorFormGroup() { - return new FormGroup({ - Message: new FormControl(undefined), - }); - - } - - export interface Attachments { - Attachments1?: Array; - } - export interface AttachmentsFormProperties { - } - export function CreateAttachmentsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Attachment { - - /** Unique ID for the file */ - AttachmentID?: string | null; - - /** Name of the file */ - FileName?: string | null; - - /** URL to the file on xero.com */ - Url?: string | null; - - /** Type of file */ - MimeType?: string | null; - - /** - * Length of the file content - * Type: double - */ - ContentLength?: number | null; - - /** Include the file with the online invoice */ - IncludeOnline?: boolean | null; - } - export interface AttachmentFormProperties { - - /** Unique ID for the file */ - AttachmentID: FormControl, - - /** Name of the file */ - FileName: FormControl, - - /** URL to the file on xero.com */ - Url: FormControl, - - /** Type of file */ - MimeType: FormControl, - - /** - * Length of the file content - * Type: double - */ - ContentLength: FormControl, - - /** Include the file with the online invoice */ - IncludeOnline: FormControl, - } - export function CreateAttachmentFormGroup() { - return new FormGroup({ - AttachmentID: new FormControl(undefined), - FileName: new FormControl(undefined), - Url: new FormControl(undefined), - MimeType: new FormControl(undefined), - ContentLength: new FormControl(undefined), - IncludeOnline: new FormControl(undefined), - }); - - } - - export interface BankTransactions { - BankTransactions1?: Array; - } - export interface BankTransactionsFormProperties { - } - export function CreateBankTransactionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface BankTransaction { - - /** - * See Bank Transaction Types - * Required - */ - Type: BankTransactionType; - - /** Required */ - Contact: Contact; - - /** - * See LineItems - * Required - */ - LineItems: Array; - - /** Required */ - BankAccount: Account; - - /** Boolean to show if transaction is reconciled */ - IsReconciled?: boolean | null; - - /** - * Date of transaction � YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** Reference for the transaction. Only supported for SPEND and RECEIVE transactions. */ - Reference?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn�t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. - * Type: double - */ - CurrencyRate?: number | null; - - /** URL link to a source document � shown as �Go to App Name� */ - Url?: string | null; - - /** See Bank Transaction Status Codes */ - Status?: BankTransactionStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** - * Total of bank transaction excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on bank transaction - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of bank transaction tax inclusive - * Type: double - */ - Total?: number | null; - - /** Xero generated unique identifier for bank transaction */ - BankTransactionID?: string | null; - - /** Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT */ - PrepaymentID?: string | null; - - /** Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT */ - OverpaymentID?: string | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Boolean to indicate if a bank transaction has an attachment */ - HasAttachments?: boolean | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface BankTransactionFormProperties { - - /** - * See Bank Transaction Types - * Required - */ - Type: FormControl, - - /** Boolean to show if transaction is reconciled */ - IsReconciled: FormControl, - - /** - * Date of transaction � YYYY-MM-DD - * Type: DateOnly - */ - Date: FormControl, - - /** Reference for the transaction. Only supported for SPEND and RECEIVE transactions. */ - Reference: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** - * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn�t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. - * Type: double - */ - CurrencyRate: FormControl, - - /** URL link to a source document � shown as �Go to App Name� */ - Url: FormControl, - - /** See Bank Transaction Status Codes */ - Status: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** - * Total of bank transaction excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * Total tax on bank transaction - * Type: double - */ - TotalTax: FormControl, - - /** - * Total of bank transaction tax inclusive - * Type: double - */ - Total: FormControl, - - /** Xero generated unique identifier for bank transaction */ - BankTransactionID: FormControl, - - /** Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT */ - PrepaymentID: FormControl, - - /** Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT */ - OverpaymentID: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** Boolean to indicate if a bank transaction has an attachment */ - HasAttachments: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreateBankTransactionFormGroup() { - return new FormGroup({ - Type: new FormControl(undefined, [Validators.required]), - IsReconciled: new FormControl(undefined), - Date: new FormControl(undefined), - Reference: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - Url: new FormControl(undefined), - Status: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - BankTransactionID: new FormControl(undefined), - PrepaymentID: new FormControl(undefined), - OverpaymentID: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export enum BankTransactionType { RECEIVE = 0, 'RECEIVE-OVERPAYMENT' = 1, 'RECEIVE-PREPAYMENT' = 2, SPEND = 3, 'SPEND-OVERPAYMENT' = 4, 'SPEND-PREPAYMENT' = 5, 'RECEIVE-TRANSFER' = 6, 'SPEND-TRANSFER' = 7 } - - export interface Contact { - - /** Xero identifier */ - ContactID?: string | null; - - /** - * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. - * Max length: 50 - */ - ContactNumber?: string | null; - - /** - * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) - * Max length: 50 - */ - AccountNumber?: string | null; - - /** Current status of a contact � see contact status types */ - ContactStatus?: ContactContactStatus | null; - - /** - * Full name of contact/organisation (max length = 255) - * Max length: 255 - */ - Name?: string | null; - - /** - * First name of contact person (max length = 255) - * Max length: 255 - */ - FirstName?: string | null; - - /** - * Last name of contact person (max length = 255) - * Max length: 255 - */ - LastName?: string | null; - - /** - * Email address of contact person (umlauts not supported) (max length = 255) - * Max length: 255 - */ - EmailAddress?: string | null; - - /** Skype user name of contact */ - SkypeUserName?: string | null; - - /** See contact persons */ - ContactPersons?: Array; - - /** Bank account number of contact */ - BankAccountDetails?: string | null; - - /** - * Tax number of contact � this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) - * Max length: 50 - */ - TaxNumber?: string | null; - - /** The tax type from TaxRates */ - AccountsReceivableTaxType?: string | null; - - /** The tax type from TaxRates */ - AccountsPayableTaxType?: string | null; - - /** Store certain address types for a contact � see address types */ - Addresses?: Array
; - - /** Store certain phone types for a contact � see phone types */ - Phones?: Array; - - /** true or false � Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts payable invoice is generated against this contact. */ - IsSupplier?: boolean | null; - - /** true or false � Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts receivable invoice is generated against this contact. */ - IsCustomer?: boolean | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - DefaultCurrency?: AccountCurrencyCode | null; - - /** Store XeroNetworkKey for contacts. */ - XeroNetworkKey?: string | null; - - /** The default sales account code for contacts */ - SalesDefaultAccountCode?: string | null; - - /** The default purchases account code for contacts */ - PurchasesDefaultAccountCode?: string | null; - - /** The default sales tracking categories for contacts */ - SalesTrackingCategories?: Array; - - /** The default purchases tracking categories for contacts */ - PurchasesTrackingCategories?: Array; - - /** The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ - TrackingCategoryName?: string | null; - - /** The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ - TrackingCategoryOption?: string | null; - PaymentTerms?: PaymentTerm; - - /** UTC timestamp of last update to contact */ - UpdatedDateUTC?: Date | null; - - /** Displays which contact groups a contact is included in */ - ContactGroups?: Array; - - /** Website address for contact (read only) */ - Website?: string | null; - BrandingTheme?: BrandingTheme; - - /** Bank details for use on a batch payment stored with each contact */ - BatchPayments?: BatchPaymentDetails; - - /** - * The default discount rate for the contact (read only) - * Type: double - */ - Discount?: number | null; - - /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ - Balances?: Balances; - - /** Displays array of attachments from the API */ - Attachments?: Array; - - /** A boolean to indicate if a contact has an attachment */ - HasAttachments?: boolean | null; - - /** Displays validation errors returned from the API */ - ValidationErrors?: Array; - - /** A boolean to indicate if a contact has an validation errors */ - HasValidationErrors?: boolean | null; - - /** Status of object */ - StatusAttributeString?: string | null; - } - export interface ContactFormProperties { - - /** Xero identifier */ - ContactID: FormControl, - - /** - * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. - * Max length: 50 - */ - ContactNumber: FormControl, - - /** - * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) - * Max length: 50 - */ - AccountNumber: FormControl, - - /** Current status of a contact � see contact status types */ - ContactStatus: FormControl, - - /** - * Full name of contact/organisation (max length = 255) - * Max length: 255 - */ - Name: FormControl, - - /** - * First name of contact person (max length = 255) - * Max length: 255 - */ - FirstName: FormControl, - - /** - * Last name of contact person (max length = 255) - * Max length: 255 - */ - LastName: FormControl, - - /** - * Email address of contact person (umlauts not supported) (max length = 255) - * Max length: 255 - */ - EmailAddress: FormControl, - - /** Skype user name of contact */ - SkypeUserName: FormControl, - - /** Bank account number of contact */ - BankAccountDetails: FormControl, - - /** - * Tax number of contact � this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) - * Max length: 50 - */ - TaxNumber: FormControl, - - /** The tax type from TaxRates */ - AccountsReceivableTaxType: FormControl, - - /** The tax type from TaxRates */ - AccountsPayableTaxType: FormControl, - - /** true or false � Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts payable invoice is generated against this contact. */ - IsSupplier: FormControl, - - /** true or false � Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts receivable invoice is generated against this contact. */ - IsCustomer: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - DefaultCurrency: FormControl, - - /** Store XeroNetworkKey for contacts. */ - XeroNetworkKey: FormControl, - - /** The default sales account code for contacts */ - SalesDefaultAccountCode: FormControl, - - /** The default purchases account code for contacts */ - PurchasesDefaultAccountCode: FormControl, - - /** The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ - TrackingCategoryName: FormControl, - - /** The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ - TrackingCategoryOption: FormControl, - - /** UTC timestamp of last update to contact */ - UpdatedDateUTC: FormControl, - - /** Website address for contact (read only) */ - Website: FormControl, - - /** - * The default discount rate for the contact (read only) - * Type: double - */ - Discount: FormControl, - - /** A boolean to indicate if a contact has an attachment */ - HasAttachments: FormControl, - - /** A boolean to indicate if a contact has an validation errors */ - HasValidationErrors: FormControl, - - /** Status of object */ - StatusAttributeString: FormControl, - } - export function CreateContactFormGroup() { - return new FormGroup({ - ContactID: new FormControl(undefined), - ContactNumber: new FormControl(undefined, [Validators.maxLength(50)]), - AccountNumber: new FormControl(undefined, [Validators.maxLength(50)]), - ContactStatus: new FormControl(undefined), - Name: new FormControl(undefined, [Validators.maxLength(255)]), - FirstName: new FormControl(undefined, [Validators.maxLength(255)]), - LastName: new FormControl(undefined, [Validators.maxLength(255)]), - EmailAddress: new FormControl(undefined, [Validators.maxLength(255)]), - SkypeUserName: new FormControl(undefined), - BankAccountDetails: new FormControl(undefined), - TaxNumber: new FormControl(undefined, [Validators.maxLength(50)]), - AccountsReceivableTaxType: new FormControl(undefined), - AccountsPayableTaxType: new FormControl(undefined), - IsSupplier: new FormControl(undefined), - IsCustomer: new FormControl(undefined), - DefaultCurrency: new FormControl(undefined), - XeroNetworkKey: new FormControl(undefined), - SalesDefaultAccountCode: new FormControl(undefined), - PurchasesDefaultAccountCode: new FormControl(undefined), - TrackingCategoryName: new FormControl(undefined), - TrackingCategoryOption: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - Website: new FormControl(undefined), - Discount: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - HasValidationErrors: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export enum ContactContactStatus { ACTIVE = 0, ARCHIVED = 1, GDPRREQUEST = 2 } - - export interface ContactPerson { - - /** First name of person */ - FirstName?: string | null; - - /** Last name of person */ - LastName?: string | null; - - /** Email address of person */ - EmailAddress?: string | null; - - /** boolean to indicate whether contact should be included on emails with invoices etc. */ - IncludeInEmails?: boolean | null; - } - export interface ContactPersonFormProperties { - - /** First name of person */ - FirstName: FormControl, - - /** Last name of person */ - LastName: FormControl, - - /** Email address of person */ - EmailAddress: FormControl, - - /** boolean to indicate whether contact should be included on emails with invoices etc. */ - IncludeInEmails: FormControl, - } - export function CreateContactPersonFormGroup() { - return new FormGroup({ - FirstName: new FormControl(undefined), - LastName: new FormControl(undefined), - EmailAddress: new FormControl(undefined), - IncludeInEmails: new FormControl(undefined), - }); - - } - - export interface SalesTrackingCategory { - - /** The default sales tracking category name for contacts */ - TrackingCategoryName?: string | null; - - /** The default purchase tracking category name for contacts */ - TrackingOptionName?: string | null; - } - export interface SalesTrackingCategoryFormProperties { - - /** The default sales tracking category name for contacts */ - TrackingCategoryName: FormControl, - - /** The default purchase tracking category name for contacts */ - TrackingOptionName: FormControl, - } - export function CreateSalesTrackingCategoryFormGroup() { - return new FormGroup({ - TrackingCategoryName: new FormControl(undefined), - TrackingOptionName: new FormControl(undefined), - }); - - } - - export interface PaymentTerm { - Bills?: Bill; - Sales?: Bill; - } - export interface PaymentTermFormProperties { - } - export function CreatePaymentTermFormGroup() { - return new FormGroup({ - }); - - } - - export interface Bill { - - /** - * Day of Month (0-31) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Day?: number | null; - Type?: BillType | null; - } - export interface BillFormProperties { - - /** - * Day of Month (0-31) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Day: FormControl, - Type: FormControl, - } - export function CreateBillFormGroup() { - return new FormGroup({ - Day: new FormControl(undefined), - Type: new FormControl(undefined), - }); - - } - - export enum BillType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } - - export interface ContactGroup { - - /** The Name of the contact group. Required when creating a new contact group */ - Name?: string | null; - - /** The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. */ - Status?: ContactGroupStatus | null; - - /** The Xero identifier for an contact group � specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - ContactGroupID?: string | null; - - /** The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. */ - Contacts?: Array; - } - export interface ContactGroupFormProperties { - - /** The Name of the contact group. Required when creating a new contact group */ - Name: FormControl, - - /** The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. */ - Status: FormControl, - - /** The Xero identifier for an contact group � specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - ContactGroupID: FormControl, - } - export function CreateContactGroupFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined), - Status: new FormControl(undefined), - ContactGroupID: new FormControl(undefined), - }); - - } - - export enum ContactGroupStatus { ACTIVE = 0, DELETED = 1 } - - export interface BrandingTheme { - - /** Xero identifier */ - BrandingThemeID?: string | null; - - /** Name of branding theme */ - Name?: string | null; - - /** The location of the image file used as the logo on this branding theme */ - LogoUrl?: string | null; - - /** Always INVOICE */ - Type?: BrandingThemeType | null; - - /** - * Integer � ranked order of branding theme. The default branding theme has a value of 0 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - SortOrder?: number | null; - - /** UTC timestamp of creation date of branding theme */ - CreatedDateUTC?: Date | null; - } - export interface BrandingThemeFormProperties { - - /** Xero identifier */ - BrandingThemeID: FormControl, - - /** Name of branding theme */ - Name: FormControl, - - /** The location of the image file used as the logo on this branding theme */ - LogoUrl: FormControl, - - /** Always INVOICE */ - Type: FormControl, - - /** - * Integer � ranked order of branding theme. The default branding theme has a value of 0 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - SortOrder: FormControl, - - /** UTC timestamp of creation date of branding theme */ - CreatedDateUTC: FormControl, - } - export function CreateBrandingThemeFormGroup() { - return new FormGroup({ - BrandingThemeID: new FormControl(undefined), - Name: new FormControl(undefined), - LogoUrl: new FormControl(undefined), - Type: new FormControl(undefined), - SortOrder: new FormControl(undefined), - CreatedDateUTC: new FormControl(undefined), - }); - - } - - export enum BrandingThemeType { INVOICE = 0 } - - - /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ - export interface Balances { - AccountsReceivable?: AccountsReceivable; - AccountsPayable?: AccountsPayable; - } - - /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ - export interface BalancesFormProperties { - } - export function CreateBalancesFormGroup() { - return new FormGroup({ - }); - - } - - export interface AccountsReceivable { - - /** Type: double */ - Outstanding?: number | null; - - /** Type: double */ - Overdue?: number | null; - } - export interface AccountsReceivableFormProperties { - - /** Type: double */ - Outstanding: FormControl, - - /** Type: double */ - Overdue: FormControl, - } - export function CreateAccountsReceivableFormGroup() { - return new FormGroup({ - Outstanding: new FormControl(undefined), - Overdue: new FormControl(undefined), - }); - - } - - export interface AccountsPayable { - - /** Type: double */ - Outstanding?: number | null; - - /** Type: double */ - Overdue?: number | null; - } - export interface AccountsPayableFormProperties { - - /** Type: double */ - Outstanding: FormControl, - - /** Type: double */ - Overdue: FormControl, - } - export function CreateAccountsPayableFormGroup() { - return new FormGroup({ - Outstanding: new FormControl(undefined), - Overdue: new FormControl(undefined), - }); - - } - - export interface LineItem { - - /** LineItem unique ID */ - LineItemID?: string | null; - - /** Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character */ - Description?: string | null; - - /** - * LineItem Quantity - * Type: double - */ - Quantity?: number | null; - - /** - * LineItem Unit Amount - * Type: double - */ - UnitAmount?: number | null; - - /** See Items */ - ItemCode?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** - * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. - * Type: double - */ - TaxAmount?: number | null; - - /** - * If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 � DiscountRate)/100) - * Type: double - */ - LineAmount?: number | null; - - /** Optional Tracking Category � see Tracking. Any LineItem can have a maximum of 2 elements. */ - Tracking?: Array; - - /** - * Percentage discount being applied to a line item (only supported on ACCREC invoices � ACC PAY invoices and credit notes in Xero do not support discounts - * Type: double - */ - DiscountRate?: number | null; - - /** - * Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. - * Type: double - */ - DiscountAmount?: number | null; - - /** The Xero identifier for a Repeating Invoice */ - RepeatingInvoiceID?: string | null; - } - export interface LineItemFormProperties { - - /** LineItem unique ID */ - LineItemID: FormControl, - - /** Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character */ - Description: FormControl, - - /** - * LineItem Quantity - * Type: double - */ - Quantity: FormControl, - - /** - * LineItem Unit Amount - * Type: double - */ - UnitAmount: FormControl, - - /** See Items */ - ItemCode: FormControl, - - /** See Accounts */ - AccountCode: FormControl, - - /** The tax type from TaxRates */ - TaxType: FormControl, - - /** - * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. - * Type: double - */ - TaxAmount: FormControl, - - /** - * If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 � DiscountRate)/100) - * Type: double - */ - LineAmount: FormControl, - - /** - * Percentage discount being applied to a line item (only supported on ACCREC invoices � ACC PAY invoices and credit notes in Xero do not support discounts - * Type: double - */ - DiscountRate: FormControl, - - /** - * Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. - * Type: double - */ - DiscountAmount: FormControl, - - /** The Xero identifier for a Repeating Invoice */ - RepeatingInvoiceID: FormControl, - } - export function CreateLineItemFormGroup() { - return new FormGroup({ - LineItemID: new FormControl(undefined), - Description: new FormControl(undefined), - Quantity: new FormControl(undefined), - UnitAmount: new FormControl(undefined), - ItemCode: new FormControl(undefined), - AccountCode: new FormControl(undefined), - TaxType: new FormControl(undefined), - TaxAmount: new FormControl(undefined), - LineAmount: new FormControl(undefined), - DiscountRate: new FormControl(undefined), - DiscountAmount: new FormControl(undefined), - RepeatingInvoiceID: new FormControl(undefined), - }); - - } - - export interface LineItemTracking { - - /** The Xero identifier for a tracking category */ - TrackingCategoryID?: string | null; - - /** The Xero identifier for a tracking category option */ - TrackingOptionID?: string | null; - - /** - * The name of the tracking category - * Max length: 100 - */ - Name?: string | null; - - /** See Tracking Options */ - Option?: string | null; - } - export interface LineItemTrackingFormProperties { - - /** The Xero identifier for a tracking category */ - TrackingCategoryID: FormControl, - - /** The Xero identifier for a tracking category option */ - TrackingOptionID: FormControl, - - /** - * The name of the tracking category - * Max length: 100 - */ - Name: FormControl, - - /** See Tracking Options */ - Option: FormControl, - } - export function CreateLineItemTrackingFormGroup() { - return new FormGroup({ - TrackingCategoryID: new FormControl(undefined), - TrackingOptionID: new FormControl(undefined), - Name: new FormControl(undefined, [Validators.maxLength(100)]), - Option: new FormControl(undefined), - }); - - } - - export enum BankTransactionStatus { AUTHORISED = 0, DELETED = 1, VOIDED = 2 } - - export enum BankTransactionLineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } - - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - export enum LineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } - - export interface BankTransfers { - BankTransfers1?: Array; - } - export interface BankTransfersFormProperties { - } - export function CreateBankTransfersFormGroup() { - return new FormGroup({ - }); - - } - - export interface BankTransfer { - - /** Required */ - FromBankAccount: Account; - - /** Required */ - ToBankAccount: Account; - - /** - * amount of the transaction - * Required - * Type: double - */ - Amount: number; - - /** - * The date of the Transfer YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** The identifier of the Bank Transfer */ - BankTransferID?: string | null; - - /** - * The currency rate - * Type: double - */ - CurrencyRate?: number | null; - - /** The Bank Transaction ID for the source account */ - FromBankTransactionID?: string | null; - - /** The Bank Transaction ID for the destination account */ - ToBankTransactionID?: string | null; - - /** Boolean to indicate if a Bank Transfer has an attachment */ - HasAttachments?: boolean | null; - - /** UTC timestamp of creation date of bank transfer */ - CreatedDateUTC?: Date | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface BankTransferFormProperties { - - /** - * amount of the transaction - * Required - * Type: double - */ - Amount: FormControl, - - /** - * The date of the Transfer YYYY-MM-DD - * Type: DateOnly - */ - Date: FormControl, - - /** The identifier of the Bank Transfer */ - BankTransferID: FormControl, - - /** - * The currency rate - * Type: double - */ - CurrencyRate: FormControl, - - /** The Bank Transaction ID for the source account */ - FromBankTransactionID: FormControl, - - /** The Bank Transaction ID for the destination account */ - ToBankTransactionID: FormControl, - - /** Boolean to indicate if a Bank Transfer has an attachment */ - HasAttachments: FormControl, - - /** UTC timestamp of creation date of bank transfer */ - CreatedDateUTC: FormControl, - } - export function CreateBankTransferFormGroup() { - return new FormGroup({ - Amount: new FormControl(undefined, [Validators.required]), - Date: new FormControl(undefined), - BankTransferID: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - FromBankTransactionID: new FormControl(undefined), - ToBankTransactionID: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - CreatedDateUTC: new FormControl(undefined), - }); - - } - - export interface BatchPayments { - BatchPayments1?: Array; - } - export interface BatchPaymentsFormProperties { - } - export function CreateBatchPaymentsFormGroup() { - return new FormGroup({ - }); - - } - - export interface BatchPayment { - Account?: Account; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Reference?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Particulars?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Code?: string | null; - - /** - * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - * Max length: 18 - */ - Details?: string | null; - - /** - * (UK Only) Only shows on the statement line in Xero. Max length =18 - * Max length: 18 - */ - Narrative?: string | null; - - /** The Xero generated unique identifier for the bank transaction (read-only) */ - BatchPaymentID?: string | null; - - /** Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 */ - DateString?: string | null; - - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * Type: DateOnly - */ - Date?: Date | null; - - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - * Type: double - */ - Amount?: number | null; - Payments?: Array; - - /** PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) */ - Type?: BatchPaymentType | null; - - /** AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. */ - Status?: PaymentStatus | null; - - /** The total of the payments that make up the batch (read-only) */ - TotalAmount?: string | null; - - /** UTC timestamp of last update to the payment */ - UpdatedDateUTC?: Date | null; - - /** Booelan that tells you if the batch payment has been reconciled (read-only) */ - IsReconciled?: string | null; - } - export interface BatchPaymentFormProperties { - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Reference: FormControl, - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Particulars: FormControl, - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Code: FormControl, - - /** - * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - * Max length: 18 - */ - Details: FormControl, - - /** - * (UK Only) Only shows on the statement line in Xero. Max length =18 - * Max length: 18 - */ - Narrative: FormControl, - - /** The Xero generated unique identifier for the bank transaction (read-only) */ - BatchPaymentID: FormControl, - - /** Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 */ - DateString: FormControl, - - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * Type: DateOnly - */ - Date: FormControl, - - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - * Type: double - */ - Amount: FormControl, - - /** PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) */ - Type: FormControl, - - /** AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. */ - Status: FormControl, - - /** The total of the payments that make up the batch (read-only) */ - TotalAmount: FormControl, - - /** UTC timestamp of last update to the payment */ - UpdatedDateUTC: FormControl, - - /** Booelan that tells you if the batch payment has been reconciled (read-only) */ - IsReconciled: FormControl, - } - export function CreateBatchPaymentFormGroup() { - return new FormGroup({ - Reference: new FormControl(undefined, [Validators.maxLength(12)]), - Particulars: new FormControl(undefined, [Validators.maxLength(12)]), - Code: new FormControl(undefined, [Validators.maxLength(12)]), - Details: new FormControl(undefined, [Validators.maxLength(18)]), - Narrative: new FormControl(undefined, [Validators.maxLength(18)]), - BatchPaymentID: new FormControl(undefined), - DateString: new FormControl(undefined), - Date: new FormControl(undefined), - Amount: new FormControl(undefined), - Type: new FormControl(undefined), - Status: new FormControl(undefined), - TotalAmount: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - IsReconciled: new FormControl(undefined), - }); - - } - - export interface Payment { - Invoice?: Invoice; - CreditNote?: CreditNote; - Prepayment?: Prepayment; - Overpayment?: Overpayment; - - /** Number of invoice or credit note you are applying payment to e.g.INV-4003 */ - InvoiceNumber?: string | null; - - /** Number of invoice or credit note you are applying payment to e.g. INV-4003 */ - CreditNoteNumber?: string | null; - Account?: Account; - - /** Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) */ - Code?: string | null; - - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * Type: DateOnly - */ - Date?: Date | null; - - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - * Type: double - */ - Amount?: number | null; - - /** An optional description for the payment e.g. Direct Debit */ - Reference?: string | null; - - /** An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET */ - IsReconciled?: boolean | null; - - /** The status of the payment. */ - Status?: PaymentStatus | null; - - /** See Payment Types. */ - PaymentType?: PaymentPaymentType | null; - - /** UTC timestamp of last update to the payment */ - UpdatedDateUTC?: Date | null; - - /** The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - PaymentID?: string | null; - - /** The suppliers bank account number the payment is being made to */ - BankAccountNumber?: string | null; - - /** The suppliers bank account number the payment is being made to */ - Particulars?: string | null; - - /** The information to appear on the supplier's bank account */ - Details?: string | null; - - /** A boolean to indicate if a contact has an validation errors */ - HasAccount?: boolean | null; - - /** A boolean to indicate if a contact has an validation errors */ - HasValidationErrors?: boolean | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface PaymentFormProperties { - - /** Number of invoice or credit note you are applying payment to e.g.INV-4003 */ - InvoiceNumber: FormControl, - - /** Number of invoice or credit note you are applying payment to e.g. INV-4003 */ - CreditNoteNumber: FormControl, - - /** Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) */ - Code: FormControl, - - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * Type: DateOnly - */ - Date: FormControl, - - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 - * Type: double - */ - CurrencyRate: FormControl, - - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - * Type: double - */ - Amount: FormControl, - - /** An optional description for the payment e.g. Direct Debit */ - Reference: FormControl, - - /** An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET */ - IsReconciled: FormControl, - - /** The status of the payment. */ - Status: FormControl, - - /** See Payment Types. */ - PaymentType: FormControl, - - /** UTC timestamp of last update to the payment */ - UpdatedDateUTC: FormControl, - - /** The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - PaymentID: FormControl, - - /** The suppliers bank account number the payment is being made to */ - BankAccountNumber: FormControl, - - /** The suppliers bank account number the payment is being made to */ - Particulars: FormControl, - - /** The information to appear on the supplier's bank account */ - Details: FormControl, - - /** A boolean to indicate if a contact has an validation errors */ - HasAccount: FormControl, - - /** A boolean to indicate if a contact has an validation errors */ - HasValidationErrors: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreatePaymentFormGroup() { - return new FormGroup({ - InvoiceNumber: new FormControl(undefined), - CreditNoteNumber: new FormControl(undefined), - Code: new FormControl(undefined), - Date: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - Amount: new FormControl(undefined), - Reference: new FormControl(undefined), - IsReconciled: new FormControl(undefined), - Status: new FormControl(undefined), - PaymentType: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - PaymentID: new FormControl(undefined), - BankAccountNumber: new FormControl(undefined), - Particulars: new FormControl(undefined), - Details: new FormControl(undefined), - HasAccount: new FormControl(undefined), - HasValidationErrors: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export interface Invoice { - - /** See Invoice Types */ - Type?: InvoiceType | null; - Contact?: Contact; - - /** See LineItems */ - LineItems?: Array; - - /** - * Date invoice was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** - * Date invoice is due � YYYY-MM-DD - * Type: DateOnly - */ - DueDate?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** - * ACCREC � Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) - * Max length: 255 - */ - InvoiceNumber?: string | null; - - /** - * ACCREC only � additional reference number (max length = 255) - * Max length: 255 - */ - Reference?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ - Url?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) - * Type: double - */ - CurrencyRate?: number | null; - - /** See Invoice Status Codes */ - Status?: InvoiceStatus | null; - - /** Boolean to set whether the invoice in the Xero app should be marked as �sent�. This can be set only on invoices that have been approved */ - SentToContact?: boolean | null; - - /** - * Shown on sales invoices (Accounts Receivable) when this has been set - * Type: DateOnly - */ - ExpectedPaymentDate?: Date | null; - - /** - * Shown on bills (Accounts Payable) when this has been set - * Type: DateOnly - */ - PlannedPaymentDate?: Date | null; - - /** - * CIS deduction for UK contractors - * Type: double - */ - CISDeduction?: number | null; - - /** - * Total of invoice excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on invoice - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts - * Type: double - */ - Total?: number | null; - - /** - * Total of discounts applied on the invoice line items - * Type: double - */ - TotalDiscount?: number | null; - - /** Xero generated unique identifier for invoice */ - InvoiceID?: string | null; - - /** boolean to indicate if an invoice has an attachment */ - HasAttachments?: boolean | null; - - /** boolean to indicate if an invoice has a discount */ - IsDiscounted?: boolean | null; - - /** See Payments */ - Payments?: Array; - - /** See Prepayments */ - Prepayments?: Array; - - /** See Overpayments */ - Overpayments?: Array; - - /** - * Amount remaining to be paid on invoice - * Type: double - */ - AmountDue?: number | null; - - /** - * Sum of payments received for invoice - * Type: double - */ - AmountPaid?: number | null; - - /** - * The date the invoice was fully paid. Only returned on fully paid invoices - * Type: DateOnly - */ - FullyPaidOnDate?: Date | null; - - /** - * Sum of all credit notes, over-payments and pre-payments applied to invoice - * Type: double - */ - AmountCredited?: number | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Details of credit notes that have been applied to an invoice */ - CreditNotes?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - - /** A boolean to indicate if a invoice has an validation errors */ - HasErrors?: boolean | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - } - export interface InvoiceFormProperties { - - /** See Invoice Types */ - Type: FormControl, - - /** - * Date invoice was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date: FormControl, - - /** - * Date invoice is due � YYYY-MM-DD - * Type: DateOnly - */ - DueDate: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** - * ACCREC � Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) - * Max length: 255 - */ - InvoiceNumber: FormControl, - - /** - * ACCREC only � additional reference number (max length = 255) - * Max length: 255 - */ - Reference: FormControl, - - /** See BrandingThemes */ - BrandingThemeID: FormControl, - - /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ - Url: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) - * Type: double - */ - CurrencyRate: FormControl, - - /** See Invoice Status Codes */ - Status: FormControl, - - /** Boolean to set whether the invoice in the Xero app should be marked as �sent�. This can be set only on invoices that have been approved */ - SentToContact: FormControl, - - /** - * Shown on sales invoices (Accounts Receivable) when this has been set - * Type: DateOnly - */ - ExpectedPaymentDate: FormControl, - - /** - * Shown on bills (Accounts Payable) when this has been set - * Type: DateOnly - */ - PlannedPaymentDate: FormControl, - - /** - * CIS deduction for UK contractors - * Type: double - */ - CISDeduction: FormControl, - - /** - * Total of invoice excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * Total tax on invoice - * Type: double - */ - TotalTax: FormControl, - - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts - * Type: double - */ - Total: FormControl, - - /** - * Total of discounts applied on the invoice line items - * Type: double - */ - TotalDiscount: FormControl, - - /** Xero generated unique identifier for invoice */ - InvoiceID: FormControl, - - /** boolean to indicate if an invoice has an attachment */ - HasAttachments: FormControl, - - /** boolean to indicate if an invoice has a discount */ - IsDiscounted: FormControl, - - /** - * Amount remaining to be paid on invoice - * Type: double - */ - AmountDue: FormControl, - - /** - * Sum of payments received for invoice - * Type: double - */ - AmountPaid: FormControl, - - /** - * The date the invoice was fully paid. Only returned on fully paid invoices - * Type: DateOnly - */ - FullyPaidOnDate: FormControl, - - /** - * Sum of all credit notes, over-payments and pre-payments applied to invoice - * Type: double - */ - AmountCredited: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** A boolean to indicate if a invoice has an validation errors */ - HasErrors: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreateInvoiceFormGroup() { - return new FormGroup({ - Type: new FormControl(undefined), - Date: new FormControl(undefined), - DueDate: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - InvoiceNumber: new FormControl(undefined, [Validators.maxLength(255)]), - Reference: new FormControl(undefined, [Validators.maxLength(255)]), - BrandingThemeID: new FormControl(undefined), - Url: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - Status: new FormControl(undefined), - SentToContact: new FormControl(undefined), - ExpectedPaymentDate: new FormControl(undefined), - PlannedPaymentDate: new FormControl(undefined), - CISDeduction: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - TotalDiscount: new FormControl(undefined), - InvoiceID: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - IsDiscounted: new FormControl(undefined), - AmountDue: new FormControl(undefined), - AmountPaid: new FormControl(undefined), - FullyPaidOnDate: new FormControl(undefined), - AmountCredited: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - HasErrors: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export enum InvoiceType { ACCPAY = 0, ACCPAYCREDIT = 1, APOVERPAYMENT = 2, APPREPAYMENT = 3, ACCREC = 4, ACCRECCREDIT = 5, AROVERPAYMENT = 6, ARPREPAYMENT = 7 } - - export enum InvoiceStatus { DRAFT = 0, SUBMITTED = 1, DELETED = 2, AUTHORISED = 3, PAID = 4, VOIDED = 5 } - - export interface Prepayment { - - /** See Prepayment Types */ - Type?: PrepaymentType | null; - Contact?: Contact; - - /** - * The date the prepayment is created YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** See Prepayment Status Codes */ - Status?: PrepaymentStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Prepayment Line Items */ - LineItems?: Array; - - /** - * The subtotal of the prepayment excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * The total tax on the prepayment - * Type: double - */ - TotalTax?: number | null; - - /** - * The total of the prepayment(subtotal + total tax) - * Type: double - */ - Total?: number | null; - - /** Returns Invoice number field. Reference field isn't available. */ - Reference?: string | null; - - /** UTC timestamp of last update to the prepayment */ - UpdatedDateUTC?: Date | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** Xero generated unique identifier */ - PrepaymentID?: string | null; - - /** - * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The remaining credit balance on the prepayment - * Type: double - */ - RemainingCredit?: number | null; - - /** See Allocations */ - Allocations?: Array; - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount?: number | null; - - /** boolean to indicate if a prepayment has an attachment */ - HasAttachments?: boolean | null; - - /** See Attachments */ - Attachments?: Array; - } - export interface PrepaymentFormProperties { - - /** See Prepayment Types */ - Type: FormControl, - - /** - * The date the prepayment is created YYYY-MM-DD - * Type: DateOnly - */ - Date: FormControl, - - /** See Prepayment Status Codes */ - Status: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** - * The subtotal of the prepayment excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * The total tax on the prepayment - * Type: double - */ - TotalTax: FormControl, - - /** - * The total of the prepayment(subtotal + total tax) - * Type: double - */ - Total: FormControl, - - /** Returns Invoice number field. Reference field isn't available. */ - Reference: FormControl, - - /** UTC timestamp of last update to the prepayment */ - UpdatedDateUTC: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** Xero generated unique identifier */ - PrepaymentID: FormControl, - - /** - * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate: FormControl, - - /** - * The remaining credit balance on the prepayment - * Type: double - */ - RemainingCredit: FormControl, - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount: FormControl, - - /** boolean to indicate if a prepayment has an attachment */ - HasAttachments: FormControl, - } - export function CreatePrepaymentFormGroup() { - return new FormGroup({ - Type: new FormControl(undefined), - Date: new FormControl(undefined), - Status: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - Reference: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - PrepaymentID: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - RemainingCredit: new FormControl(undefined), - AppliedAmount: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - }); - - } - - export enum PrepaymentType { 'RECEIVE-PREPAYMENT' = 0, 'SPEND-PREPAYMENT' = 1, ARPREPAYMENT = 2, APPREPAYMENT = 3 } - - export enum PrepaymentStatus { AUTHORISED = 0, PAID = 1, VOIDED = 2 } - - export interface Allocation { - - /** Required */ - Invoice: Invoice; - Overpayment?: Overpayment; - Prepayment?: Prepayment; - CreditNote?: CreditNote; - - /** - * the amount being applied to the invoice - * Required - * Type: double - */ - Amount: number; - - /** - * the date the allocation is applied YYYY-MM-DD. - * Required - * Type: DateOnly - */ - Date: Date; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface AllocationFormProperties { - - /** - * the amount being applied to the invoice - * Required - * Type: double - */ - Amount: FormControl, - - /** - * the date the allocation is applied YYYY-MM-DD. - * Required - * Type: DateOnly - */ - Date: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreateAllocationFormGroup() { - return new FormGroup({ - Amount: new FormControl(undefined, [Validators.required]), - Date: CreateDateOnlyFormControl(), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export interface Overpayment { - - /** See Overpayment Types */ - Type?: OverpaymentType | null; - Contact?: Contact; - - /** - * The date the overpayment is created YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** See Overpayment Status Codes */ - Status?: PrepaymentStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Overpayment Line Items */ - LineItems?: Array; - - /** - * The subtotal of the overpayment excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * The total tax on the overpayment - * Type: double - */ - TotalTax?: number | null; - - /** - * The total of the overpayment (subtotal + total tax) - * Type: double - */ - Total?: number | null; - - /** UTC timestamp of last update to the overpayment */ - UpdatedDateUTC?: Date | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** Xero generated unique identifier */ - OverpaymentID?: string | null; - - /** - * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The remaining credit balance on the overpayment - * Type: double - */ - RemainingCredit?: number | null; - - /** See Allocations */ - Allocations?: Array; - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount?: number | null; - - /** See Payments */ - Payments?: Array; - - /** boolean to indicate if a overpayment has an attachment */ - HasAttachments?: boolean | null; - - /** See Attachments */ - Attachments?: Array; - } - export interface OverpaymentFormProperties { - - /** See Overpayment Types */ - Type: FormControl, - - /** - * The date the overpayment is created YYYY-MM-DD - * Type: DateOnly - */ - Date: FormControl, - - /** See Overpayment Status Codes */ - Status: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** - * The subtotal of the overpayment excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * The total tax on the overpayment - * Type: double - */ - TotalTax: FormControl, - - /** - * The total of the overpayment (subtotal + total tax) - * Type: double - */ - Total: FormControl, - - /** UTC timestamp of last update to the overpayment */ - UpdatedDateUTC: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** Xero generated unique identifier */ - OverpaymentID: FormControl, - - /** - * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate: FormControl, - - /** - * The remaining credit balance on the overpayment - * Type: double - */ - RemainingCredit: FormControl, - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount: FormControl, - - /** boolean to indicate if a overpayment has an attachment */ - HasAttachments: FormControl, - } - export function CreateOverpaymentFormGroup() { - return new FormGroup({ - Type: new FormControl(undefined), - Date: new FormControl(undefined), - Status: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - OverpaymentID: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - RemainingCredit: new FormControl(undefined), - AppliedAmount: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - }); - - } - - export enum OverpaymentType { 'RECEIVE-OVERPAYMENT' = 0, 'SPEND-OVERPAYMENT' = 1, AROVERPAYMENT = 2 } - - export interface CreditNote { - - /** See Credit Note Types */ - Type?: CreditNoteType | null; - Contact?: Contact; - - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** See Credit Note Status Codes */ - Status?: InvoiceStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Invoice Line Items */ - LineItems?: Array; - - /** - * The subtotal of the credit note excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * The total tax on the credit note - * Type: double - */ - TotalTax?: number | null; - - /** - * The total of the Credit Note(subtotal + total tax) - * Type: double - */ - Total?: number | null; - - /** UTC timestamp of last update to the credit note */ - UpdatedDateUTC?: Date | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * Date when credit note was fully paid(UTC format) - * Type: DateOnly - */ - FullyPaidOnDate?: Date | null; - - /** Xero generated unique identifier */ - CreditNoteID?: string | null; - - /** ACCRECCREDIT � Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) */ - CreditNoteNumber?: string | null; - - /** ACCRECCREDIT only � additional reference number */ - Reference?: string | null; - - /** boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) */ - SentToContact?: boolean | null; - - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The remaining credit balance on the Credit Note - * Type: double - */ - RemainingCredit?: number | null; - - /** See Allocations */ - Allocations?: Array; - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount?: number | null; - - /** See Payments */ - Payments?: Array; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** boolean to indicate if a credit note has an attachment */ - HasAttachments?: boolean | null; - - /** A boolean to indicate if a credit note has an validation errors */ - HasErrors?: boolean | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface CreditNoteFormProperties { - - /** See Credit Note Types */ - Type: FormControl, - - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date: FormControl, - - /** See Credit Note Status Codes */ - Status: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** - * The subtotal of the credit note excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * The total tax on the credit note - * Type: double - */ - TotalTax: FormControl, - - /** - * The total of the Credit Note(subtotal + total tax) - * Type: double - */ - Total: FormControl, - - /** UTC timestamp of last update to the credit note */ - UpdatedDateUTC: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** - * Date when credit note was fully paid(UTC format) - * Type: DateOnly - */ - FullyPaidOnDate: FormControl, - - /** Xero generated unique identifier */ - CreditNoteID: FormControl, - - /** ACCRECCREDIT � Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) */ - CreditNoteNumber: FormControl, - - /** ACCRECCREDIT only � additional reference number */ - Reference: FormControl, - - /** boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) */ - SentToContact: FormControl, - - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate: FormControl, - - /** - * The remaining credit balance on the Credit Note - * Type: double - */ - RemainingCredit: FormControl, - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount: FormControl, - - /** See BrandingThemes */ - BrandingThemeID: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - - /** boolean to indicate if a credit note has an attachment */ - HasAttachments: FormControl, - - /** A boolean to indicate if a credit note has an validation errors */ - HasErrors: FormControl, - } - export function CreateCreditNoteFormGroup() { - return new FormGroup({ - Type: new FormControl(undefined), - Date: new FormControl(undefined), - Status: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - FullyPaidOnDate: new FormControl(undefined), - CreditNoteID: new FormControl(undefined), - CreditNoteNumber: new FormControl(undefined), - Reference: new FormControl(undefined), - SentToContact: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - RemainingCredit: new FormControl(undefined), - AppliedAmount: new FormControl(undefined), - BrandingThemeID: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - HasErrors: new FormControl(undefined), - }); - - } - - export enum CreditNoteType { ACCPAYCREDIT = 0, ACCRECCREDIT = 1 } - - export enum PaymentStatus { AUTHORISED = 0, DELETED = 1 } - - export enum PaymentPaymentType { ACCRECPAYMENT = 0, ACCPAYPAYMENT = 1, ARCREDITPAYMENT = 2, APCREDITPAYMENT = 3, AROVERPAYMENTPAYMENT = 4, ARPREPAYMENTPAYMENT = 5, APPREPAYMENTPAYMENT = 6, APOVERPAYMENTPAYMENT = 7 } - - export enum BatchPaymentType { PAYBATCH = 0, RECBATCH = 1 } - - - /** Bank details for use on a batch payment stored with each contact */ - export interface BatchPaymentDetails { - - /** Bank account number for use with Batch Payments */ - BankAccountNumber?: string | null; - - /** Name of bank for use with Batch Payments */ - BankAccountName?: string | null; - - /** - * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - * Max length: 18 - */ - Details?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Code?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Reference?: string | null; - } - - /** Bank details for use on a batch payment stored with each contact */ - export interface BatchPaymentDetailsFormProperties { - - /** Bank account number for use with Batch Payments */ - BankAccountNumber: FormControl, - - /** Name of bank for use with Batch Payments */ - BankAccountName: FormControl, - - /** - * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - * Max length: 18 - */ - Details: FormControl, - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Code: FormControl, - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Reference: FormControl, - } - export function CreateBatchPaymentDetailsFormGroup() { - return new FormGroup({ - BankAccountNumber: new FormControl(undefined), - BankAccountName: new FormControl(undefined), - Details: new FormControl(undefined, [Validators.maxLength(18)]), - Code: new FormControl(undefined, [Validators.maxLength(12)]), - Reference: new FormControl(undefined, [Validators.maxLength(12)]), - }); - - } - - export interface BrandingThemes { - BrandingThemes1?: Array; - } - export interface BrandingThemesFormProperties { - } - export function CreateBrandingThemesFormGroup() { - return new FormGroup({ - }); - - } - - export interface PaymentServices { - PaymentServices1?: Array; - } - export interface PaymentServicesFormProperties { - } - export function CreatePaymentServicesFormGroup() { - return new FormGroup({ - }); - - } - - export interface PaymentService { - - /** Xero identifier */ - PaymentServiceID?: string | null; - - /** Name of payment service */ - PaymentServiceName?: string | null; - - /** The custom payment URL */ - PaymentServiceUrl?: string | null; - - /** The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card */ - PayNowText?: string | null; - - /** This will always be CUSTOM for payment services created via the API. */ - PaymentServiceType?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface PaymentServiceFormProperties { - - /** Xero identifier */ - PaymentServiceID: FormControl, - - /** Name of payment service */ - PaymentServiceName: FormControl, - - /** The custom payment URL */ - PaymentServiceUrl: FormControl, - - /** The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card */ - PayNowText: FormControl, - - /** This will always be CUSTOM for payment services created via the API. */ - PaymentServiceType: FormControl, - } - export function CreatePaymentServiceFormGroup() { - return new FormGroup({ - PaymentServiceID: new FormControl(undefined), - PaymentServiceName: new FormControl(undefined), - PaymentServiceUrl: new FormControl(undefined), - PayNowText: new FormControl(undefined), - PaymentServiceType: new FormControl(undefined), - }); - - } - - export interface Contacts { - Contacts1?: Array; - } - export interface ContactsFormProperties { - } - export function CreateContactsFormGroup() { - return new FormGroup({ - }); - - } - - export interface CISSettings { - CISSettings1?: Array; - } - export interface CISSettingsFormProperties { - } - export function CreateCISSettingsFormGroup() { - return new FormGroup({ - }); - - } - - export interface CISSetting { - - /** Boolean that describes if the contact is a CIS Subcontractor */ - CISEnabled?: boolean | null; - - /** - * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Rate?: number | null; - } - export interface CISSettingFormProperties { - - /** Boolean that describes if the contact is a CIS Subcontractor */ - CISEnabled: FormControl, - - /** - * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Rate: FormControl, - } - export function CreateCISSettingFormGroup() { - return new FormGroup({ - CISEnabled: new FormControl(undefined), - Rate: new FormControl(undefined), - }); - - } - - export interface CISOrgSetting { - - /** true or false - Boolean that describes if the organisation is a CIS Contractor */ - CISContractorEnabled?: boolean | null; - - /** true or false - Boolean that describes if the organisation is a CIS SubContractor */ - CISSubContractorEnabled?: boolean | null; - - /** - * CIS Deduction rate for the organisation - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Rate?: number | null; - } - export interface CISOrgSettingFormProperties { - - /** true or false - Boolean that describes if the organisation is a CIS Contractor */ - CISContractorEnabled: FormControl, - - /** true or false - Boolean that describes if the organisation is a CIS SubContractor */ - CISSubContractorEnabled: FormControl, - - /** - * CIS Deduction rate for the organisation - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Rate: FormControl, - } - export function CreateCISOrgSettingFormGroup() { - return new FormGroup({ - CISContractorEnabled: new FormControl(undefined), - CISSubContractorEnabled: new FormControl(undefined), - Rate: new FormControl(undefined), - }); - - } - - export interface ContactGroups { - ContactGroups1?: Array; - } - export interface ContactGroupsFormProperties { - } - export function CreateContactGroupsFormGroup() { - return new FormGroup({ - }); - - } - - export interface RequestEmpty { - - /** Need at least one field to create an empty JSON payload */ - Status?: string | null; - } - export interface RequestEmptyFormProperties { - - /** Need at least one field to create an empty JSON payload */ - Status: FormControl, - } - export function CreateRequestEmptyFormGroup() { - return new FormGroup({ - Status: new FormControl(undefined), - }); - - } - - export interface CreditNotes { - CreditNotes1?: Array; - } - export interface CreditNotesFormProperties { - } - export function CreateCreditNotesFormGroup() { - return new FormGroup({ - }); - - } - - export interface Allocations { - Allocations1?: Array; - } - export interface AllocationsFormProperties { - } - export function CreateAllocationsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Currencies { - Currencies1?: Array; - } - export interface CurrenciesFormProperties { - } - export function CreateCurrenciesFormGroup() { - return new FormGroup({ - }); - - } - - export interface Currency { - - /** 3 letter alpha code for the currency � see list of currency codes */ - Code?: AccountCurrencyCode | null; - - /** Name of Currency */ - Description?: string | null; - } - export interface CurrencyFormProperties { - - /** 3 letter alpha code for the currency � see list of currency codes */ - Code: FormControl, - - /** Name of Currency */ - Description: FormControl, - } - export function CreateCurrencyFormGroup() { - return new FormGroup({ - Code: new FormControl(undefined), - Description: new FormControl(undefined), - }); - - } - - - /** 3 letter alpha code for the currency � see list of currency codes */ - export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - export interface Employees { - Employees1?: Array; - } - export interface EmployeesFormProperties { - } - export function CreateEmployeesFormGroup() { - return new FormGroup({ - }); - - } - - export interface Employee { - - /** The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - EmployeeID?: string | null; - - /** Current status of an employee � see contact status types */ - Status?: ContactContactStatus | null; - - /** - * First name of an employee (max length = 255) - * Max length: 255 - */ - FirstName?: string | null; - - /** - * Last name of an employee (max length = 255) - * Max length: 255 - */ - LastName?: string | null; - ExternalLink?: ExternalLink; - UpdatedDateUTC?: Date | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface EmployeeFormProperties { - - /** The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - EmployeeID: FormControl, - - /** Current status of an employee � see contact status types */ - Status: FormControl, - - /** - * First name of an employee (max length = 255) - * Max length: 255 - */ - FirstName: FormControl, - - /** - * Last name of an employee (max length = 255) - * Max length: 255 - */ - LastName: FormControl, - UpdatedDateUTC: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreateEmployeeFormGroup() { - return new FormGroup({ - EmployeeID: new FormControl(undefined), - Status: new FormControl(undefined), - FirstName: new FormControl(undefined, [Validators.maxLength(255)]), - LastName: new FormControl(undefined, [Validators.maxLength(255)]), - UpdatedDateUTC: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export interface ExternalLink { - - /** See External link types */ - LinkType?: ExternalLinkLinkType | null; - - /** URL for service e.g. http://twitter.com/xeroapi */ - Url?: string | null; - Description?: string | null; - } - export interface ExternalLinkFormProperties { - - /** See External link types */ - LinkType: FormControl, - - /** URL for service e.g. http://twitter.com/xeroapi */ - Url: FormControl, - Description: FormControl, - } - export function CreateExternalLinkFormGroup() { - return new FormGroup({ - LinkType: new FormControl(undefined), - Url: new FormControl(undefined), - Description: new FormControl(undefined), - }); - - } - - export enum ExternalLinkLinkType { Facebook = 0, GooglePlus = 1, LinkedIn = 2, Twitter = 3, Website = 4 } - - export interface ExpenseClaims { - ExpenseClaims1?: Array; - } - export interface ExpenseClaimsFormProperties { - } - export function CreateExpenseClaimsFormGroup() { - return new FormGroup({ - }); - - } - - export interface ExpenseClaim { - - /** Xero generated unique identifier for an expense claim */ - ExpenseClaimID?: string | null; - - /** Current status of an expense claim � see status types */ - Status?: ExpenseClaimStatus | null; - - /** See Payments */ - Payments?: Array; - User?: User; - Receipts?: Array; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** - * The total of an expense claim being paid - * Type: double - */ - Total?: number | null; - - /** - * The amount due to be paid for an expense claim - * Type: double - */ - AmountDue?: number | null; - - /** - * The amount still to pay for an expense claim - * Type: double - */ - AmountPaid?: number | null; - - /** - * The date when the expense claim is due to be paid YYYY-MM-DD - * Type: DateOnly - */ - PaymentDueDate?: Date | null; - - /** - * The date the expense claim will be reported in Xero YYYY-MM-DD - * Type: DateOnly - */ - ReportingDate?: Date | null; - - /** The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 */ - ReceiptID?: string | null; - } - export interface ExpenseClaimFormProperties { - - /** Xero generated unique identifier for an expense claim */ - ExpenseClaimID: FormControl, - - /** Current status of an expense claim � see status types */ - Status: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** - * The total of an expense claim being paid - * Type: double - */ - Total: FormControl, - - /** - * The amount due to be paid for an expense claim - * Type: double - */ - AmountDue: FormControl, - - /** - * The amount still to pay for an expense claim - * Type: double - */ - AmountPaid: FormControl, - - /** - * The date when the expense claim is due to be paid YYYY-MM-DD - * Type: DateOnly - */ - PaymentDueDate: FormControl, - - /** - * The date the expense claim will be reported in Xero YYYY-MM-DD - * Type: DateOnly - */ - ReportingDate: FormControl, - - /** The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 */ - ReceiptID: FormControl, - } - export function CreateExpenseClaimFormGroup() { - return new FormGroup({ - ExpenseClaimID: new FormControl(undefined), - Status: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - Total: new FormControl(undefined), - AmountDue: new FormControl(undefined), - AmountPaid: new FormControl(undefined), - PaymentDueDate: new FormControl(undefined), - ReportingDate: new FormControl(undefined), - ReceiptID: new FormControl(undefined), - }); - - } - - export enum ExpenseClaimStatus { SUBMITTED = 0, AUTHORISED = 1, PAID = 2, VOIDED = 3, DELETED = 4 } - - export interface User { - - /** Xero identifier */ - UserID?: string | null; - - /** Email address of user */ - EmailAddress?: string | null; - - /** First name of user */ - FirstName?: string | null; - - /** Last name of user */ - LastName?: string | null; - - /** Timestamp of last change to user */ - UpdatedDateUTC?: Date | null; - - /** Boolean to indicate if user is the subscriber */ - IsSubscriber?: boolean | null; - - /** User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) */ - OrganisationRole?: UserOrganisationRole | null; - } - export interface UserFormProperties { - - /** Xero identifier */ - UserID: FormControl, - - /** Email address of user */ - EmailAddress: FormControl, - - /** First name of user */ - FirstName: FormControl, - - /** Last name of user */ - LastName: FormControl, - - /** Timestamp of last change to user */ - UpdatedDateUTC: FormControl, - - /** Boolean to indicate if user is the subscriber */ - IsSubscriber: FormControl, - - /** User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) */ - OrganisationRole: FormControl, - } - export function CreateUserFormGroup() { - return new FormGroup({ - UserID: new FormControl(undefined), - EmailAddress: new FormControl(undefined), - FirstName: new FormControl(undefined), - LastName: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - IsSubscriber: new FormControl(undefined), - OrganisationRole: new FormControl(undefined), - }); - - } - - export enum UserOrganisationRole { READONLY = 0, INVOICEONLY = 1, STANDARD = 2, FINANCIALADVISER = 3, MANAGEDCLIENT = 4, CASHBOOKCLIENT = 5, UNKNOWN = 6 } - - export interface Receipt { - - /** - * Date of receipt � YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - Contact?: Contact; - LineItems?: Array; - User?: User; - - /** Additional reference number */ - Reference?: string | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** - * Total of receipt excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on receipt - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total?: number | null; - - /** Xero generated unique identifier for receipt */ - ReceiptID?: string | null; - - /** Current status of receipt � see status types */ - Status?: ReceiptStatus | null; - - /** Xero generated sequence number for receipt in current claim for a given user */ - ReceiptNumber?: string | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** boolean to indicate if a receipt has an attachment */ - HasAttachments?: boolean | null; - - /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ - Url?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - export interface ReceiptFormProperties { - - /** - * Date of receipt � YYYY-MM-DD - * Type: DateOnly - */ - Date: FormControl, - - /** Additional reference number */ - Reference: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** - * Total of receipt excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * Total tax on receipt - * Type: double - */ - TotalTax: FormControl, - - /** - * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total: FormControl, - - /** Xero generated unique identifier for receipt */ - ReceiptID: FormControl, - - /** Current status of receipt � see status types */ - Status: FormControl, - - /** Xero generated sequence number for receipt in current claim for a given user */ - ReceiptNumber: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** boolean to indicate if a receipt has an attachment */ - HasAttachments: FormControl, - - /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ - Url: FormControl, - } - export function CreateReceiptFormGroup() { - return new FormGroup({ - Date: new FormControl(undefined), - Reference: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - ReceiptID: new FormControl(undefined), - Status: new FormControl(undefined), - ReceiptNumber: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - Url: new FormControl(undefined), - }); - - } - - export enum ReceiptStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, DECLINED = 3, VOIDED = 4 } - - export interface HistoryRecords { - HistoryRecords1?: Array; - } - export interface HistoryRecordsFormProperties { - } - export function CreateHistoryRecordsFormGroup() { - return new FormGroup({ - }); - - } - - export interface HistoryRecord { - - /** details */ - Details?: string | null; - - /** Name of branding theme */ - Changes?: string | null; - - /** has a value of 0 */ - User?: string | null; - - /** UTC timestamp of creation date of branding theme */ - DateUTC?: Date | null; - } - export interface HistoryRecordFormProperties { - - /** details */ - Details: FormControl, - - /** Name of branding theme */ - Changes: FormControl, - - /** has a value of 0 */ - User: FormControl, - - /** UTC timestamp of creation date of branding theme */ - DateUTC: FormControl, - } - export function CreateHistoryRecordFormGroup() { - return new FormGroup({ - Details: new FormControl(undefined), - Changes: new FormControl(undefined), - User: new FormControl(undefined), - DateUTC: new FormControl(undefined), - }); - - } - - export interface Invoices { - Invoices1?: Array; - } - export interface InvoicesFormProperties { - } - export function CreateInvoicesFormGroup() { - return new FormGroup({ - }); - - } - - export interface OnlineInvoices { - OnlineInvoices1?: Array; - } - export interface OnlineInvoicesFormProperties { - } - export function CreateOnlineInvoicesFormGroup() { - return new FormGroup({ - }); - - } - - export interface OnlineInvoice { - - /** the URL to an online invoice */ - OnlineInvoiceUrl?: string | null; - } - export interface OnlineInvoiceFormProperties { - - /** the URL to an online invoice */ - OnlineInvoiceUrl: FormControl, - } - export function CreateOnlineInvoiceFormGroup() { - return new FormGroup({ - OnlineInvoiceUrl: new FormControl(undefined), - }); - - } - - export interface InvoiceReminders { - InvoiceReminders1?: Array; - } - export interface InvoiceRemindersFormProperties { - } - export function CreateInvoiceRemindersFormGroup() { - return new FormGroup({ - }); - - } - - export interface InvoiceReminder { - - /** setting for on or off */ - Enabled?: boolean | null; - } - export interface InvoiceReminderFormProperties { - - /** setting for on or off */ - Enabled: FormControl, - } - export function CreateInvoiceReminderFormGroup() { - return new FormGroup({ - Enabled: new FormControl(undefined), - }); - - } - - export interface Items { - Items1?: Array; - } - export interface ItemsFormProperties { - } - export function CreateItemsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Item { - - /** - * User defined item code (max length = 30) - * Required - * Max length: 30 - */ - Code: string; - - /** The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item */ - InventoryAssetAccountCode?: string | null; - - /** - * The name of the item (max length = 50) - * Max length: 50 - */ - Name?: string | null; - - /** Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. */ - IsSold?: boolean | null; - - /** Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. */ - IsPurchased?: boolean | null; - - /** - * The sales description of the item (max length = 4000) - * Max length: 4000 - */ - Description?: string | null; - - /** - * The purchase description of the item (max length = 4000) - * Max length: 4000 - */ - PurchaseDescription?: string | null; - PurchaseDetails?: Purchase; - SalesDetails?: Purchase; - - /** True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. */ - IsTrackedAsInventory?: boolean | null; - - /** - * The value of the item on hand. Calculated using average cost accounting. - * Type: double - */ - TotalCostPool?: number | null; - - /** - * The quantity of the item on hand - * Type: double - */ - QuantityOnHand?: number | null; - - /** Last modified date in UTC format */ - UpdatedDateUTC?: Date | null; - - /** The Xero identifier for an Item */ - ItemID?: string | null; - - /** Status of object */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface ItemFormProperties { - - /** - * User defined item code (max length = 30) - * Required - * Max length: 30 - */ - Code: FormControl, - - /** The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item */ - InventoryAssetAccountCode: FormControl, - - /** - * The name of the item (max length = 50) - * Max length: 50 - */ - Name: FormControl, - - /** Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. */ - IsSold: FormControl, - - /** Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. */ - IsPurchased: FormControl, - - /** - * The sales description of the item (max length = 4000) - * Max length: 4000 - */ - Description: FormControl, - - /** - * The purchase description of the item (max length = 4000) - * Max length: 4000 - */ - PurchaseDescription: FormControl, - - /** True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. */ - IsTrackedAsInventory: FormControl, - - /** - * The value of the item on hand. Calculated using average cost accounting. - * Type: double - */ - TotalCostPool: FormControl, - - /** - * The quantity of the item on hand - * Type: double - */ - QuantityOnHand: FormControl, - - /** Last modified date in UTC format */ - UpdatedDateUTC: FormControl, - - /** The Xero identifier for an Item */ - ItemID: FormControl, - - /** Status of object */ - StatusAttributeString: FormControl, - } - export function CreateItemFormGroup() { - return new FormGroup({ - Code: new FormControl(undefined, [Validators.required, Validators.maxLength(30)]), - InventoryAssetAccountCode: new FormControl(undefined), - Name: new FormControl(undefined, [Validators.maxLength(50)]), - IsSold: new FormControl(undefined), - IsPurchased: new FormControl(undefined), - Description: new FormControl(undefined, [Validators.maxLength(4000)]), - PurchaseDescription: new FormControl(undefined, [Validators.maxLength(4000)]), - IsTrackedAsInventory: new FormControl(undefined), - TotalCostPool: new FormControl(undefined), - QuantityOnHand: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - ItemID: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export interface Purchase { - - /** - * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. - * Type: double - */ - UnitPrice?: number | null; - - /** Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items */ - AccountCode?: string | null; - - /** Cost of goods sold account. Only applicable to the purchase details of tracked items. */ - COGSAccountCode?: string | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - } - export interface PurchaseFormProperties { - - /** - * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. - * Type: double - */ - UnitPrice: FormControl, - - /** Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items */ - AccountCode: FormControl, - - /** Cost of goods sold account. Only applicable to the purchase details of tracked items. */ - COGSAccountCode: FormControl, - - /** The tax type from TaxRates */ - TaxType: FormControl, - } - export function CreatePurchaseFormGroup() { - return new FormGroup({ - UnitPrice: new FormControl(undefined), - AccountCode: new FormControl(undefined), - COGSAccountCode: new FormControl(undefined), - TaxType: new FormControl(undefined), - }); - - } - - export interface Journals { - Journals1?: Array; - } - export interface JournalsFormProperties { - } - export function CreateJournalsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Journal { - - /** Xero identifier */ - JournalID?: string | null; - - /** - * Date the journal was posted - * Type: DateOnly - */ - JournalDate?: Date | null; - - /** - * Xero generated journal number - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - JournalNumber?: number | null; - - /** Created date UTC format */ - CreatedDateUTC?: Date | null; - - /** reference field for additional indetifying information */ - Reference?: string | null; - - /** The identifier for the source transaction (e.g. InvoiceID) */ - SourceID?: string | null; - - /** The journal source type. The type of transaction that created the journal */ - SourceType?: JournalSourceType | null; - - /** See JournalLines */ - JournalLines?: Array; - } - export interface JournalFormProperties { - - /** Xero identifier */ - JournalID: FormControl, - - /** - * Date the journal was posted - * Type: DateOnly - */ - JournalDate: FormControl, - - /** - * Xero generated journal number - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - JournalNumber: FormControl, - - /** Created date UTC format */ - CreatedDateUTC: FormControl, - - /** reference field for additional indetifying information */ - Reference: FormControl, - - /** The identifier for the source transaction (e.g. InvoiceID) */ - SourceID: FormControl, - - /** The journal source type. The type of transaction that created the journal */ - SourceType: FormControl, - } - export function CreateJournalFormGroup() { - return new FormGroup({ - JournalID: new FormControl(undefined), - JournalDate: new FormControl(undefined), - JournalNumber: new FormControl(undefined), - CreatedDateUTC: new FormControl(undefined), - Reference: new FormControl(undefined), - SourceID: new FormControl(undefined), - SourceType: new FormControl(undefined), - }); - - } - - export enum JournalSourceType { ACCREC = 0, ACCPAY = 1, ACCRECCREDIT = 2, ACCPAYCREDIT = 3, ACCRECPAYMENT = 4, ACCPAYPAYMENT = 5, ARCREDITPAYMENT = 6, APCREDITPAYMENT = 7, CASHREC = 8, CASHPAID = 9, TRANSFER = 10, ARPREPAYMENT = 11, APPREPAYMENT = 12, AROVERPAYMENT = 13, APOVERPAYMENT = 14, EXPCLAIM = 15, EXPPAYMENT = 16, MANJOURNAL = 17, PAYSLIP = 18, WAGEPAYABLE = 19, INTEGRATEDPAYROLLPE = 20, INTEGRATEDPAYROLLPT = 21, EXTERNALSPENDMONEY = 22, INTEGRATEDPAYROLLPTPAYMENT = 23, INTEGRATEDPAYROLLCN = 24 } - - export interface JournalLine { - - /** Xero identifier for Journal */ - JournalLineID?: string | null; - - /** See Accounts */ - AccountID?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** See Account Types */ - AccountType?: AccountType | null; - - /** See AccountCodes */ - AccountName?: string | null; - - /** The description from the source transaction line item. Only returned if populated. */ - Description?: string | null; - - /** - * Net amount of journal line. This will be a positive value for a debit and negative for a credit - * Type: double - */ - NetAmount?: number | null; - - /** - * Gross amount of journal line (NetAmount + TaxAmount). - * Type: double - */ - GrossAmount?: number | null; - - /** - * Total tax on a journal line - * Type: double - */ - TaxAmount?: number | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** see TaxRates */ - TaxName?: string | null; - - /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ - TrackingCategories?: Array; - } - export interface JournalLineFormProperties { - - /** Xero identifier for Journal */ - JournalLineID: FormControl, - - /** See Accounts */ - AccountID: FormControl, - - /** See Accounts */ - AccountCode: FormControl, - - /** See Account Types */ - AccountType: FormControl, - - /** See AccountCodes */ - AccountName: FormControl, - - /** The description from the source transaction line item. Only returned if populated. */ - Description: FormControl, - - /** - * Net amount of journal line. This will be a positive value for a debit and negative for a credit - * Type: double - */ - NetAmount: FormControl, - - /** - * Gross amount of journal line (NetAmount + TaxAmount). - * Type: double - */ - GrossAmount: FormControl, - - /** - * Total tax on a journal line - * Type: double - */ - TaxAmount: FormControl, - - /** The tax type from TaxRates */ - TaxType: FormControl, - - /** see TaxRates */ - TaxName: FormControl, - } - export function CreateJournalLineFormGroup() { - return new FormGroup({ - JournalLineID: new FormControl(undefined), - AccountID: new FormControl(undefined), - AccountCode: new FormControl(undefined), - AccountType: new FormControl(undefined), - AccountName: new FormControl(undefined), - Description: new FormControl(undefined), - NetAmount: new FormControl(undefined), - GrossAmount: new FormControl(undefined), - TaxAmount: new FormControl(undefined), - TaxType: new FormControl(undefined), - TaxName: new FormControl(undefined), - }); - - } - - export interface TrackingCategory { - - /** The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - TrackingCategoryID?: string | null; - - /** The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f */ - TrackingOptionID?: string | null; - - /** - * The name of the tracking category e.g. Department, Region (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** - * The option name of the tracking option e.g. East, West (max length = 100) - * Max length: 100 - */ - Option?: string | null; - - /** The status of a tracking category */ - Status?: AccountStatus | null; - - /** See Tracking Options */ - Options?: Array; - } - export interface TrackingCategoryFormProperties { - - /** The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - TrackingCategoryID: FormControl, - - /** The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f */ - TrackingOptionID: FormControl, - - /** - * The name of the tracking category e.g. Department, Region (max length = 100) - * Max length: 100 - */ - Name: FormControl, - - /** - * The option name of the tracking option e.g. East, West (max length = 100) - * Max length: 100 - */ - Option: FormControl, - - /** The status of a tracking category */ - Status: FormControl, - } - export function CreateTrackingCategoryFormGroup() { - return new FormGroup({ - TrackingCategoryID: new FormControl(undefined), - TrackingOptionID: new FormControl(undefined), - Name: new FormControl(undefined, [Validators.maxLength(100)]), - Option: new FormControl(undefined, [Validators.maxLength(100)]), - Status: new FormControl(undefined), - }); - - } - - export interface TrackingOption { - - /** The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a */ - TrackingOptionID?: string | null; - - /** - * The name of the tracking option e.g. Marketing, East (max length = 50) - * Max length: 50 - */ - Name?: string | null; - - /** The status of a tracking option */ - Status?: AccountStatus | null; - - /** Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - TrackingCategoryID?: string | null; - } - export interface TrackingOptionFormProperties { - - /** The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a */ - TrackingOptionID: FormControl, - - /** - * The name of the tracking option e.g. Marketing, East (max length = 50) - * Max length: 50 - */ - Name: FormControl, - - /** The status of a tracking option */ - Status: FormControl, - - /** Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - TrackingCategoryID: FormControl, - } - export function CreateTrackingOptionFormGroup() { - return new FormGroup({ - TrackingOptionID: new FormControl(undefined), - Name: new FormControl(undefined, [Validators.maxLength(50)]), - Status: new FormControl(undefined), - TrackingCategoryID: new FormControl(undefined), - }); - - } - - export interface LinkedTransactions { - LinkedTransactions1?: Array; - } - export interface LinkedTransactionsFormProperties { - } - export function CreateLinkedTransactionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface LinkedTransaction { - - /** Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice */ - SourceTransactionID?: string | null; - - /** The line item identifier from the source transaction. */ - SourceLineItemID?: string | null; - - /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ - ContactID?: string | null; - - /** Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice */ - TargetTransactionID?: string | null; - - /** The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. */ - TargetLineItemID?: string | null; - - /** The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - LinkedTransactionID?: string | null; - - /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ - Status?: LinkedTransactionStatus | null; - - /** This will always be BILLABLEEXPENSE. More types may be added in future. */ - Type?: LinkedTransactionType | null; - - /** The last modified date in UTC format */ - UpdatedDateUTC?: Date | null; - - /** The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. */ - SourceTransactionTypeCode?: LinkedTransactionSourceTransactionTypeCode | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface LinkedTransactionFormProperties { - - /** Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice */ - SourceTransactionID: FormControl, - - /** The line item identifier from the source transaction. */ - SourceLineItemID: FormControl, - - /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ - ContactID: FormControl, - - /** Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice */ - TargetTransactionID: FormControl, - - /** The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. */ - TargetLineItemID: FormControl, - - /** The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - LinkedTransactionID: FormControl, - - /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ - Status: FormControl, - - /** This will always be BILLABLEEXPENSE. More types may be added in future. */ - Type: FormControl, - - /** The last modified date in UTC format */ - UpdatedDateUTC: FormControl, - - /** The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. */ - SourceTransactionTypeCode: FormControl, - } - export function CreateLinkedTransactionFormGroup() { - return new FormGroup({ - SourceTransactionID: new FormControl(undefined), - SourceLineItemID: new FormControl(undefined), - ContactID: new FormControl(undefined), - TargetTransactionID: new FormControl(undefined), - TargetLineItemID: new FormControl(undefined), - LinkedTransactionID: new FormControl(undefined), - Status: new FormControl(undefined), - Type: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - SourceTransactionTypeCode: new FormControl(undefined), - }); - - } - - export enum LinkedTransactionStatus { APPROVED = 0, DRAFT = 1, ONDRAFT = 2, BILLED = 3, VOIDED = 4 } - - export enum LinkedTransactionType { BILLABLEEXPENSE = 0 } - - export enum LinkedTransactionSourceTransactionTypeCode { ACCPAY = 0, SPEND = 1 } - - export interface ManualJournals { - ManualJournals1?: Array; - } - export interface ManualJournalsFormProperties { - } - export function CreateManualJournalsFormGroup() { - return new FormGroup({ - }); - - } - - export interface ManualJournal { - - /** - * Description of journal being posted - * Required - */ - Narration: string; - - /** See JournalLines */ - JournalLines?: Array; - - /** - * Date journal was posted � YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Manual Journal Status Codes */ - Status?: ManualJournalStatus | null; - - /** Url link to a source document � shown as �Go to [appName]� in the Xero app */ - Url?: string | null; - - /** Boolean � default is true if not specified */ - ShowOnCashBasisReports?: boolean | null; - - /** Boolean to indicate if a manual journal has an attachment */ - HasAttachments?: boolean | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** The Xero identifier for a Manual Journal */ - ManualJournalID?: string | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - export interface ManualJournalFormProperties { - - /** - * Description of journal being posted - * Required - */ - Narration: FormControl, - - /** - * Date journal was posted � YYYY-MM-DD - * Type: DateOnly - */ - Date: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** See Manual Journal Status Codes */ - Status: FormControl, - - /** Url link to a source document � shown as �Go to [appName]� in the Xero app */ - Url: FormControl, - - /** Boolean � default is true if not specified */ - ShowOnCashBasisReports: FormControl, - - /** Boolean to indicate if a manual journal has an attachment */ - HasAttachments: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** The Xero identifier for a Manual Journal */ - ManualJournalID: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreateManualJournalFormGroup() { - return new FormGroup({ - Narration: new FormControl(undefined, [Validators.required]), - Date: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - Status: new FormControl(undefined), - Url: new FormControl(undefined), - ShowOnCashBasisReports: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - ManualJournalID: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export interface ManualJournalLine { - - /** - * total for line. Debits are positive, credits are negative value - * Type: double - */ - LineAmount?: number | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** Description for journal line */ - Description?: string | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ - Tracking?: Array; - - /** - * The calculated tax amount based on the TaxType and LineAmount - * Type: double - */ - TaxAmount?: number | null; - - /** is the line blank */ - IsBlank?: boolean | null; - } - export interface ManualJournalLineFormProperties { - - /** - * total for line. Debits are positive, credits are negative value - * Type: double - */ - LineAmount: FormControl, - - /** See Accounts */ - AccountCode: FormControl, - - /** Description for journal line */ - Description: FormControl, - - /** The tax type from TaxRates */ - TaxType: FormControl, - - /** - * The calculated tax amount based on the TaxType and LineAmount - * Type: double - */ - TaxAmount: FormControl, - - /** is the line blank */ - IsBlank: FormControl, - } - export function CreateManualJournalLineFormGroup() { - return new FormGroup({ - LineAmount: new FormControl(undefined), - AccountCode: new FormControl(undefined), - Description: new FormControl(undefined), - TaxType: new FormControl(undefined), - TaxAmount: new FormControl(undefined), - IsBlank: new FormControl(undefined), - }); - - } - - export enum ManualJournalStatus { DRAFT = 0, POSTED = 1, DELETED = 2, VOIDED = 3, ARCHIVED = 4 } - - export interface Organisations { - Organisations1?: Array; - } - export interface OrganisationsFormProperties { - } - export function CreateOrganisationsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Organisation { - - /** Unique Xero identifier */ - OrganisationID?: string | null; - - /** Display a unique key used for Xero-to-Xero transactions */ - APIKey?: string | null; - - /** Display name of organisation shown in Xero */ - Name?: string | null; - - /** Organisation name shown on Reports */ - LegalName?: string | null; - - /** Boolean to describe if organisation is registered with a local tax authority i.e. true, false */ - PaysTax?: boolean | null; - - /** See Version Types */ - Version?: OrganisationVersion | null; - - /** Organisation Type */ - OrganisationType?: OrganisationOrganisationType | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - BaseCurrency?: AccountCurrencyCode | null; - CountryCode?: OrganisationCountryCode | null; - - /** Boolean to describe if organisation is a demo company. */ - IsDemoCompany?: boolean | null; - - /** Will be set to ACTIVE if you can connect to organisation via the Xero API */ - OrganisationStatus?: string | null; - - /** Shows for New Zealand, Australian and UK organisations */ - RegistrationNumber?: string | null; - - /** Shown if set. US Only. */ - EmployerIdentificationNumber?: string | null; - - /** Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). */ - TaxNumber?: string | null; - - /** - * Calendar day e.g. 0-31 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - FinancialYearEndDay?: number | null; - - /** - * Calendar Month e.g. 1-12 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - FinancialYearEndMonth?: number | null; - - /** The accounting basis used for tax returns. See Sales Tax Basis */ - SalesTaxBasis?: OrganisationSalesTaxBasis | null; - - /** The frequency with which tax returns are processed. See Sales Tax Period */ - SalesTaxPeriod?: OrganisationSalesTaxPeriod | null; - - /** The default for LineAmountTypes on sales transactions */ - DefaultSalesTax?: string | null; - - /** The default for LineAmountTypes on purchase transactions */ - DefaultPurchasesTax?: string | null; - - /** - * Shown if set. See lock dates - * Type: DateOnly - */ - PeriodLockDate?: Date | null; - - /** - * Shown if set. See lock dates - * Type: DateOnly - */ - EndOfYearLockDate?: Date | null; - - /** Timestamp when the organisation was created in Xero */ - CreatedDateUTC?: Date | null; - - /** Timezone specifications */ - Timezone?: OrganisationTimezone | null; - - /** Organisation Type */ - OrganisationEntityType?: OrganisationOrganisationType | null; - - /** A unique identifier for the organisation. Potential uses. */ - ShortCode?: string | null; - - /** Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) */ - Class?: OrganisationClass | null; - - /** BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) */ - Edition?: OrganisationEdition | null; - - /** Description of business type as defined in Organisation settings */ - LineOfBusiness?: string | null; - - /** Address details for organisation � see Addresses */ - Addresses?: Array
; - - /** Phones details for organisation � see Phones */ - Phones?: Array; - - /** Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below */ - ExternalLinks?: Array; - PaymentTerms?: PaymentTerm; - } - export interface OrganisationFormProperties { - - /** Unique Xero identifier */ - OrganisationID: FormControl, - - /** Display a unique key used for Xero-to-Xero transactions */ - APIKey: FormControl, - - /** Display name of organisation shown in Xero */ - Name: FormControl, - - /** Organisation name shown on Reports */ - LegalName: FormControl, - - /** Boolean to describe if organisation is registered with a local tax authority i.e. true, false */ - PaysTax: FormControl, - - /** See Version Types */ - Version: FormControl, - - /** Organisation Type */ - OrganisationType: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - BaseCurrency: FormControl, - CountryCode: FormControl, - - /** Boolean to describe if organisation is a demo company. */ - IsDemoCompany: FormControl, - - /** Will be set to ACTIVE if you can connect to organisation via the Xero API */ - OrganisationStatus: FormControl, - - /** Shows for New Zealand, Australian and UK organisations */ - RegistrationNumber: FormControl, - - /** Shown if set. US Only. */ - EmployerIdentificationNumber: FormControl, - - /** Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). */ - TaxNumber: FormControl, - - /** - * Calendar day e.g. 0-31 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - FinancialYearEndDay: FormControl, - - /** - * Calendar Month e.g. 1-12 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - FinancialYearEndMonth: FormControl, - - /** The accounting basis used for tax returns. See Sales Tax Basis */ - SalesTaxBasis: FormControl, - - /** The frequency with which tax returns are processed. See Sales Tax Period */ - SalesTaxPeriod: FormControl, - - /** The default for LineAmountTypes on sales transactions */ - DefaultSalesTax: FormControl, - - /** The default for LineAmountTypes on purchase transactions */ - DefaultPurchasesTax: FormControl, - - /** - * Shown if set. See lock dates - * Type: DateOnly - */ - PeriodLockDate: FormControl, - - /** - * Shown if set. See lock dates - * Type: DateOnly - */ - EndOfYearLockDate: FormControl, - - /** Timestamp when the organisation was created in Xero */ - CreatedDateUTC: FormControl, - - /** Timezone specifications */ - Timezone: FormControl, - - /** Organisation Type */ - OrganisationEntityType: FormControl, - - /** A unique identifier for the organisation. Potential uses. */ - ShortCode: FormControl, - - /** Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) */ - Class: FormControl, - - /** BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) */ - Edition: FormControl, - - /** Description of business type as defined in Organisation settings */ - LineOfBusiness: FormControl, - } - export function CreateOrganisationFormGroup() { - return new FormGroup({ - OrganisationID: new FormControl(undefined), - APIKey: new FormControl(undefined), - Name: new FormControl(undefined), - LegalName: new FormControl(undefined), - PaysTax: new FormControl(undefined), - Version: new FormControl(undefined), - OrganisationType: new FormControl(undefined), - BaseCurrency: new FormControl(undefined), - CountryCode: new FormControl(undefined), - IsDemoCompany: new FormControl(undefined), - OrganisationStatus: new FormControl(undefined), - RegistrationNumber: new FormControl(undefined), - EmployerIdentificationNumber: new FormControl(undefined), - TaxNumber: new FormControl(undefined), - FinancialYearEndDay: new FormControl(undefined), - FinancialYearEndMonth: new FormControl(undefined), - SalesTaxBasis: new FormControl(undefined), - SalesTaxPeriod: new FormControl(undefined), - DefaultSalesTax: new FormControl(undefined), - DefaultPurchasesTax: new FormControl(undefined), - PeriodLockDate: new FormControl(undefined), - EndOfYearLockDate: new FormControl(undefined), - CreatedDateUTC: new FormControl(undefined), - Timezone: new FormControl(undefined), - OrganisationEntityType: new FormControl(undefined), - ShortCode: new FormControl(undefined), - Class: new FormControl(undefined), - Edition: new FormControl(undefined), - LineOfBusiness: new FormControl(undefined), - }); - - } - - export enum OrganisationVersion { AU = 0, NZ = 1, GLOBAL = 2, UK = 3, US = 4, AUONRAMP = 5, NZONRAMP = 6, GLOBALONRAMP = 7, UKONRAMP = 8, USONRAMP = 9 } - - export enum OrganisationOrganisationType { ACCOUNTING_PRACTICE = 0, COMPANY = 1, CHARITY = 2, CLUB_OR_SOCIETY = 3, LOOK_THROUGH_COMPANY = 4, NOT_FOR_PROFIT = 5, PARTNERSHIP = 6, S_CORPORATION = 7, SELF_MANAGED_SUPERANNUATION_FUND = 8, SOLE_TRADER = 9, SUPERANNUATION_FUND = 10, TRUST = 11 } - - export enum OrganisationCountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - export enum OrganisationSalesTaxBasis { PAYMENTS = 0, INVOICE = 1, NONE = 2, CASH = 3, ACCRUAL = 4, FLATRATECASH = 5, FLATRATEACCRUAL = 6, ACCRUALS = 7 } - - export enum OrganisationSalesTaxPeriod { MONTHLY = 0, QUARTERLY1 = 1, QUARTERLY2 = 2, QUARTERLY3 = 3, ANNUALLY = 4, ONEMONTHS = 5, TWOMONTHS = 6, SIXMONTHS = 7, '1MONTHLY' = 8, '2MONTHLY' = 9, '3MONTHLY' = 10, '6MONTHLY' = 11, QUARTERLY = 12, YEARLY = 13, NONE = 14 } - - export enum OrganisationTimezone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } - - export enum OrganisationClass { DEMO = 0, TRIAL = 1, STARTER = 2, STANDARD = 3, PREMIUM = 4, PREMIUM_20 = 5, PREMIUM_50 = 6, PREMIUM_100 = 7, LEDGER = 8, GST_CASHBOOK = 9, NON_GST_CASHBOOK = 10 } - - export enum OrganisationEdition { BUSINESS = 0, PARTNER = 1 } - - export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - - /** Timezone specifications */ - export enum TimeZone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } - - export enum PaymentTermType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } - - export interface Overpayments { - Overpayments1?: Array; - } - export interface OverpaymentsFormProperties { - } - export function CreateOverpaymentsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Payments { - Payments1?: Array; - } - export interface PaymentsFormProperties { - } - export function CreatePaymentsFormGroup() { - return new FormGroup({ - }); - - } - - export interface PaymentDelete { - - /** - * The status of the payment. - * Required - */ - Status: string; - } - export interface PaymentDeleteFormProperties { - - /** - * The status of the payment. - * Required - */ - Status: FormControl, - } - export function CreatePaymentDeleteFormGroup() { - return new FormGroup({ - Status: new FormControl(undefined, [Validators.required]), - }); - - } - - export interface Prepayments { - Prepayments1?: Array; - } - export interface PrepaymentsFormProperties { - } - export function CreatePrepaymentsFormGroup() { - return new FormGroup({ - }); - - } - - export interface PurchaseOrders { - PurchaseOrders1?: Array; - } - export interface PurchaseOrdersFormProperties { - } - export function CreatePurchaseOrdersFormGroup() { - return new FormGroup({ - }); - - } - - export interface PurchaseOrder { - Contact?: Contact; - - /** See LineItems */ - LineItems?: Array; - - /** - * Date purchase order was issued � YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** - * Date the goods are to be delivered � YYYY-MM-DD - * Type: DateOnly - */ - DeliveryDate?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) */ - PurchaseOrderNumber?: string | null; - - /** Additional reference number */ - Reference?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** See Purchase Order Status Codes */ - Status?: PurchaseOrderStatus | null; - - /** Boolean to set whether the purchase order should be marked as �sent�. This can be set only on purchase orders that have been approved or billed */ - SentToContact?: boolean | null; - - /** The address the goods are to be delivered to */ - DeliveryAddress?: string | null; - - /** The person that the delivery is going to */ - AttentionTo?: string | null; - - /** The phone number for the person accepting the delivery */ - Telephone?: string | null; - - /** A free text feild for instructions (500 characters max) */ - DeliveryInstructions?: string | null; - - /** - * The date the goods are expected to arrive. - * Type: DateOnly - */ - ExpectedArrivalDate?: Date | null; - - /** Xero generated unique identifier for purchase order */ - PurchaseOrderID?: string | null; - - /** - * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. - * Type: double - */ - CurrencyRate?: number | null; - - /** - * Total of purchase order excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on purchase order - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total?: number | null; - - /** - * Total of discounts applied on the purchase order line items - * Type: double - */ - TotalDiscount?: number | null; - - /** boolean to indicate if a purchase order has an attachment */ - HasAttachments?: boolean | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - export interface PurchaseOrderFormProperties { - - /** - * Date purchase order was issued � YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date: FormControl, - - /** - * Date the goods are to be delivered � YYYY-MM-DD - * Type: DateOnly - */ - DeliveryDate: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) */ - PurchaseOrderNumber: FormControl, - - /** Additional reference number */ - Reference: FormControl, - - /** See BrandingThemes */ - BrandingThemeID: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** See Purchase Order Status Codes */ - Status: FormControl, - - /** Boolean to set whether the purchase order should be marked as �sent�. This can be set only on purchase orders that have been approved or billed */ - SentToContact: FormControl, - - /** The address the goods are to be delivered to */ - DeliveryAddress: FormControl, - - /** The person that the delivery is going to */ - AttentionTo: FormControl, - - /** The phone number for the person accepting the delivery */ - Telephone: FormControl, - - /** A free text feild for instructions (500 characters max) */ - DeliveryInstructions: FormControl, - - /** - * The date the goods are expected to arrive. - * Type: DateOnly - */ - ExpectedArrivalDate: FormControl, - - /** Xero generated unique identifier for purchase order */ - PurchaseOrderID: FormControl, - - /** - * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. - * Type: double - */ - CurrencyRate: FormControl, - - /** - * Total of purchase order excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * Total tax on purchase order - * Type: double - */ - TotalTax: FormControl, - - /** - * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total: FormControl, - - /** - * Total of discounts applied on the purchase order line items - * Type: double - */ - TotalDiscount: FormControl, - - /** boolean to indicate if a purchase order has an attachment */ - HasAttachments: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreatePurchaseOrderFormGroup() { - return new FormGroup({ - Date: new FormControl(undefined), - DeliveryDate: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - PurchaseOrderNumber: new FormControl(undefined), - Reference: new FormControl(undefined), - BrandingThemeID: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - Status: new FormControl(undefined), - SentToContact: new FormControl(undefined), - DeliveryAddress: new FormControl(undefined), - AttentionTo: new FormControl(undefined), - Telephone: new FormControl(undefined), - DeliveryInstructions: new FormControl(undefined), - ExpectedArrivalDate: new FormControl(undefined), - PurchaseOrderID: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - TotalDiscount: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export enum PurchaseOrderStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, BILLED = 3, DELETED = 4 } - - export interface Quotes { - Quotes1?: Array; - } - export interface QuotesFormProperties { - } - export function CreateQuotesFormGroup() { - return new FormGroup({ - }); - - } - - export interface Quote { - - /** QuoteID GUID is automatically generated and is returned after create or GET. */ - QuoteID?: string | null; - - /** - * Unique alpha numeric code identifying a quote (Max Length = 255) - * Max length: 255 - */ - QuoteNumber?: string | null; - - /** - * Additional reference number - * Max length: 4000 - */ - Reference?: string | null; - - /** - * Terms of the quote - * Max length: 4000 - */ - Terms?: string | null; - Contact?: Contact; - - /** See LineItems */ - LineItems?: Array; - - /** - * Date quote was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** Date the quote was issued (YYYY-MM-DD) */ - DateString?: string | null; - - /** - * Date the quote expires � YYYY-MM-DD. - * Type: DateOnly - */ - ExpiryDate?: Date | null; - - /** Date the quote expires � YYYY-MM-DD. */ - ExpiryDateString?: string | null; - - /** The status of the quote. */ - Status?: QuoteStatus | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * The currency rate for a multicurrency quote - * Type: double - */ - CurrencyRate?: number | null; - - /** - * Total of quote excluding taxes. - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on quote - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts - * Type: double - */ - Total?: number | null; - - /** - * Total of discounts applied on the quote line items - * Type: double - */ - TotalDiscount?: number | null; - - /** - * Title text for the quote - * Max length: 100 - */ - Title?: string | null; - - /** - * Summary text for the quote - * Max length: 3000 - */ - Summary?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: QuoteLineAmountTypes | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - export interface QuoteFormProperties { - - /** QuoteID GUID is automatically generated and is returned after create or GET. */ - QuoteID: FormControl, - - /** - * Unique alpha numeric code identifying a quote (Max Length = 255) - * Max length: 255 - */ - QuoteNumber: FormControl, - - /** - * Additional reference number - * Max length: 4000 - */ - Reference: FormControl, - - /** - * Terms of the quote - * Max length: 4000 - */ - Terms: FormControl, - - /** - * Date quote was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date: FormControl, - - /** Date the quote was issued (YYYY-MM-DD) */ - DateString: FormControl, - - /** - * Date the quote expires � YYYY-MM-DD. - * Type: DateOnly - */ - ExpiryDate: FormControl, - - /** Date the quote expires � YYYY-MM-DD. */ - ExpiryDateString: FormControl, - - /** The status of the quote. */ - Status: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** - * The currency rate for a multicurrency quote - * Type: double - */ - CurrencyRate: FormControl, - - /** - * Total of quote excluding taxes. - * Type: double - */ - SubTotal: FormControl, - - /** - * Total tax on quote - * Type: double - */ - TotalTax: FormControl, - - /** - * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts - * Type: double - */ - Total: FormControl, - - /** - * Total of discounts applied on the quote line items - * Type: double - */ - TotalDiscount: FormControl, - - /** - * Title text for the quote - * Max length: 100 - */ - Title: FormControl, - - /** - * Summary text for the quote - * Max length: 3000 - */ - Summary: FormControl, - - /** See BrandingThemes */ - BrandingThemeID: FormControl, - - /** Last modified date UTC format */ - UpdatedDateUTC: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** A string to indicate if a invoice status */ - StatusAttributeString: FormControl, - } - export function CreateQuoteFormGroup() { - return new FormGroup({ - QuoteID: new FormControl(undefined), - QuoteNumber: new FormControl(undefined, [Validators.maxLength(255)]), - Reference: new FormControl(undefined, [Validators.maxLength(4000)]), - Terms: new FormControl(undefined, [Validators.maxLength(4000)]), - Date: new FormControl(undefined), - DateString: new FormControl(undefined), - ExpiryDate: new FormControl(undefined), - ExpiryDateString: new FormControl(undefined), - Status: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - CurrencyRate: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - TotalDiscount: new FormControl(undefined), - Title: new FormControl(undefined, [Validators.maxLength(100)]), - Summary: new FormControl(undefined, [Validators.maxLength(3000)]), - BrandingThemeID: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - StatusAttributeString: new FormControl(undefined), - }); - - } - - export enum QuoteStatus { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } - - export enum QuoteLineAmountTypes { EXCLUSIVE = 0, INCLUSIVE = 1, NOTAX = 2 } - - - /** The status of the quote. */ - export enum QuoteStatusCodes { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } - - export interface Receipts { - Receipts1?: Array; - } - export interface ReceiptsFormProperties { - } - export function CreateReceiptsFormGroup() { - return new FormGroup({ - }); - - } - - export interface RepeatingInvoices { - RepeatingInvoices1?: Array; - } - export interface RepeatingInvoicesFormProperties { - } - export function CreateRepeatingInvoicesFormGroup() { - return new FormGroup({ - }); - - } - - export interface RepeatingInvoice { - - /** See Invoice Types */ - Type?: RepeatingInvoiceType | null; - Contact?: Contact; - Schedule?: Schedule; - - /** See LineItems */ - LineItems?: Array; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** ACCREC only � additional reference number */ - Reference?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** One of the following - DRAFT or AUTHORISED � See Invoice Status Codes */ - Status?: RepeatingInvoiceStatus | null; - - /** - * Total of invoice excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on invoice - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total?: number | null; - - /** Xero generated unique identifier for repeating invoice template */ - RepeatingInvoiceID?: string | null; - - /** Xero generated unique identifier for repeating invoice template */ - ID?: string | null; - - /** boolean to indicate if an invoice has an attachment */ - HasAttachments?: boolean | null; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - export interface RepeatingInvoiceFormProperties { - - /** See Invoice Types */ - Type: FormControl, - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes: FormControl, - - /** ACCREC only � additional reference number */ - Reference: FormControl, - - /** See BrandingThemes */ - BrandingThemeID: FormControl, - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode: FormControl, - - /** One of the following - DRAFT or AUTHORISED � See Invoice Status Codes */ - Status: FormControl, - - /** - * Total of invoice excluding taxes - * Type: double - */ - SubTotal: FormControl, - - /** - * Total tax on invoice - * Type: double - */ - TotalTax: FormControl, - - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total: FormControl, - - /** Xero generated unique identifier for repeating invoice template */ - RepeatingInvoiceID: FormControl, - - /** Xero generated unique identifier for repeating invoice template */ - ID: FormControl, - - /** boolean to indicate if an invoice has an attachment */ - HasAttachments: FormControl, - } - export function CreateRepeatingInvoiceFormGroup() { - return new FormGroup({ - Type: new FormControl(undefined), - LineAmountTypes: new FormControl(undefined), - Reference: new FormControl(undefined), - BrandingThemeID: new FormControl(undefined), - CurrencyCode: new FormControl(undefined), - Status: new FormControl(undefined), - SubTotal: new FormControl(undefined), - TotalTax: new FormControl(undefined), - Total: new FormControl(undefined), - RepeatingInvoiceID: new FormControl(undefined), - ID: new FormControl(undefined), - HasAttachments: new FormControl(undefined), - }); - - } - - export enum RepeatingInvoiceType { ACCPAY = 0, ACCREC = 1 } - - export interface Schedule { - - /** - * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Period?: number | null; - - /** One of the following - WEEKLY or MONTHLY */ - Unit?: ScheduleUnit | null; - - /** - * Integer used with due date type e.g 20 (of following month), 31 (of current month) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - DueDate?: number | null; - - /** the payment terms */ - DueDateType?: ScheduleDueDateType | null; - - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) - * Type: DateOnly - */ - StartDate?: Date | null; - - /** - * The calendar date of the next invoice in the schedule to be generated - * Type: DateOnly - */ - NextScheduledDate?: Date | null; - - /** - * Invoice end date � only returned if the template has an end date set - * Type: DateOnly - */ - EndDate?: Date | null; - } - export interface ScheduleFormProperties { - - /** - * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Period: FormControl, - - /** One of the following - WEEKLY or MONTHLY */ - Unit: FormControl, - - /** - * Integer used with due date type e.g 20 (of following month), 31 (of current month) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - DueDate: FormControl, - - /** the payment terms */ - DueDateType: FormControl, - - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) - * Type: DateOnly - */ - StartDate: FormControl, - - /** - * The calendar date of the next invoice in the schedule to be generated - * Type: DateOnly - */ - NextScheduledDate: FormControl, - - /** - * Invoice end date � only returned if the template has an end date set - * Type: DateOnly - */ - EndDate: FormControl, - } - export function CreateScheduleFormGroup() { - return new FormGroup({ - Period: new FormControl(undefined), - Unit: new FormControl(undefined), - DueDate: new FormControl(undefined), - DueDateType: new FormControl(undefined), - StartDate: new FormControl(undefined), - NextScheduledDate: new FormControl(undefined), - EndDate: new FormControl(undefined), - }); - - } - - export enum ScheduleUnit { WEEKLY = 0, MONTHLY = 1 } - - export enum ScheduleDueDateType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, DAYSAFTERINVOICEDATE = 2, DAYSAFTERINVOICEMONTH = 3, OFCURRENTMONTH = 4, OFFOLLOWINGMONTH = 5 } - - export enum RepeatingInvoiceStatus { DRAFT = 0, AUTHORISED = 1, DELETED = 2 } - - export interface ReportWithRows { - Reports?: Array; - } - export interface ReportWithRowsFormProperties { - } - export function CreateReportWithRowsFormGroup() { - return new FormGroup({ - }); - - } - - export interface ReportWithRow { - - /** Report id */ - ReportID?: string | null; - - /** Name of the report */ - ReportName?: string | null; - - /** Title of the report */ - ReportTitle?: string | null; - - /** The type of report (BalanceSheet,ProfitLoss, etc) */ - ReportType?: string | null; - - /** Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) */ - ReportTitles?: Array; - - /** Date of report */ - ReportDate?: string | null; - Rows?: Array; - - /** Updated Date */ - UpdatedDateUTC?: Date | null; - Fields?: Array; - } - export interface ReportWithRowFormProperties { - - /** Report id */ - ReportID: FormControl, - - /** Name of the report */ - ReportName: FormControl, - - /** Title of the report */ - ReportTitle: FormControl, - - /** The type of report (BalanceSheet,ProfitLoss, etc) */ - ReportType: FormControl, - - /** Date of report */ - ReportDate: FormControl, - - /** Updated Date */ - UpdatedDateUTC: FormControl, - } - export function CreateReportWithRowFormGroup() { - return new FormGroup({ - ReportID: new FormControl(undefined), - ReportName: new FormControl(undefined), - ReportTitle: new FormControl(undefined), - ReportType: new FormControl(undefined), - ReportDate: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export interface ReportRows { - RowType?: ReportRowsRowType | null; - Title?: string | null; - Cells?: Array; - Rows?: Array; - } - export interface ReportRowsFormProperties { - RowType: FormControl, - Title: FormControl, - } - export function CreateReportRowsFormGroup() { - return new FormGroup({ - RowType: new FormControl(undefined), - Title: new FormControl(undefined), - }); - - } - - export enum ReportRowsRowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } - - export interface ReportCell { - Value?: string | null; - Attributes?: Array; - } - export interface ReportCellFormProperties { - Value: FormControl, - } - export function CreateReportCellFormGroup() { - return new FormGroup({ - Value: new FormControl(undefined), - }); - - } - - export interface ReportAttribute { - Id?: string | null; - Value?: string | null; - } - export interface ReportAttributeFormProperties { - Id: FormControl, - Value: FormControl, - } - export function CreateReportAttributeFormGroup() { - return new FormGroup({ - Id: new FormControl(undefined), - Value: new FormControl(undefined), - }); - - } - - export interface ReportRow { - RowType?: ReportRowsRowType | null; - Title?: string | null; - Cells?: Array; - } - export interface ReportRowFormProperties { - RowType: FormControl, - Title: FormControl, - } - export function CreateReportRowFormGroup() { - return new FormGroup({ - RowType: new FormControl(undefined), - Title: new FormControl(undefined), - }); - - } - - export interface ReportFields { - FieldID?: string | null; - Description?: string | null; - Value?: string | null; - } - export interface ReportFieldsFormProperties { - FieldID: FormControl, - Description: FormControl, - Value: FormControl, - } - export function CreateReportFieldsFormGroup() { - return new FormGroup({ - FieldID: new FormControl(undefined), - Description: new FormControl(undefined), - Value: new FormControl(undefined), - }); - - } - - export enum RowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } - - export interface Reports { - Reports1?: Array; - } - export interface ReportsFormProperties { - } - export function CreateReportsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Report { - - /** See Prepayment Types */ - ReportID?: string | null; - - /** See Prepayment Types */ - ReportName?: string | null; - - /** See Prepayment Types */ - ReportType?: ReportReportType | null; - - /** See Prepayment Types */ - ReportTitle?: string | null; - - /** Date of report */ - ReportDate?: string | null; - - /** Updated Date */ - UpdatedDateUTC?: Date | null; - Contacts?: Array; - } - export interface ReportFormProperties { - - /** See Prepayment Types */ - ReportID: FormControl, - - /** See Prepayment Types */ - ReportName: FormControl, - - /** See Prepayment Types */ - ReportType: FormControl, - - /** See Prepayment Types */ - ReportTitle: FormControl, - - /** Date of report */ - ReportDate: FormControl, - - /** Updated Date */ - UpdatedDateUTC: FormControl, - } - export function CreateReportFormGroup() { - return new FormGroup({ - ReportID: new FormControl(undefined), - ReportName: new FormControl(undefined), - ReportType: new FormControl(undefined), - ReportTitle: new FormControl(undefined), - ReportDate: new FormControl(undefined), - UpdatedDateUTC: new FormControl(undefined), - }); - - } - - export enum ReportReportType { AgedPayablesByContact = 0 } - - export interface TenNinteyNineContact { - - /** - * Box 1 on 1099 Form - * Type: double - */ - Box1?: number | null; - - /** - * Box 2 on 1099 Form - * Type: double - */ - Box2?: number | null; - - /** - * Box 3 on 1099 Form - * Type: double - */ - Box3?: number | null; - - /** - * Box 4 on 1099 Form - * Type: double - */ - Box4?: number | null; - - /** - * Box 5 on 1099 Form - * Type: double - */ - Box5?: number | null; - - /** - * Box 6 on 1099 Form - * Type: double - */ - Box6?: number | null; - - /** - * Box 7 on 1099 Form - * Type: double - */ - Box7?: number | null; - - /** - * Box 8 on 1099 Form - * Type: double - */ - Box8?: number | null; - - /** - * Box 9 on 1099 Form - * Type: double - */ - Box9?: number | null; - - /** - * Box 10 on 1099 Form - * Type: double - */ - Box10?: number | null; - - /** - * Box 11 on 1099 Form - * Type: double - */ - Box11?: number | null; - - /** - * Box 13 on 1099 Form - * Type: double - */ - Box13?: number | null; - - /** - * Box 14 on 1099 Form - * Type: double - */ - Box14?: number | null; - - /** Contact name on 1099 Form */ - Name?: string | null; - - /** Contact Fed Tax ID type */ - FederalTaxIDType?: string | null; - - /** Contact city on 1099 Form */ - City?: string | null; - - /** Contact zip on 1099 Form */ - Zip?: string | null; - - /** Contact State on 1099 Form */ - State?: string | null; - - /** Contact email on 1099 Form */ - Email?: string | null; - - /** Contact address on 1099 Form */ - StreetAddress?: string | null; - - /** Contact tax id on 1099 Form */ - TaxID?: string | null; - - /** Contact contact id */ - ContactId?: string | null; - } - export interface TenNinteyNineContactFormProperties { - - /** - * Box 1 on 1099 Form - * Type: double - */ - Box1: FormControl, - - /** - * Box 2 on 1099 Form - * Type: double - */ - Box2: FormControl, - - /** - * Box 3 on 1099 Form - * Type: double - */ - Box3: FormControl, - - /** - * Box 4 on 1099 Form - * Type: double - */ - Box4: FormControl, - - /** - * Box 5 on 1099 Form - * Type: double - */ - Box5: FormControl, - - /** - * Box 6 on 1099 Form - * Type: double - */ - Box6: FormControl, - - /** - * Box 7 on 1099 Form - * Type: double - */ - Box7: FormControl, - - /** - * Box 8 on 1099 Form - * Type: double - */ - Box8: FormControl, - - /** - * Box 9 on 1099 Form - * Type: double - */ - Box9: FormControl, - - /** - * Box 10 on 1099 Form - * Type: double - */ - Box10: FormControl, - - /** - * Box 11 on 1099 Form - * Type: double - */ - Box11: FormControl, - - /** - * Box 13 on 1099 Form - * Type: double - */ - Box13: FormControl, - - /** - * Box 14 on 1099 Form - * Type: double - */ - Box14: FormControl, - - /** Contact name on 1099 Form */ - Name: FormControl, - - /** Contact Fed Tax ID type */ - FederalTaxIDType: FormControl, - - /** Contact city on 1099 Form */ - City: FormControl, - - /** Contact zip on 1099 Form */ - Zip: FormControl, - - /** Contact State on 1099 Form */ - State: FormControl, - - /** Contact email on 1099 Form */ - Email: FormControl, - - /** Contact address on 1099 Form */ - StreetAddress: FormControl, - - /** Contact tax id on 1099 Form */ - TaxID: FormControl, - - /** Contact contact id */ - ContactId: FormControl, - } - export function CreateTenNinteyNineContactFormGroup() { - return new FormGroup({ - Box1: new FormControl(undefined), - Box2: new FormControl(undefined), - Box3: new FormControl(undefined), - Box4: new FormControl(undefined), - Box5: new FormControl(undefined), - Box6: new FormControl(undefined), - Box7: new FormControl(undefined), - Box8: new FormControl(undefined), - Box9: new FormControl(undefined), - Box10: new FormControl(undefined), - Box11: new FormControl(undefined), - Box13: new FormControl(undefined), - Box14: new FormControl(undefined), - Name: new FormControl(undefined), - FederalTaxIDType: new FormControl(undefined), - City: new FormControl(undefined), - Zip: new FormControl(undefined), - State: new FormControl(undefined), - Email: new FormControl(undefined), - StreetAddress: new FormControl(undefined), - TaxID: new FormControl(undefined), - ContactId: new FormControl(undefined), - }); - - } - - export interface TaxRates { - TaxRates1?: Array; - } - export interface TaxRatesFormProperties { - } - export function CreateTaxRatesFormGroup() { - return new FormGroup({ - }); - - } - - export interface TaxRate { - - /** Name of tax rate */ - Name?: string | null; - - /** The tax type */ - TaxType?: string | null; - - /** See TaxComponents */ - TaxComponents?: Array; - - /** See Status Codes */ - Status?: TaxRateStatus | null; - - /** See ReportTaxTypes */ - ReportTaxType?: TaxRateReportTaxType | null; - - /** Boolean to describe if tax rate can be used for asset accounts i.e. true,false */ - CanApplyToAssets?: boolean | null; - - /** Boolean to describe if tax rate can be used for equity accounts i.e true,false */ - CanApplyToEquity?: boolean | null; - - /** Boolean to describe if tax rate can be used for expense accounts i.e. true,false */ - CanApplyToExpenses?: boolean | null; - - /** Boolean to describe if tax rate can be used for liability accounts i.e. true,false */ - CanApplyToLiabilities?: boolean | null; - - /** Boolean to describe if tax rate can be used for revenue accounts i.e. true,false */ - CanApplyToRevenue?: boolean | null; - - /** - * Tax Rate (decimal to 4dp) e.g 12.5000 - * Type: double - */ - DisplayTaxRate?: number | null; - - /** - * Effective Tax Rate (decimal to 4dp) e.g 12.5000 - * Type: double - */ - EffectiveRate?: number | null; - } - export interface TaxRateFormProperties { - - /** Name of tax rate */ - Name: FormControl, - - /** The tax type */ - TaxType: FormControl, - - /** See Status Codes */ - Status: FormControl, - - /** See ReportTaxTypes */ - ReportTaxType: FormControl, - - /** Boolean to describe if tax rate can be used for asset accounts i.e. true,false */ - CanApplyToAssets: FormControl, - - /** Boolean to describe if tax rate can be used for equity accounts i.e true,false */ - CanApplyToEquity: FormControl, - - /** Boolean to describe if tax rate can be used for expense accounts i.e. true,false */ - CanApplyToExpenses: FormControl, - - /** Boolean to describe if tax rate can be used for liability accounts i.e. true,false */ - CanApplyToLiabilities: FormControl, - - /** Boolean to describe if tax rate can be used for revenue accounts i.e. true,false */ - CanApplyToRevenue: FormControl, - - /** - * Tax Rate (decimal to 4dp) e.g 12.5000 - * Type: double - */ - DisplayTaxRate: FormControl, - - /** - * Effective Tax Rate (decimal to 4dp) e.g 12.5000 - * Type: double - */ - EffectiveRate: FormControl, - } - export function CreateTaxRateFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined), - TaxType: new FormControl(undefined), - Status: new FormControl(undefined), - ReportTaxType: new FormControl(undefined), - CanApplyToAssets: new FormControl(undefined), - CanApplyToEquity: new FormControl(undefined), - CanApplyToExpenses: new FormControl(undefined), - CanApplyToLiabilities: new FormControl(undefined), - CanApplyToRevenue: new FormControl(undefined), - DisplayTaxRate: new FormControl(undefined), - EffectiveRate: new FormControl(undefined), - }); - - } - - export interface TaxComponent { - - /** Name of Tax Component */ - Name?: string | null; - - /** - * Tax Rate (up to 4dp) - * Type: double - */ - Rate?: number | null; - - /** Boolean to describe if Tax rate is compounded. */ - IsCompound?: boolean | null; - - /** Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations */ - IsNonRecoverable?: boolean | null; - } - export interface TaxComponentFormProperties { - - /** Name of Tax Component */ - Name: FormControl, - - /** - * Tax Rate (up to 4dp) - * Type: double - */ - Rate: FormControl, - - /** Boolean to describe if Tax rate is compounded. */ - IsCompound: FormControl, - - /** Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations */ - IsNonRecoverable: FormControl, - } - export function CreateTaxComponentFormGroup() { - return new FormGroup({ - Name: new FormControl(undefined), - Rate: new FormControl(undefined), - IsCompound: new FormControl(undefined), - IsNonRecoverable: new FormControl(undefined), - }); - - } - - export enum TaxRateStatus { ACTIVE = 0, DELETED = 1, ARCHIVED = 2, PENDING = 3 } - - export enum TaxRateReportTaxType { AVALARA = 0, BASEXCLUDED = 1, CAPITALSALESOUTPUT = 2, CAPITALEXPENSESINPUT = 3, ECOUTPUT = 4, ECOUTPUTSERVICES = 5, ECINPUT = 6, ECACQUISITIONS = 7, EXEMPTEXPENSES = 8, EXEMPTINPUT = 9, EXEMPTOUTPUT = 10, GSTONIMPORTS = 11, INPUT = 12, INPUTTAXED = 13, MOSSSALES = 14, NONE = 15, NONEOUTPUT = 16, OUTPUT = 17, PURCHASESINPUT = 18, SALESOUTPUT = 19, EXEMPTCAPITAL = 20, EXEMPTEXPORT = 21, CAPITALEXINPUT = 22, GSTONCAPIMPORTS = 23, GSTONCAPITALIMPORTS = 24, REVERSECHARGES = 25, PAYMENTS = 26, INVOICE = 27, CASH = 28, ACCRUAL = 29, FLATRATECASH = 30, FLATRATEACCRUAL = 31, ACCRUALS = 32, TXCA = 33, SRCAS = 34, DSOUTPUT = 35, BLINPUT2 = 36, EPINPUT = 37, IMINPUT2 = 38, MEINPUT = 39, IGDSINPUT2 = 40, ESN33OUTPUT = 41, OPINPUT = 42, OSOUTPUT = 43, TXN33INPUT = 44, TXESSINPUT = 45, TXREINPUT = 46, TXPETINPUT = 47, NRINPUT = 48, ES33OUTPUT = 49, ZERORATEDINPUT = 50, ZERORATEDOUTPUT = 51, DRCHARGESUPPLY = 52, DRCHARGE = 53, CAPINPUT = 54, CAPIMPORTS = 55, IMINPUT = 56, INPUT2 = 57, CIUINPUT = 58, SRINPUT = 59, OUTPUT2 = 60, SROUTPUT = 61, CAPOUTPUT = 62, SROUTPUT2 = 63, CIUOUTPUT = 64, ZROUTPUT = 65, ZREXPORT = 66, ACC28PLUS = 67, ACCUPTO28 = 68, OTHEROUTPUT = 69, SHOUTPUT = 70, ZRINPUT = 71, BADDEBT = 72, OTHERINPUT = 73 } - - - /** See Tax Types � can only be used on update calls */ - export enum TaxType { OUTPUT = 0, INPUT = 1, CAPEXINPUT = 2, EXEMPTEXPORT = 3, EXEMPTEXPENSES = 4, EXEMPTCAPITAL = 5, EXEMPTOUTPUT = 6, INPUTTAXED = 7, BASEXCLUDED = 8, GSTONCAPIMPORTS = 9, GSTONIMPORTS = 10, NONE = 11, INPUT2 = 12, ZERORATED = 13, OUTPUT2 = 14, CAPEXINPUT2 = 15, CAPEXOUTPUT = 16, CAPEXOUTPUT2 = 17, CAPEXSRINPUT = 18, CAPEXSROUTPUT = 19, ECACQUISITIONS = 20, ECZRINPUT = 21, ECZROUTPUT = 22, ECZROUTPUTSERVICES = 23, EXEMPTINPUT = 24, REVERSECHARGES = 25, RRINPUT = 26, RROUTPUT = 27, SRINPUT = 28, SROUTPUT = 29, ZERORATEDINPUT = 30, ZERORATEDOUTPUT = 31, BLINPUT = 32, DSOUTPUT = 33, EPINPUT = 34, ES33OUTPUT = 35, ESN33OUTPUT = 36, IGDSINPUT2 = 37, IMINPUT2 = 38, MEINPUT = 39, NRINPUT = 40, OPINPUT = 41, OSOUTPUT = 42, TXESSINPUT = 43, TXN33INPUT = 44, TXPETINPUT = 45, TXREINPUT = 46, INPUT3 = 47, INPUT4 = 48, OUTPUT3 = 49, OUTPUT4 = 50, SROUTPUT2 = 51, TXCA = 52, SRCAS = 53, BLINPUT2 = 54, DRCHARGESUPPLY20 = 55, DRCHARGE20 = 56, DRCHARGESUPPLY5 = 57, DRCHARGE5 = 58 } - - export interface TrackingCategories { - TrackingCategories1?: Array; - } - export interface TrackingCategoriesFormProperties { - } - export function CreateTrackingCategoriesFormGroup() { - return new FormGroup({ - }); - - } - - export interface TrackingOptions { - Options?: Array; - } - export interface TrackingOptionsFormProperties { - } - export function CreateTrackingOptionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Users { - Users1?: Array; - } - export interface UsersFormProperties { - } - export function CreateUsersFormGroup() { - return new FormGroup({ - }); - - } - - export interface Error { - - /** - * Exception number - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ErrorNumber?: number | null; - - /** Exception type */ - Type?: string | null; - - /** Exception message */ - Message?: string | null; - - /** Array of Elements of validation Errors */ - Elements?: Array; - } - export interface ErrorFormProperties { - - /** - * Exception number - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ErrorNumber: FormControl, - - /** Exception type */ - Type: FormControl, - - /** Exception message */ - Message: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - ErrorNumber: new FormControl(undefined), - Type: new FormControl(undefined), - Message: new FormControl(undefined), - }); - - } - - export interface Element { - - /** Array of Validation Error message */ - ValidationErrors?: Array; - - /** Unique ID for batch payment object with validation error */ - BatchPaymentID?: string | null; - BankTransactionID?: string | null; - CreditNoteID?: string | null; - ContactID?: string | null; - InvoiceID?: string | null; - ItemID?: string | null; - PurchaseOrderID?: string | null; - } - export interface ElementFormProperties { - - /** Unique ID for batch payment object with validation error */ - BatchPaymentID: FormControl, - BankTransactionID: FormControl, - CreditNoteID: FormControl, - ContactID: FormControl, - InvoiceID: FormControl, - ItemID: FormControl, - PurchaseOrderID: FormControl, - } - export function CreateElementFormGroup() { - return new FormGroup({ - BatchPaymentID: new FormControl(undefined), - BankTransactionID: new FormControl(undefined), - CreditNoteID: new FormControl(undefined), - ContactID: new FormControl(undefined), - InvoiceID: new FormControl(undefined), - ItemID: new FormControl(undefined), - PurchaseOrderID: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Allows you to retrieve the full chart of accounts - * Get Accounts - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Accounts} Success - return response of type Accounts array with 0 to n Account - */ - GetAccounts(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Accounts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create a new chart of accounts - * Put Accounts - * @param {Account} requestBody Account object in body of request - * @return {Accounts} Success - created new Account and return response of type Accounts array with new Account - */ - CreateAccount(requestBody: Account): Observable { - return this.http.put(this.baseUri + 'Accounts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a single chart of accounts - * Get Accounts/{AccountID} - * @param {string} AccountID Unique identifier for retrieving single object - * @return {Accounts} Success - return response of type Accounts array with one Account - */ - GetAccount(AccountID: string): Observable { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); - } - - /** - * Allows you to update a chart of accounts - * Post Accounts/{AccountID} - * @param {string} AccountID Unique identifier for retrieving single object - * @param {Accounts} requestBody Request of type Accounts array with one Account - * @return {Accounts} Success - update existing Account and return response of type Accounts array with updated Account - */ - UpdateAccount(AccountID: string, requestBody: Accounts): Observable { - return this.http.post(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a chart of accounts - * Delete Accounts/{AccountID} - * @param {string} AccountID Unique identifier for retrieving single object - * @return {Accounts} Success - delete existing Account and return response of type Accounts array with deleted Account - */ - DeleteAccount(AccountID: string): Observable { - return this.http.delete(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); - } - - /** - * Allows you to retrieve Attachments for accounts - * Get Accounts/{AccountID}/Attachments - * @param {string} AccountID Unique identifier for Account object - * @return {Attachments} Success - return response of type Attachments array of Attachment - */ - GetAccountAttachments(AccountID: string): Observable { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve specific Attachment on Account - * Get Accounts/{AccountID}/Attachments/{AttachmentID} - * @param {string} AccountID Unique identifier for Account object - * @param {string} AttachmentID Unique identifier for Attachment object - * @return {void} Success - return response of attachment for Account as binary data - */ - GetAccountAttachmentById(AccountID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachment on Account by Filename - * Get Accounts/{AccountID}/Attachments/{FileName} - * @param {string} AccountID Unique identifier for Account object - * @param {string} FileName Name of the attachment - * @return {void} Success - return response of attachment for Account as binary data - */ - GetAccountAttachmentByFileName(AccountID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieve either one or many BatchPayments for invoices - * Get BatchPayments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects - */ - GetBatchPayments(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'BatchPayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Create one or many BatchPayments for invoices - * Put BatchPayments - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {BatchPayments} requestBody BatchPayments with an array of Payments in body of request - * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects - */ - CreateBatchPayment(summarizeErrors: boolean | null | undefined, requestBody: BatchPayments): Observable { - return this.http.put(this.baseUri + 'BatchPayments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve history from a Batch Payment - * Get BatchPayments/{BatchPaymentID}/History - * @param {string} BatchPaymentID Unique identifier for BatchPayment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetBatchPaymentHistory(BatchPaymentID: string): Observable { - return this.http.get(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', {}); - } - - /** - * Allows you to create a history record for a Batch Payment - * Put BatchPayments/{BatchPaymentID}/History - * @param {string} BatchPaymentID Unique identifier for BatchPayment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateBatchPaymentHistoryRecord(BatchPaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any spend or receive money transactions - * Get BankTransactions - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page Up to 100 bank transactions will be returned in a single API call with line items details - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with 0 to n BankTransaction - */ - GetBankTransactions(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'BankTransactions?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create one or more spend or receive money transaction - * Put BankTransactions - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {BankTransactions} requestBody BankTransactions with an array of BankTransaction objects in body of request - * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction - */ - CreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { - return this.http.put(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update or create one or more spend or receive money transaction - * Post BankTransactions - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction - */ - UpdateOrCreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { - return this.http.post(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a single spend or receive money transaction - * Get BankTransactions/{BankTransactionID} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with a specific BankTransaction - */ - GetBankTransaction(BankTransactionID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a single spend or receive money transaction - * Post BankTransactions/{BankTransactionID} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with updated BankTransaction - */ - UpdateBankTransaction(BankTransactionID: string, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { - return this.http.post(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any attachments to bank transactions - * Get BankTransactions/{BankTransactionID}/Attachments - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @return {Attachments} Success - return response of type Attachments array with 0 to n Attachment - */ - GetBankTransactionAttachments(BankTransactionID: string): Observable { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on a specific BankTransaction - * Get BankTransactions/{BankTransactionID}/Attachments/{AttachmentID} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {string} AttachmentID Xero generated unique identifier for an attachment - * @return {void} Success - return response of attachment for BankTransaction as binary data - */ - GetBankTransactionAttachmentById(BankTransactionID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on BankTransaction by Filename - * Get BankTransactions/{BankTransactionID}/Attachments/{FileName} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {string} FileName The name of the file being attached - * @return {void} Success - return response of attachment for BankTransaction as binary data - */ - GetBankTransactionAttachmentByFileName(BankTransactionID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history from a bank transactions - * Get BankTransactions/{BankTransactionID}/History - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetBankTransactionsHistory(BankTransactionID: string): Observable { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', {}); - } - - /** - * Allows you to create history record for a bank transactions - * Put BankTransactions/{BankTransactionID}/History - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateBankTransactionHistoryRecord(BankTransactionID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve all bank transfers - * Get BankTransfers - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {BankTransfers} Success - return response of BankTransfers array of 0 to N BankTransfer - */ - GetBankTransfers(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'BankTransfers?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create a bank transfers - * Put BankTransfers - * @param {BankTransfers} requestBody BankTransfers with array of BankTransfer objects in request body - * @return {BankTransfers} Success - return response of BankTransfers array of one BankTransfer - */ - CreateBankTransfer(requestBody: BankTransfers): Observable { - return this.http.put(this.baseUri + 'BankTransfers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any bank transfers - * Get BankTransfers/{BankTransferID} - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @return {BankTransfers} Success - return response of BankTransfers array with one BankTransfer - */ - GetBankTransfer(BankTransferID: string): Observable { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)), {}); - } - - /** - * Allows you to retrieve Attachments from bank transfers - * Get BankTransfers/{BankTransferID}/Attachments - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @return {Attachments} Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer - */ - GetBankTransferAttachments(BankTransferID: string): Observable { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on BankTransfer - * Get BankTransfers/{BankTransferID}/Attachments/{AttachmentID} - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @param {string} AttachmentID Xero generated unique identifier for an Attachment to a bank transfer - * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer - */ - GetBankTransferAttachmentById(BankTransferID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on BankTransfer by file name - * Get BankTransfers/{BankTransferID}/Attachments/{FileName} - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @param {string} FileName The name of the file being attached to a Bank Transfer - * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer - */ - GetBankTransferAttachmentByFileName(BankTransferID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history from a bank transfers - * Get BankTransfers/{BankTransferID}/History - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetBankTransferHistory(BankTransferID: string): Observable { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', {}); - } - - /** - * Put BankTransfers/{BankTransferID}/History - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateBankTransferHistoryRecord(BankTransferID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve all the BrandingThemes - * Get BrandingThemes - * @return {BrandingThemes} Success - return response of type BrandingThemes - */ - GetBrandingThemes(): Observable { - return this.http.get(this.baseUri + 'BrandingThemes', {}); - } - - /** - * Allows you to retrieve a specific BrandingThemes - * Get BrandingThemes/{BrandingThemeID} - * @param {string} BrandingThemeID Unique identifier for a Branding Theme - * @return {BrandingThemes} Success - return response of type BrandingThemes with one BrandingTheme - */ - GetBrandingTheme(BrandingThemeID: string): Observable { - return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)), {}); - } - - /** - * Allows you to retrieve the Payment services for a Branding Theme - * Get BrandingThemes/{BrandingThemeID}/PaymentServices - * @param {string} BrandingThemeID Unique identifier for a Branding Theme - * @return {PaymentServices} Success - return response of type PaymentServices array with 0 to N PaymentService - */ - GetBrandingThemePaymentServices(BrandingThemeID: string): Observable { - return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', {}); - } - - /** - * Allow for the creation of new custom payment service for specified Branding Theme - * Post BrandingThemes/{BrandingThemeID}/PaymentServices - * @param {string} BrandingThemeID Unique identifier for a Branding Theme - * @param {PaymentService} requestBody PaymentService object in body of request - * @return {PaymentServices} Success - return response of type PaymentServices array with newly created PaymentService - */ - CreateBrandingThemePaymentServices(BrandingThemeID: string, requestBody: PaymentService): Observable { - return this.http.post(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve all contacts in a Xero organisation - * Get Contacts - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {Array} IDs Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. - * @param {number} page e.g. page=1 - Up to 100 contacts will be returned in a single API call. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - * @return {Contacts} Success - return response of type Contacts array with 0 to N Contact - */ - GetContacts(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Contacts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived, {}); - } - - /** - * Allows you to create a multiple contacts (bulk) in a Xero organisation - * Put Contacts - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Contacts} requestBody Contacts with an array of Contact objects to create in body of request - * @return {Contacts} Success - return response of type Contacts array with newly created Contact - */ - CreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { - return this.http.put(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more contacts in a Xero organisation - * Post Contacts - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @return {Contacts} Success - return response of type Contacts array with newly created Contact - */ - UpdateOrCreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { - return this.http.post(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a single contact by Contact Number in a Xero organisation - * Get Contacts/{ContactNumber} - * @param {string} ContactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). - * @return {Contacts} Success - return response of type Contacts array with a unique Contact - */ - GetContactByContactNumber(ContactNumber: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactNumber == null ? '' : encodeURIComponent(ContactNumber)), {}); - } - - /** - * Allows you to retrieve a single contacts in a Xero organisation - * Get Contacts/{ContactID} - * @param {string} ContactID Unique identifier for a Contact - * @return {Contacts} Success - return response of type Contacts array with a unique Contact - */ - GetContact(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), {}); - } - - /** - * Post Contacts/{ContactID} - * @param {string} ContactID Unique identifier for a Contact - * @param {Contacts} requestBody an array of Contacts containing single Contact object with properties to update - * @return {Contacts} Success - return response of type Contacts array with an updated Contact - */ - UpdateContact(ContactID: string, requestBody: Contacts): Observable { - return this.http.post(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve, add and update contacts in a Xero organisation - * Get Contacts/{ContactID}/Attachments - * @param {string} ContactID Unique identifier for a Contact - * @return {Attachments} Success - return response of type Attachments array with 0 to N Attachment - */ - GetContactAttachments(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on Contacts - * Get Contacts/{ContactID}/Attachments/{AttachmentID} - * @param {string} ContactID Unique identifier for a Contact - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Contact as binary data - */ - GetContactAttachmentById(ContactID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on Contacts by file name - * Get Contacts/{ContactID}/Attachments/{FileName} - * @param {string} ContactID Unique identifier for a Contact - * @param {string} FileName Name for the file you are attaching - * @return {void} Success - return response of attachment for Contact as binary data - */ - GetContactAttachmentByFileName(ContactID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve CISSettings for a contact in a Xero organisation - * Get Contacts/{ContactID}/CISSettings - * @param {string} ContactID Unique identifier for a Contact - * @return {CISSettings} Success - return response of type CISSettings for a specific Contact - */ - GetContactCISSettings(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/CISSettings', {}); - } - - /** - * Allows you to retrieve a history records of an Contact - * Get Contacts/{ContactID}/History - * @param {string} ContactID Unique identifier for a Contact - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetContactHistory(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an Contact - * Put Contacts/{ContactID}/History - * @param {string} ContactID Unique identifier for a Contact - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateContactHistory(ContactID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve the ContactID and Name of all the contacts in a contact group - * Get ContactGroups - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {ContactGroups} Success - return response of type Contact Groups array of Contact Group - */ - GetContactGroups(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ContactGroups?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create a contact group - * Put ContactGroups - * @param {ContactGroups} requestBody ContactGroups with an array of names in request body - * @return {ContactGroups} Success - return response of type Contact Groups array of newly created Contact Group - */ - CreateContactGroup(requestBody: ContactGroups): Observable { - return this.http.put(this.baseUri + 'ContactGroups', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a unique Contact Group by ID - * Get ContactGroups/{ContactGroupID} - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @return {ContactGroups} Success - return response of type Contact Groups array with a specific Contact Group - */ - GetContactGroup(ContactGroupID: string): Observable { - return this.http.get(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), {}); - } - - /** - * Allows you to update a Contact Group - * Post ContactGroups/{ContactGroupID} - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @param {ContactGroups} requestBody an array of Contact groups with Name of specific group to update - * @return {ContactGroups} Success - return response of type Contact Groups array of updated Contact Group - */ - UpdateContactGroup(ContactGroupID: string, requestBody: ContactGroups): Observable { - return this.http.post(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to add Contacts to a Contact Group - * Put ContactGroups/{ContactGroupID}/Contacts - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @param {Contacts} requestBody Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request - * @return {Contacts} Success - return response of type Contacts array of added Contacts - */ - CreateContactGroupContacts(ContactGroupID: string, requestBody: Contacts): Observable { - return this.http.put(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete all Contacts from a Contact Group - * Delete ContactGroups/{ContactGroupID}/Contacts - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @return {void} - */ - DeleteContactGroupContacts(ContactGroupID: string): Observable> { - return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to delete a specific Contact from a Contact Group - * Delete ContactGroups/{ContactGroupID}/Contacts/{ContactID} - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @param {string} ContactID Unique identifier for a Contact - * @return {void} - */ - DeleteContactGroupContact(ContactGroupID: string, ContactID: string): Observable> { - return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve any credit notes - * Get CreditNotes - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 credit notes will be returned in a single API call with line items shown for each credit note - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {CreditNotes} Success - return response of type Credit Notes array of CreditNote - */ - GetCreditNotes(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'CreditNotes?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create a credit note - * Put CreditNotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {CreditNotes} requestBody Credit Notes with array of CreditNote object in body of request - * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote - */ - CreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { - return this.http.put(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more credit notes - * Post CreditNotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {CreditNotes} requestBody an array of Credit Notes with a single CreditNote object. - * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote - */ - UpdateOrCreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { - return this.http.post(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specific credit note - * Get CreditNotes/{CreditNoteID} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {CreditNotes} Success - return response of type Credit Notes array with a unique CreditNote - */ - GetCreditNote(CreditNoteID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a specific credit note - * Post CreditNotes/{CreditNoteID} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {CreditNotes} requestBody an array of Credit Notes containing credit note details to update - * @return {CreditNotes} Success - return response of type Credit Notes array with updated CreditNote - */ - UpdateCreditNote(CreditNoteID: string, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { - return this.http.post(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve Attachments for credit notes - * Get CreditNotes/{CreditNoteID}/Attachments - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @return {Attachments} Success - return response of type Attachments array with all Attachment for specific Credit Note - */ - GetCreditNoteAttachments(CreditNoteID: string): Observable { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on CreditNote - * Get CreditNotes/{CreditNoteID}/Attachments/{AttachmentID} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Credit Note as binary data - */ - GetCreditNoteAttachmentById(CreditNoteID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on CreditNote by file name - * Get CreditNotes/{CreditNoteID}/Attachments/{FileName} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {string} FileName Name of the file you are attaching to Credit Note - * @return {void} Success - return response of attachment for Credit Note as binary data - */ - GetCreditNoteAttachmentByFileName(CreditNoteID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Credit Note as PDF files - * Get CreditNotes/{CreditNoteID}/pdf - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @return {void} Success - return response of binary data from the Attachment to a Credit Note - */ - GetCreditNoteAsPdf(CreditNoteID: string): Observable> { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to create Allocation on CreditNote - * Put CreditNotes/{CreditNoteID}/Allocations - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Allocations} requestBody Allocations with array of Allocation object in body of request. - * @return {Allocations} Success - return response of type Allocations array with newly created Allocation for specific Credit Note - */ - CreateCreditNoteAllocation(CreditNoteID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { - return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an CreditNote - * Get CreditNotes/{CreditNoteID}/History - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetCreditNoteHistory(CreditNoteID: string): Observable { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an CreditNote - * Put CreditNotes/{CreditNoteID}/History - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateCreditNoteHistory(CreditNoteID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve currencies for your organisation - * Get Currencies - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Currencies} Success - return response of type Currencies array with all Currencies - */ - GetCurrencies(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Currencies?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Put Currencies - * @param {Currency} requestBody Currency obejct in the body of request - * @return {Currencies} Unsupported - return response incorrect exception, API is not able to create new Currency - */ - CreateCurrency(requestBody: Currency): Observable { - return this.http.put(this.baseUri + 'Currencies', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve employees used in Xero payrun - * Get Employees - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Employees} Success - return response of type Employees array with all Employee - */ - GetEmployees(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create new employees used in Xero payrun - * Put Employees - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Employees} requestBody Employees with array of Employee object in body of request - * @return {Employees} Success - return response of type Employees array with new Employee - */ - CreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { - return this.http.put(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to create a single new employees used in Xero payrun - * Post Employees - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Employees} requestBody Employees with array of Employee object in body of request - * @return {Employees} Success - return response of type Employees array with new Employee - */ - UpdateOrCreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { - return this.http.post(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specific employee used in Xero payrun - * Get Employees/{EmployeeID} - * @param {string} EmployeeID Unique identifier for a Employee - * @return {Employees} Success - return response of type Employees array with specified Employee - */ - GetEmployee(EmployeeID: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeID == null ? '' : encodeURIComponent(EmployeeID)), {}); - } - - /** - * Allows you to retrieve expense claims - * Get ExpenseClaims - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with all ExpenseClaims - */ - GetExpenseClaims(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ExpenseClaims?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to retrieve expense claims - * Put ExpenseClaims - * @param {ExpenseClaims} requestBody ExpenseClaims with array of ExpenseClaim object in body of request - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with newly created ExpenseClaim - */ - CreateExpenseClaims(requestBody: ExpenseClaims): Observable { - return this.http.put(this.baseUri + 'ExpenseClaims', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified expense claim - * Get ExpenseClaims/{ExpenseClaimID} - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with specified ExpenseClaim - */ - GetExpenseClaim(ExpenseClaimID: string): Observable { - return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), {}); - } - - /** - * Allows you to update specified expense claims - * Post ExpenseClaims/{ExpenseClaimID} - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with updated ExpenseClaim - */ - UpdateExpenseClaim(ExpenseClaimID: string, requestBody: ExpenseClaims): Observable { - return this.http.post(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an ExpenseClaim - * Get ExpenseClaims/{ExpenseClaimID}/History - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetExpenseClaimHistory(ExpenseClaimID: string): Observable { - return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', {}); - } - - /** - * Allows you to create a history records of an ExpenseClaim - * Put ExpenseClaims/{ExpenseClaimID}/History - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateExpenseClaimHistory(ExpenseClaimID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any sales invoices or purchase bills - * Get Invoices - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {Array} IDs Filter by a comma-separated list of InvoicesIDs. - * @param {Array} InvoiceNumbers Filter by a comma-separated list of InvoiceNumbers. - * @param {Array} ContactIDs Filter by a comma-separated list of ContactIDs. - * @param {Array} Statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. - * @param {number} page e.g. page=1 � Up to 100 invoices will be returned in a single API call with line items shown for each invoice - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - * @param {boolean} createdByMyApp When set to true you'll only retrieve Invoices created by your app - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with all Invoices - */ - GetInvoices(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, InvoiceNumbers: Array | null | undefined, ContactIDs: Array | null | undefined, Statuses: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined, createdByMyApp: boolean | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Invoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&' + InvoiceNumbers?.map(z => `InvoiceNumbers=${encodeURIComponent(z)}`).join('&') + '&' + ContactIDs?.map(z => `ContactIDs=${encodeURIComponent(z)}`).join('&') + '&' + Statuses?.map(z => `Statuses=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived + '&createdByMyApp=' + createdByMyApp + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create one or more sales invoices or purchase bills - * Put Invoices - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {Invoices} requestBody Invoices with an array of invoice objects in body of request - * @return {Invoices} Success - return response of type Invoices array with newly created Invoice - */ - CreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { - return this.http.put(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more sales invoices or purchase bills - * Post Invoices - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with newly created Invoice - */ - UpdateOrCreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { - return this.http.post(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified sales invoice or purchase bill - * Get Invoices/{InvoiceID} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with specified Invoices - */ - GetInvoice(InvoiceID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a specified sales invoices or purchase bills - * Post Invoices/{InvoiceID} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with updated Invoice - */ - UpdateInvoice(InvoiceID: string, unitdp: number | null | undefined, requestBody: Invoices): Observable { - return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve invoices or purchase bills as PDF files - * Get Invoices/{InvoiceID}/pdf - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {void} Success - return response of byte array pdf version of specified Invoices - */ - GetInvoiceAsPdf(InvoiceID: string): Observable> { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on invoices or purchase bills - * Get Invoices/{InvoiceID}/Attachments - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {Attachments} Success - return response of type Attachments array of Attachments for specified Invoices - */ - GetInvoiceAttachments(InvoiceID: string): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID - * Get Invoices/{InvoiceID}/Attachments/{AttachmentID} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {string} AttachmentID Unique identifier for an Attachment - * @return {void} Success - return response of attachment for Invoice as binary data - */ - GetInvoiceAttachmentById(InvoiceID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachment on invoices or purchase bills by it's filename - * Get Invoices/{InvoiceID}/Attachments/{FileName} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {string} FileName Name of the file you are attaching - * @return {void} Success - return response of attachment for Invoice as binary data - */ - GetInvoiceAttachmentByFileName(InvoiceID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a URL to an online invoice - * Get Invoices/{InvoiceID}/OnlineInvoice - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {OnlineInvoices} Success - return response of type OnlineInvoice array with one OnlineInvoice - */ - GetOnlineInvoice(InvoiceID: string): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/OnlineInvoice', {}); - } - - /** - * Allows you to email a copy of invoice to related Contact - * Post Invoices/{InvoiceID}/Email - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {void} - */ - EmailInvoice(InvoiceID: string, requestBody: RequestEmpty): Observable> { - return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Email', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a history records of an invoice - * Get Invoices/{InvoiceID}/History - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetInvoiceHistory(InvoiceID: string): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an invoice - * Put Invoices/{InvoiceID}/History - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateInvoiceHistory(InvoiceID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve invoice reminder settings - * Get InvoiceReminders/Settings - * @return {InvoiceReminders} Success - return response of Invoice Reminders - */ - GetInvoiceReminders(): Observable { - return this.http.get(this.baseUri + 'InvoiceReminders/Settings', {}); - } - - /** - * Allows you to retrieve any items - * Get Items - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with all Item - */ - GetItems(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Items?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create one or more items - * Put Items - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {Items} requestBody Items with an array of Item objects in body of request - * @return {Items} Success - return response of type Items array with newly created Item - */ - CreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { - return this.http.put(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update or create one or more items - * Post Items - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with newly created Item - */ - UpdateOrCreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { - return this.http.post(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified item - * Get Items/{ItemID} - * @param {string} ItemID Unique identifier for an Item - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with specified Item - */ - GetItem(ItemID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a specified item - * Post Items/{ItemID} - * @param {string} ItemID Unique identifier for an Item - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with updated Item - */ - UpdateItem(ItemID: string, unitdp: number | null | undefined, requestBody: Items): Observable { - return this.http.post(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a specified item - * Delete Items/{ItemID} - * @param {string} ItemID Unique identifier for an Item - * @return {void} - */ - DeleteItem(ItemID: string): Observable> { - return this.http.delete(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history for items - * Get Items/{ItemID}/History - * @param {string} ItemID Unique identifier for an Item - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetItemHistory(ItemID: string): Observable { - return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', {}); - } - - /** - * Allows you to create a history record for items - * Put Items/{ItemID}/History - * @param {string} ItemID Unique identifier for an Item - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateItemHistory(ItemID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any journals. - * Get Journals - * @param {number} offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. - * @return {Journals} Success - return response of type Journals array with all Journals - */ - GetJournals(offset: number | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Journals?offset=' + offset + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve a specified journals. - * Get Journals/{JournalID} - * @param {string} JournalID Unique identifier for a Journal - * @return {Journals} Success - return response of type Journals array with specified Journal - */ - GetJournal(JournalID: string): Observable { - return this.http.get(this.baseUri + 'Journals/' + (JournalID == null ? '' : encodeURIComponent(JournalID)), {}); - } - - /** - * Retrieve linked transactions (billable expenses) - * Get LinkedTransactions - * @param {number} page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} LinkedTransactionID The Xero identifier for an Linked Transaction - * @param {string} SourceTransactionID Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice - * @param {string} ContactID Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. - * @param {string} Status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status - * @param {string} TargetTransactionID Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with all LinkedTransaction - */ - GetLinkedTransactions(page: number | null | undefined, LinkedTransactionID: string | null | undefined, SourceTransactionID: string | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, TargetTransactionID: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'LinkedTransactions?page=' + page + '&LinkedTransactionID=' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)) + '&SourceTransactionID=' + (SourceTransactionID == null ? '' : encodeURIComponent(SourceTransactionID)) + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&TargetTransactionID=' + (TargetTransactionID == null ? '' : encodeURIComponent(TargetTransactionID)), {}); - } - - /** - * Allows you to create linked transactions (billable expenses) - * Put LinkedTransactions - * @param {LinkedTransaction} requestBody LinkedTransaction object in body of request - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with newly created LinkedTransaction - */ - CreateLinkedTransaction(requestBody: LinkedTransaction): Observable { - return this.http.put(this.baseUri + 'LinkedTransactions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified linked transactions (billable expenses) - * Get LinkedTransactions/{LinkedTransactionID} - * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with a specified LinkedTransaction - */ - GetLinkedTransaction(LinkedTransactionID: string): Observable { - return this.http.get(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), {}); - } - - /** - * Allows you to update a specified linked transactions (billable expenses) - * Post LinkedTransactions/{LinkedTransactionID} - * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with updated LinkedTransaction - */ - UpdateLinkedTransaction(LinkedTransactionID: string, requestBody: LinkedTransactions): Observable { - return this.http.post(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a specified linked transactions (billable expenses) - * Delete LinkedTransactions/{LinkedTransactionID} - * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction - * @return {void} - */ - DeleteLinkedTransaction(LinkedTransactionID: string): Observable> { - return this.http.delete(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve any manual journals - * Get ManualJournals - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {ManualJournals} Success - return response of type ManualJournals array with a all ManualJournals - */ - GetManualJournals(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'ManualJournals?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Allows you to create one or more manual journals - * Put ManualJournals - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request - * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal - */ - CreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { - return this.http.put(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to create a single manual journal - * Post ManualJournals - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request - * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal - */ - UpdateOrCreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { - return this.http.post(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified manual journals - * Get ManualJournals/{ManualJournalID} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @return {ManualJournals} Success - return response of type ManualJournals array with a specified ManualJournals - */ - GetManualJournal(ManualJournalID: string): Observable { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), {}); - } - - /** - * Allows you to update a specified manual journal - * Post ManualJournals/{ManualJournalID} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @return {ManualJournals} Success - return response of type ManualJournals array with an updated ManualJournal - */ - UpdateManualJournal(ManualJournalID: string, requestBody: ManualJournals): Observable { - return this.http.post(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve Attachment for manual journals - * Get ManualJournals/{ManualJournalID}/Attachments - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @return {Attachments} Success - return response of type Attachments array with all Attachments for a ManualJournals - */ - GetManualJournalAttachments(ManualJournalID: string): Observable { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve specified Attachment on ManualJournals - * Get ManualJournals/{ManualJournalID}/Attachments/{AttachmentID} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Manual Journal as binary data - */ - GetManualJournalAttachmentById(ManualJournalID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve specified Attachment on ManualJournal by file name - * Get ManualJournals/{ManualJournalID}/Attachments/{FileName} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @param {string} FileName The name of the file being attached to a ManualJournal - * @return {void} Success - return response of attachment for Manual Journal as binary data - */ - GetManualJournalAttachmentByFileName(ManualJournalID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Organisation details - * Get Organisation - * @return {Organisations} Success - return response of type Organisation array with all Organisation - */ - GetOrganisations(): Observable { - return this.http.get(this.baseUri + 'Organisation', {}); - } - - /** - * Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. - * Get Organisation/{OrganisationID}/CISSettings - * @param {string} OrganisationID The unique Xero identifier for an organisation - * @return {CISOrgSetting} Success - return response of type Organisation array with specified Organisation - */ - GetOrganisationCISSettings(OrganisationID: string): Observable { - return this.http.get(this.baseUri + 'Organisation/' + (OrganisationID == null ? '' : encodeURIComponent(OrganisationID)) + '/CISSettings', {}); - } - - /** - * Allows you to retrieve overpayments - * Get Overpayments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Overpayments} Success - return response of type Overpayments array with all Overpayments - */ - GetOverpayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Overpayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to retrieve a specified overpayments - * Get Overpayments/{OverpaymentID} - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @return {Overpayments} Success - return response of type Overpayments array with specified Overpayments - */ - GetOverpayment(OverpaymentID: string): Observable { - return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)), {}); - } - - /** - * Allows you to create a single allocation for an overpayment - * Put Overpayments/{OverpaymentID}/Allocations - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Allocations} requestBody Allocations array with Allocation object in body of request - * @return {Allocations} Success - return response of type Allocations array with all Allocation for Overpayments - */ - CreateOverpaymentAllocations(OverpaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { - return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an Overpayment - * Get Overpayments/{OverpaymentID}/History - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetOverpaymentHistory(OverpaymentID: string): Observable { - return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', {}); - } - - /** - * Allows you to create history records of an Overpayment - * Put Overpayments/{OverpaymentID}/History - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateOverpaymentHistory(OverpaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve payments for invoices and credit notes - * Get Payments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page Up to 100 payments will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Payments} Success - return response of type Payments array for all Payments - */ - GetPayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Payments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Allows you to create multiple payments for invoices or credit notes - * Put Payments - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Payments} requestBody Payments array with Payment object in body of request - * @return {Payments} Success - return response of type Payments array for newly created Payment - */ - CreatePayments(summarizeErrors: boolean | null | undefined, requestBody: Payments): Observable { - return this.http.put(this.baseUri + 'Payments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to create a single payment for invoices or credit notes - * Post Payments - * @param {Payment} requestBody Request body with a single Payment object - * @return {Payments} Success - return response of type Payments array for newly created Payment - */ - CreatePayment(requestBody: Payment): Observable { - return this.http.post(this.baseUri + 'Payments', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified payment for invoices and credit notes - * Get Payments/{PaymentID} - * @param {string} PaymentID Unique identifier for a Payment - * @return {Payments} Success - return response of type Payments array for specified Payment - */ - GetPayment(PaymentID: string): Observable { - return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), {}); - } - - /** - * Allows you to update a specified payment for invoices and credit notes - * Post Payments/{PaymentID} - * @param {string} PaymentID Unique identifier for a Payment - * @return {Payments} Success - return response of type Payments array for updated Payment - */ - DeletePayment(PaymentID: string, requestBody: PaymentDelete): Observable { - return this.http.post(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve history records of a payment - * Get Payments/{PaymentID}/History - * @param {string} PaymentID Unique identifier for a Payment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetPaymentHistory(PaymentID: string): Observable { - return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', {}); - } - - /** - * Allows you to create a history record for a payment - * Put Payments/{PaymentID}/History - * @param {string} PaymentID Unique identifier for a Payment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreatePaymentHistory(PaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve payment services - * Get PaymentServices - * @return {PaymentServices} Success - return response of type PaymentServices array for all PaymentService - */ - GetPaymentServices(): Observable { - return this.http.get(this.baseUri + 'PaymentServices', {}); - } - - /** - * Allows you to create payment services - * Put PaymentServices - * @param {PaymentServices} requestBody PaymentServices array with PaymentService object in body of request - * @return {PaymentServices} Success - return response of type PaymentServices array for newly created PaymentService - */ - CreatePaymentService(requestBody: PaymentServices): Observable { - return this.http.put(this.baseUri + 'PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve prepayments - * Get Prepayments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Prepayments} Success - return response of type Prepayments array for all Prepayment - */ - GetPrepayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Prepayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to retrieve a specified prepayments - * Get Prepayments/{PrepaymentID} - * @param {string} PrepaymentID Unique identifier for a PrePayment - * @return {Prepayments} Success - return response of type Prepayments array for a specified Prepayment - */ - GetPrepayment(PrepaymentID: string): Observable { - return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)), {}); - } - - /** - * Allows you to create an Allocation for prepayments - * Put Prepayments/{PrepaymentID}/Allocations - * @param {string} PrepaymentID Unique identifier for Prepayment - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Allocations} requestBody Allocations with an array of Allocation object in body of request - * @return {Allocations} Success - return response of type Allocations array of Allocation for all Prepayment - */ - CreatePrepaymentAllocations(PrepaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { - return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an Prepayment - * Get Prepayments/{PrepaymentID}/History - * @param {string} PrepaymentID Unique identifier for a PrePayment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetPrepaymentHistory(PrepaymentID: string): Observable { - return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', {}); - } - - /** - * Allows you to create a history record for an Prepayment - * Put Prepayments/{PrepaymentID}/History - * @param {string} PrepaymentID Unique identifier for a PrePayment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreatePrepaymentHistory(PrepaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve purchase orders - * Get PurchaseOrders - * @param {PurchaseOrderStatus} Status Filter by purchase order status - * @param {string} DateFrom Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param {string} DateTo Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param {string} order Order by an any element - * @param {number} page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array of all PurchaseOrder - */ - GetPurchaseOrders(Status: PurchaseOrderStatus | null | undefined, DateFrom: string | null | undefined, DateTo: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders?Status=' + Status + '&DateFrom=' + (DateFrom == null ? '' : encodeURIComponent(DateFrom)) + '&DateTo=' + (DateTo == null ? '' : encodeURIComponent(DateTo)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Allows you to create one or more purchase orders - * Put PurchaseOrders - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {PurchaseOrders} requestBody PurchaseOrders with an array of PurchaseOrder object in body of request - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - CreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { - return this.http.put(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update or create one or more purchase orders - * Post PurchaseOrders - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - UpdateOrCreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { - return this.http.post(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve purchase orders as PDF files - * Get PurchaseOrders/{PurchaseOrderID}/pdf - * @param {string} PurchaseOrderID Unique identifier for an Purchase Order - * @return {void} Success - return response of byte array pdf version of specified Purchase Orders - */ - GetPurchaseOrderAsPdf(PurchaseOrderID: string): Observable> { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a specified purchase orders - * Get PurchaseOrders/{PurchaseOrderID} - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - GetPurchaseOrder(PurchaseOrderID: string): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), {}); - } - - /** - * Allows you to update a specified purchase order - * Post PurchaseOrders/{PurchaseOrderID} - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for updated PurchaseOrder - */ - UpdatePurchaseOrder(PurchaseOrderID: string, requestBody: PurchaseOrders): Observable { - return this.http.post(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified purchase orders - * Get PurchaseOrders/{PurchaseOrderNumber} - * @param {string} PurchaseOrderNumber Unique identifier for a PurchaseOrder - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - GetPurchaseOrderByNumber(PurchaseOrderNumber: string): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderNumber == null ? '' : encodeURIComponent(PurchaseOrderNumber)), {}); - } - - /** - * Allows you to retrieve history for PurchaseOrder - * Get PurchaseOrders/{PurchaseOrderID}/History - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetPurchaseOrderHistory(PurchaseOrderID: string): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', {}); - } - - /** - * Allows you to create HistoryRecord for purchase orders - * Put PurchaseOrders/{PurchaseOrderID}/History - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreatePurchaseOrderHistory(PurchaseOrderID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any sales quotes - * Get Quotes - * @param {Date} DateFrom Filter for quotes after a particular date - * Type: DateOnly - * @param {Date} DateTo Filter for quotes before a particular date - * Type: DateOnly - * @param {Date} ExpiryDateFrom Filter for quotes expiring after a particular date - * Type: DateOnly - * @param {Date} ExpiryDateTo Filter for quotes before a particular date - * Type: DateOnly - * @param {string} ContactID Filter for quotes belonging to a particular contact - * @param {string} Status Filter for quotes of a particular Status - * @param {number} page e.g. page=1 � Up to 100 Quotes will be returned in a single API call with line items shown for each quote - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} order Order by an any element - * @return {Quotes} Success - return response of type quotes array with all quotes - */ - GetQuotes(DateFrom: Date | null | undefined, DateTo: Date | null | undefined, ExpiryDateFrom: Date | null | undefined, ExpiryDateTo: Date | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, page: number | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Quotes?DateFrom=' + DateFrom?.toISOString() + '&DateTo=' + DateTo?.toISOString() + '&ExpiryDateFrom=' + ExpiryDateFrom?.toISOString() + '&ExpiryDateTo=' + ExpiryDateTo?.toISOString() + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&page=' + page + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create one or more quotes - * Put Quotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Quotes} requestBody Quotes with an array of Quote object in body of request - * @return {Quotes} Success - return response of type Quotes with array with newly created Quote - */ - CreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { - return this.http.put(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more quotes - * Post Quotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @return {Quotes} Success - return response of type Quotes array with updated or created Quote - */ - UpdateOrCreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { - return this.http.post(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified quote - * Get Quotes/{QuoteID} - * @param {string} QuoteID Unique identifier for an Quote - * @return {Quotes} Success - return response of type Quotes array with specified Quote - */ - GetQuote(QuoteID: string): Observable { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), {}); - } - - /** - * Allows you to update a specified quote - * Post Quotes/{QuoteID} - * @param {string} QuoteID Unique identifier for an Quote - * @return {Quotes} Success - return response of type Quotes array with updated Quote - */ - UpdateQuote(QuoteID: string, requestBody: Quotes): Observable { - return this.http.post(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an quote - * Get Quotes/{QuoteID}/History - * @param {string} QuoteID Unique identifier for an Quote - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetQuoteHistory(QuoteID: string): Observable { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an quote - * Put Quotes/{QuoteID}/History - * @param {string} QuoteID Unique identifier for an Quote - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateQuoteHistory(QuoteID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve quotes as PDF files - * Get Quotes/{QuoteID}/pdf - * @param {string} QuoteID Unique identifier for an Quote - * @return {void} Success - return response of byte array pdf version of specified Quotes - */ - GetQuoteAsPdf(QuoteID: string): Observable> { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments for Quotes - * Get Quotes/{QuoteID}/Attachments - * @param {string} QuoteID Unique identifier for Quote object - * @return {Attachments} Success - return response of type Attachments array of Attachment - */ - GetQuoteAttachments(QuoteID: string): Observable { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve specific Attachment on Quote - * Get Quotes/{QuoteID}/Attachments/{AttachmentID} - * @param {string} QuoteID Unique identifier for Quote object - * @param {string} AttachmentID Unique identifier for Attachment object - * @return {void} Success - return response of attachment for Quote as binary data - */ - GetQuoteAttachmentById(QuoteID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachment on Quote by Filename - * Get Quotes/{QuoteID}/Attachments/{FileName} - * @param {string} QuoteID Unique identifier for Quote object - * @param {string} FileName Name of the attachment - * @return {void} Success - return response of attachment for Quote as binary data - */ - GetQuoteAttachmentByFileName(QuoteID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve draft expense claim receipts for any user - * Get Receipts - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Receipts} Success - return response of type Receipts array for all Receipt - */ - GetReceipts(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Receipts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create draft expense claim receipts for any user - * Put Receipts - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {Receipts} requestBody Receipts with an array of Receipt object in body of request - * @return {Receipts} Success - return response of type Receipts array for newly created Receipt - */ - CreateReceipt(unitdp: number | null | undefined, requestBody: Receipts): Observable { - return this.http.put(this.baseUri + 'Receipts?unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified draft expense claim receipts - * Get Receipts/{ReceiptID} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Receipts} Success - return response of type Receipts array for a specified Receipt - */ - GetReceipt(ReceiptID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to retrieve a specified draft expense claim receipts - * Post Receipts/{ReceiptID} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Receipts} Success - return response of type Receipts array for updated Receipt - */ - UpdateReceipt(ReceiptID: string, unitdp: number | null | undefined, requestBody: Receipts): Observable { - return this.http.post(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve Attachments for expense claim receipts - * Get Receipts/{ReceiptID}/Attachments - * @param {string} ReceiptID Unique identifier for a Receipt - * @return {Attachments} Success - return response of type Attachments array of Attachments for a specified Receipt - */ - GetReceiptAttachments(ReceiptID: string): Observable { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on expense claim receipts by ID - * Get Receipts/{ReceiptID}/Attachments/{AttachmentID} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Receipt as binary data - */ - GetReceiptAttachmentById(ReceiptID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on expense claim receipts by file name - * Get Receipts/{ReceiptID}/Attachments/{FileName} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {string} FileName The name of the file being attached to the Receipt - * @return {void} Success - return response of attachment for Receipt as binary data - */ - GetReceiptAttachmentByFileName(ReceiptID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a history records of an Receipt - * Get Receipts/{ReceiptID}/History - * @param {string} ReceiptID Unique identifier for a Receipt - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetReceiptHistory(ReceiptID: string): Observable { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an Receipt - * Put Receipts/{ReceiptID}/History - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateReceiptHistory(ReceiptID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any repeating invoices - * Get RepeatingInvoices - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array for all Repeating Invoice - */ - GetRepeatingInvoices(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to retrieve a specified repeating invoice - * Get RepeatingInvoices/{RepeatingInvoiceID} - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array with a specified Repeating Invoice - */ - GetRepeatingInvoice(RepeatingInvoiceID: string): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)), {}); - } - - /** - * Allows you to retrieve Attachments on repeating invoice - * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @return {Attachments} Success - return response of type Attachments array with all Attachments for a specified Repeating Invoice - */ - GetRepeatingInvoiceAttachments(RepeatingInvoiceID: string): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve a specified Attachments on repeating invoices - * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID} - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Repeating Invoice as binary data - */ - GetRepeatingInvoiceAttachmentById(RepeatingInvoiceID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve specified attachment on repeating invoices by file name - * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @param {string} FileName The name of the file being attached to a Repeating Invoice - * @return {void} Success - return response of attachment for Repeating Invoice as binary data - */ - GetRepeatingInvoiceAttachmentByFileName(RepeatingInvoiceID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history for a repeating invoice - * Get RepeatingInvoices/{RepeatingInvoiceID}/History - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetRepeatingInvoiceHistory(RepeatingInvoiceID: string): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', {}); - } - - /** - * Allows you to create history for a repeating invoice - * Put RepeatingInvoices/{RepeatingInvoiceID}/History - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateRepeatingInvoiceHistory(RepeatingInvoiceID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve report for TenNinetyNine - * Get Reports/TenNinetyNine - * @param {string} reportYear The year of the 1099 report - * @return {Reports} Success - return response of type Reports - */ - GetReportTenNinetyNine(reportYear: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/TenNinetyNine?reportYear=' + (reportYear == null ? '' : encodeURIComponent(reportYear)), {}); - } - - /** - * Allows you to retrieve report for AgedPayablesByContact - * Get Reports/AgedPayablesByContact - * @param {string} contactId Unique identifier for a Contact - * @param {Date} date The date of the Aged Payables By Contact report - * Type: DateOnly - * @param {Date} fromDate The from date of the Aged Payables By Contact report - * Type: DateOnly - * @param {Date} toDate The to date of the Aged Payables By Contact report - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportAgedPayablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/AgedPayablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for AgedReceivablesByContact - * Get Reports/AgedReceivablesByContact - * @param {string} contactId Unique identifier for a Contact - * @param {Date} date The date of the Aged Receivables By Contact report - * Type: DateOnly - * @param {Date} fromDate The from date of the Aged Receivables By Contact report - * Type: DateOnly - * @param {Date} toDate The to date of the Aged Receivables By Contact report - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportAgedReceivablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/AgedReceivablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for BalanceSheet - * Get Reports/BalanceSheet - * @param {string} date The date of the Balance Sheet report - * @param {number} periods The number of periods for the Balance Sheet report - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param {string} trackingOptionID1 The tracking option 1 for the Balance Sheet report - * @param {string} trackingOptionID2 The tracking option 2 for the Balance Sheet report - * @param {boolean} standardLayout The standard layout boolean for the Balance Sheet report - * @param {boolean} paymentsOnly return a cash basis for the Balance Sheet report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBalanceSheet(date: string | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingOptionID1: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/BalanceSheet?date=' + (date == null ? '' : encodeURIComponent(date)) + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingOptionID1=' + (trackingOptionID1 == null ? '' : encodeURIComponent(trackingOptionID1)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve report for BankSummary - * Get Reports/BankSummary - * @param {Date} fromDate The from date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @param {Date} toDate The to date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBankSummary(fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/BankSummary?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for BAS only valid for AU orgs - * Get Reports - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBASorGSTList(): Observable { - return this.http.get(this.baseUri + 'Reports', {}); - } - - /** - * Allows you to retrieve report for BAS only valid for AU orgs - * Get Reports/{ReportID} - * @param {string} ReportID Unique identifier for a Report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBASorGST(ReportID: string): Observable { - return this.http.get(this.baseUri + 'Reports/' + (ReportID == null ? '' : encodeURIComponent(ReportID)), {}); - } - - /** - * Allows you to retrieve report for Budget Summary - * Get Reports/BudgetSummary - * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @param {number} period The number of periods to compare (integer between 1 and 12) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} timeframe The period size to compare to (1=month, 3=quarter, 12=year) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {ReportWithRows} success- return a Report with Rows object - */ - GetReportBudgetSummary(date: Date | null | undefined, period: number | null | undefined, timeframe: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/BudgetSummary?date=' + date?.toISOString() + '&period=' + period + '&timeframe=' + timeframe, {}); - } - - /** - * Allows you to retrieve report for ExecutiveSummary - * Get Reports/ExecutiveSummary - * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportExecutiveSummary(date: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/ExecutiveSummary?date=' + date?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for ProfitAndLoss - * Get Reports/ProfitAndLoss - * @param {Date} fromDate The from date for the ProfitAndLoss report e.g. 2018-03-31 - * Type: DateOnly - * @param {Date} toDate The to date for the ProfitAndLoss report e.g. 2018-03-31 - * Type: DateOnly - * @param {number} periods The number of periods to compare (integer between 1 and 12) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param {string} trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report - * @param {string} trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report - * @param {string} trackingOptionID The tracking option 1 for the ProfitAndLoss report - * @param {string} trackingOptionID2 The tracking option 2 for the ProfitAndLoss report - * @param {boolean} standardLayout Return the standard layout for the ProfitAndLoss report - * @param {boolean} paymentsOnly Return cash only basis for the ProfitAndLoss report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportProfitAndLoss(fromDate: Date | null | undefined, toDate: Date | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingCategoryID: string | null | undefined, trackingCategoryID2: string | null | undefined, trackingOptionID: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/ProfitAndLoss?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString() + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingCategoryID=' + (trackingCategoryID == null ? '' : encodeURIComponent(trackingCategoryID)) + '&trackingCategoryID2=' + (trackingCategoryID2 == null ? '' : encodeURIComponent(trackingCategoryID2)) + '&trackingOptionID=' + (trackingOptionID == null ? '' : encodeURIComponent(trackingOptionID)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve report for TrialBalance - * Get Reports/TrialBalance - * @param {Date} date The date for the Trial Balance report e.g. 2018-03-31 - * Type: DateOnly - * @param {boolean} paymentsOnly Return cash only basis for the Trial Balance report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportTrialBalance(date: Date | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/TrialBalance?date=' + date?.toISOString() + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve Tax Rates - * Get TaxRates - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {string} TaxType Filter by tax type - * @return {TaxRates} Success - return response of type TaxRates array with TaxRates - */ - GetTaxRates(where: string | null | undefined, order: string | null | undefined, TaxType: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'TaxRates?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&TaxType=' + (TaxType == null ? '' : encodeURIComponent(TaxType)), {}); - } - - /** - * Allows you to create one or more Tax Rates - * Put TaxRates - * @param {TaxRates} requestBody TaxRates array with TaxRate object in body of request - * @return {TaxRates} Success - return response of type TaxRates array newly created TaxRate - */ - CreateTaxRates(requestBody: TaxRates): Observable { - return this.http.put(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update Tax Rates - * Post TaxRates - * @return {TaxRates} Success - return response of type TaxRates array updated TaxRate - */ - UpdateTaxRate(requestBody: TaxRates): Observable { - return this.http.post(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve tracking categories and options - * Get TrackingCategories - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {boolean} includeArchived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response - * @return {TrackingCategories} Success - return response of type TrackingCategories array of TrackingCategory - */ - GetTrackingCategories(where: string | null | undefined, order: string | null | undefined, includeArchived: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'TrackingCategories?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&includeArchived=' + includeArchived, {}); - } - - /** - * Allows you to create tracking categories - * Put TrackingCategories - * @param {TrackingCategory} requestBody TrackingCategory object in body of request - * @return {TrackingCategories} Success - return response of type TrackingCategories array of newly created TrackingCategory - */ - CreateTrackingCategory(requestBody: TrackingCategory): Observable { - return this.http.put(this.baseUri + 'TrackingCategories', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve tracking categories and options for specified category - * Get TrackingCategories/{TrackingCategoryID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @return {TrackingCategories} Success - return response of type TrackingCategories array of specified TrackingCategory - */ - GetTrackingCategory(TrackingCategoryID: string): Observable { - return this.http.get(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); - } - - /** - * Allows you to update tracking categories - * Post TrackingCategories/{TrackingCategoryID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @return {TrackingCategories} Success - return response of type TrackingCategories array of updated TrackingCategory - */ - UpdateTrackingCategory(TrackingCategoryID: string, requestBody: TrackingCategory): Observable { - return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete tracking categories - * Delete TrackingCategories/{TrackingCategoryID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @return {TrackingCategories} Success - return response of type TrackingCategories array of deleted TrackingCategory - */ - DeleteTrackingCategory(TrackingCategoryID: string): Observable { - return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); - } - - /** - * Allows you to create options for a specified tracking category - * Put TrackingCategories/{TrackingCategoryID}/Options - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @param {TrackingOption} requestBody TrackingOption object in body of request - * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category - */ - CreateTrackingOptions(TrackingCategoryID: string, requestBody: TrackingOption): Observable { - return this.http.put(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update options for a specified tracking category - * Post TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @param {string} TrackingOptionID Unique identifier for a Tracking Option - * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category - */ - UpdateTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string, requestBody: TrackingOption): Observable { - return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a specified option for a specified tracking category - * Delete TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @param {string} TrackingOptionID Unique identifier for a Tracking Option - * @return {TrackingOptions} Success - return response of type TrackingOptions array of remaining options for a specified category - */ - DeleteTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string): Observable { - return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), {}); - } - - /** - * Allows you to retrieve users - * Get Users - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Users} Success - return response of type Users array of all User - */ - GetUsers(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Users?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to retrieve a specified user - * Get Users/{UserID} - * @param {string} UserID Unique identifier for a User - * @return {Users} Success - return response of type Users array of specified User - */ - GetUser(UserID: string): Observable { - return this.http.get(this.baseUri + 'Users/' + (UserID == null ? '' : encodeURIComponent(UserID)), {}); - } - } - - export enum GetReportBalanceSheetTimeframe { MONTH = 0, QUARTER = 1, YEAR = 2 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Address { + + /** define the type of address */ + AddressType?: AddressAddressType | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine1?: string | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine2?: string | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine3?: string | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine4?: string | null; + + /** + * max length = 255 + * Max length: 255 + */ + City?: string | null; + + /** + * max length = 255 + * Max length: 255 + */ + Region?: string | null; + + /** + * max length = 50 + * Max length: 50 + */ + PostalCode?: string | null; + + /** + * max length = 50, [A-Z], [a-z] only + * Max length: 50 + */ + Country?: string | null; + + /** + * max length = 255 + * Max length: 255 + */ + AttentionTo?: string | null; + } + export interface AddressFormProperties { + + /** define the type of address */ + AddressType: FormControl, + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine1: FormControl, + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine2: FormControl, + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine3: FormControl, + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine4: FormControl, + + /** + * max length = 255 + * Max length: 255 + */ + City: FormControl, + + /** + * max length = 255 + * Max length: 255 + */ + Region: FormControl, + + /** + * max length = 50 + * Max length: 50 + */ + PostalCode: FormControl, + + /** + * max length = 50, [A-Z], [a-z] only + * Max length: 50 + */ + Country: FormControl, + + /** + * max length = 255 + * Max length: 255 + */ + AttentionTo: FormControl, + } + export function CreateAddressFormGroup() { + return new FormGroup({ + AddressType: new FormControl(undefined), + AddressLine1: new FormControl(undefined, [Validators.maxLength(500)]), + AddressLine2: new FormControl(undefined, [Validators.maxLength(500)]), + AddressLine3: new FormControl(undefined, [Validators.maxLength(500)]), + AddressLine4: new FormControl(undefined, [Validators.maxLength(500)]), + City: new FormControl(undefined, [Validators.maxLength(255)]), + Region: new FormControl(undefined, [Validators.maxLength(255)]), + PostalCode: new FormControl(undefined, [Validators.maxLength(50)]), + Country: new FormControl(undefined, [Validators.maxLength(50)]), + AttentionTo: new FormControl(undefined, [Validators.maxLength(255)]), + }); + + } + + export enum AddressAddressType { POBOX = 0, STREET = 1, DELIVERY = 2 } + + export interface Phone { + PhoneType?: PhonePhoneType | null; + + /** + * max length = 50 + * Max length: 50 + */ + PhoneNumber?: string | null; + + /** + * max length = 10 + * Max length: 10 + */ + PhoneAreaCode?: string | null; + + /** + * max length = 20 + * Max length: 20 + */ + PhoneCountryCode?: string | null; + } + export interface PhoneFormProperties { + PhoneType: FormControl, + + /** + * max length = 50 + * Max length: 50 + */ + PhoneNumber: FormControl, + + /** + * max length = 10 + * Max length: 10 + */ + PhoneAreaCode: FormControl, + + /** + * max length = 20 + * Max length: 20 + */ + PhoneCountryCode: FormControl, + } + export function CreatePhoneFormGroup() { + return new FormGroup({ + PhoneType: new FormControl(undefined), + PhoneNumber: new FormControl(undefined, [Validators.maxLength(50)]), + PhoneAreaCode: new FormControl(undefined, [Validators.maxLength(10)]), + PhoneCountryCode: new FormControl(undefined, [Validators.maxLength(20)]), + }); + + } + + export enum PhonePhoneType { DEFAULT = 0, DDI = 1, MOBILE = 2, FAX = 3, OFFICE = 4 } + + export interface Accounts { + Accounts1?: Array; + } + export interface AccountsFormProperties { + } + export function CreateAccountsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Account { + + /** + * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) + * Max length: 10 + */ + Code?: string | null; + + /** + * Name of account (max length = 150) + * Max length: 150 + */ + Name?: string | null; + + /** The Xero identifier for an account � specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + AccountID?: string | null; + + /** See Account Types */ + Type?: AccountType | null; + + /** For bank accounts only (Account Type BANK) */ + BankAccountNumber?: string | null; + + /** Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes */ + Status?: AccountStatus | null; + + /** Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) */ + Description?: string | null; + + /** For bank accounts only. See Bank Account types */ + BankAccountType?: AccountBankAccountType | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** Boolean � describes whether account can have payments applied to it */ + EnablePaymentsToAccount?: boolean | null; + + /** Boolean � describes whether account code is available for use with expense claims */ + ShowInExpenseClaims?: boolean | null; + + /** See Account Class Types */ + Class?: AccountClass | null; + + /** If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either �� or null. */ + SystemAccount?: AccountSystemAccount | null; + + /** Shown if set */ + ReportingCode?: string | null; + + /** Shown if set */ + ReportingCodeName?: string | null; + + /** boolean to indicate if an account has an attachment (read only) */ + HasAttachments?: boolean | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Boolean � describes whether the account is shown in the watchlist widget on the dashboard */ + AddToWatchlist?: boolean | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface AccountFormProperties { + + /** + * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) + * Max length: 10 + */ + Code: FormControl, + + /** + * Name of account (max length = 150) + * Max length: 150 + */ + Name: FormControl, + + /** The Xero identifier for an account � specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + AccountID: FormControl, + + /** See Account Types */ + Type: FormControl, + + /** For bank accounts only (Account Type BANK) */ + BankAccountNumber: FormControl, + + /** Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes */ + Status: FormControl, + + /** Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) */ + Description: FormControl, + + /** For bank accounts only. See Bank Account types */ + BankAccountType: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** The tax type from TaxRates */ + TaxType: FormControl, + + /** Boolean � describes whether account can have payments applied to it */ + EnablePaymentsToAccount: FormControl, + + /** Boolean � describes whether account code is available for use with expense claims */ + ShowInExpenseClaims: FormControl, + + /** See Account Class Types */ + Class: FormControl, + + /** If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either �� or null. */ + SystemAccount: FormControl, + + /** Shown if set */ + ReportingCode: FormControl, + + /** Shown if set */ + ReportingCodeName: FormControl, + + /** boolean to indicate if an account has an attachment (read only) */ + HasAttachments: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** Boolean � describes whether the account is shown in the watchlist widget on the dashboard */ + AddToWatchlist: FormControl, + } + export function CreateAccountFormGroup() { + return new FormGroup({ + Code: new FormControl(undefined, [Validators.maxLength(10)]), + Name: new FormControl(undefined, [Validators.maxLength(150)]), + AccountID: new FormControl(undefined), + Type: new FormControl(undefined), + BankAccountNumber: new FormControl(undefined), + Status: new FormControl(undefined), + Description: new FormControl(undefined), + BankAccountType: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + TaxType: new FormControl(undefined), + EnablePaymentsToAccount: new FormControl(undefined), + ShowInExpenseClaims: new FormControl(undefined), + Class: new FormControl(undefined), + SystemAccount: new FormControl(undefined), + ReportingCode: new FormControl(undefined), + ReportingCodeName: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + AddToWatchlist: new FormControl(undefined), + }); + + } + + export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21 } + + export enum AccountStatus { ACTIVE = 0, ARCHIVED = 1, DELETED = 2 } + + export enum AccountBankAccountType { BANK = 0, CREDITCARD = 1, PAYPAL = 2, NONE = 3, '' = 4 } + + export enum AccountCurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + export enum AccountClass { ASSET = 0, EQUITY = 1, EXPENSE = 2, LIABILITY = 3, REVENUE = 4 } + + export enum AccountSystemAccount { DEBTORS = 0, CREDITORS = 1, BANKCURRENCYGAIN = 2, GST = 3, GSTONIMPORTS = 4, HISTORICAL = 5, REALISEDCURRENCYGAIN = 6, RETAINEDEARNINGS = 7, ROUNDING = 8, TRACKINGTRANSFERS = 9, UNPAIDEXPCLM = 10, UNREALISEDCURRENCYGAIN = 11, WAGEPAYABLES = 12, CISASSETS = 13, CISASSET = 14, CISLABOUR = 15, CISLABOUREXPENSE = 16, CISLABOURINCOME = 17, CISLIABILITY = 18, CISMATERIALS = 19, '' = 20 } + + export interface ValidationError { + + /** Validation error message */ + Message?: string | null; + } + export interface ValidationErrorFormProperties { + + /** Validation error message */ + Message: FormControl, + } + export function CreateValidationErrorFormGroup() { + return new FormGroup({ + Message: new FormControl(undefined), + }); + + } + + export interface Attachments { + Attachments1?: Array; + } + export interface AttachmentsFormProperties { + } + export function CreateAttachmentsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Attachment { + + /** Unique ID for the file */ + AttachmentID?: string | null; + + /** Name of the file */ + FileName?: string | null; + + /** URL to the file on xero.com */ + Url?: string | null; + + /** Type of file */ + MimeType?: string | null; + + /** + * Length of the file content + * Type: double + */ + ContentLength?: number | null; + + /** Include the file with the online invoice */ + IncludeOnline?: boolean | null; + } + export interface AttachmentFormProperties { + + /** Unique ID for the file */ + AttachmentID: FormControl, + + /** Name of the file */ + FileName: FormControl, + + /** URL to the file on xero.com */ + Url: FormControl, + + /** Type of file */ + MimeType: FormControl, + + /** + * Length of the file content + * Type: double + */ + ContentLength: FormControl, + + /** Include the file with the online invoice */ + IncludeOnline: FormControl, + } + export function CreateAttachmentFormGroup() { + return new FormGroup({ + AttachmentID: new FormControl(undefined), + FileName: new FormControl(undefined), + Url: new FormControl(undefined), + MimeType: new FormControl(undefined), + ContentLength: new FormControl(undefined), + IncludeOnline: new FormControl(undefined), + }); + + } + + export interface BankTransactions { + BankTransactions1?: Array; + } + export interface BankTransactionsFormProperties { + } + export function CreateBankTransactionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface BankTransaction { + + /** + * See Bank Transaction Types + * Required + */ + Type: BankTransactionType; + + /** Required */ + Contact: Contact; + + /** + * See LineItems + * Required + */ + LineItems: Array; + + /** Required */ + BankAccount: Account; + + /** Boolean to show if transaction is reconciled */ + IsReconciled?: boolean | null; + + /** + * Date of transaction � YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** Reference for the transaction. Only supported for SPEND and RECEIVE transactions. */ + Reference?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn�t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. + * Type: double + */ + CurrencyRate?: number | null; + + /** URL link to a source document � shown as �Go to App Name� */ + Url?: string | null; + + /** See Bank Transaction Status Codes */ + Status?: BankTransactionStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** + * Total of bank transaction excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on bank transaction + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of bank transaction tax inclusive + * Type: double + */ + Total?: number | null; + + /** Xero generated unique identifier for bank transaction */ + BankTransactionID?: string | null; + + /** Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT */ + PrepaymentID?: string | null; + + /** Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT */ + OverpaymentID?: string | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Boolean to indicate if a bank transaction has an attachment */ + HasAttachments?: boolean | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface BankTransactionFormProperties { + + /** + * See Bank Transaction Types + * Required + */ + Type: FormControl, + + /** Boolean to show if transaction is reconciled */ + IsReconciled: FormControl, + + /** + * Date of transaction � YYYY-MM-DD + * Type: DateOnly + */ + Date: FormControl, + + /** Reference for the transaction. Only supported for SPEND and RECEIVE transactions. */ + Reference: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** + * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn�t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. + * Type: double + */ + CurrencyRate: FormControl, + + /** URL link to a source document � shown as �Go to App Name� */ + Url: FormControl, + + /** See Bank Transaction Status Codes */ + Status: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** + * Total of bank transaction excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * Total tax on bank transaction + * Type: double + */ + TotalTax: FormControl, + + /** + * Total of bank transaction tax inclusive + * Type: double + */ + Total: FormControl, + + /** Xero generated unique identifier for bank transaction */ + BankTransactionID: FormControl, + + /** Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT */ + PrepaymentID: FormControl, + + /** Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT */ + OverpaymentID: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** Boolean to indicate if a bank transaction has an attachment */ + HasAttachments: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreateBankTransactionFormGroup() { + return new FormGroup({ + Type: new FormControl(undefined, [Validators.required]), + IsReconciled: new FormControl(undefined), + Date: CreateDateOnlyFormControl(), + Reference: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + Url: new FormControl(undefined), + Status: new FormControl(undefined), + LineAmountTypes: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + BankTransactionID: new FormControl(undefined), + PrepaymentID: new FormControl(undefined), + OverpaymentID: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export enum BankTransactionType { RECEIVE = 0, 'RECEIVE-OVERPAYMENT' = 1, 'RECEIVE-PREPAYMENT' = 2, SPEND = 3, 'SPEND-OVERPAYMENT' = 4, 'SPEND-PREPAYMENT' = 5, 'RECEIVE-TRANSFER' = 6, 'SPEND-TRANSFER' = 7 } + + export interface Contact { + + /** Xero identifier */ + ContactID?: string | null; + + /** + * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. + * Max length: 50 + */ + ContactNumber?: string | null; + + /** + * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) + * Max length: 50 + */ + AccountNumber?: string | null; + + /** Current status of a contact � see contact status types */ + ContactStatus?: ContactContactStatus | null; + + /** + * Full name of contact/organisation (max length = 255) + * Max length: 255 + */ + Name?: string | null; + + /** + * First name of contact person (max length = 255) + * Max length: 255 + */ + FirstName?: string | null; + + /** + * Last name of contact person (max length = 255) + * Max length: 255 + */ + LastName?: string | null; + + /** + * Email address of contact person (umlauts not supported) (max length = 255) + * Max length: 255 + */ + EmailAddress?: string | null; + + /** Skype user name of contact */ + SkypeUserName?: string | null; + + /** See contact persons */ + ContactPersons?: Array; + + /** Bank account number of contact */ + BankAccountDetails?: string | null; + + /** + * Tax number of contact � this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) + * Max length: 50 + */ + TaxNumber?: string | null; + + /** The tax type from TaxRates */ + AccountsReceivableTaxType?: string | null; + + /** The tax type from TaxRates */ + AccountsPayableTaxType?: string | null; + + /** Store certain address types for a contact � see address types */ + Addresses?: Array
; + + /** Store certain phone types for a contact � see phone types */ + Phones?: Array; + + /** true or false � Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts payable invoice is generated against this contact. */ + IsSupplier?: boolean | null; + + /** true or false � Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts receivable invoice is generated against this contact. */ + IsCustomer?: boolean | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + DefaultCurrency?: AccountCurrencyCode | null; + + /** Store XeroNetworkKey for contacts. */ + XeroNetworkKey?: string | null; + + /** The default sales account code for contacts */ + SalesDefaultAccountCode?: string | null; + + /** The default purchases account code for contacts */ + PurchasesDefaultAccountCode?: string | null; + + /** The default sales tracking categories for contacts */ + SalesTrackingCategories?: Array; + + /** The default purchases tracking categories for contacts */ + PurchasesTrackingCategories?: Array; + + /** The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ + TrackingCategoryName?: string | null; + + /** The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ + TrackingCategoryOption?: string | null; + PaymentTerms?: PaymentTerm; + + /** UTC timestamp of last update to contact */ + UpdatedDateUTC?: Date | null; + + /** Displays which contact groups a contact is included in */ + ContactGroups?: Array; + + /** Website address for contact (read only) */ + Website?: string | null; + BrandingTheme?: BrandingTheme; + + /** Bank details for use on a batch payment stored with each contact */ + BatchPayments?: BatchPaymentDetails; + + /** + * The default discount rate for the contact (read only) + * Type: double + */ + Discount?: number | null; + + /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ + Balances?: Balances; + + /** Displays array of attachments from the API */ + Attachments?: Array; + + /** A boolean to indicate if a contact has an attachment */ + HasAttachments?: boolean | null; + + /** Displays validation errors returned from the API */ + ValidationErrors?: Array; + + /** A boolean to indicate if a contact has an validation errors */ + HasValidationErrors?: boolean | null; + + /** Status of object */ + StatusAttributeString?: string | null; + } + export interface ContactFormProperties { + + /** Xero identifier */ + ContactID: FormControl, + + /** + * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. + * Max length: 50 + */ + ContactNumber: FormControl, + + /** + * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) + * Max length: 50 + */ + AccountNumber: FormControl, + + /** Current status of a contact � see contact status types */ + ContactStatus: FormControl, + + /** + * Full name of contact/organisation (max length = 255) + * Max length: 255 + */ + Name: FormControl, + + /** + * First name of contact person (max length = 255) + * Max length: 255 + */ + FirstName: FormControl, + + /** + * Last name of contact person (max length = 255) + * Max length: 255 + */ + LastName: FormControl, + + /** + * Email address of contact person (umlauts not supported) (max length = 255) + * Max length: 255 + */ + EmailAddress: FormControl, + + /** Skype user name of contact */ + SkypeUserName: FormControl, + + /** Bank account number of contact */ + BankAccountDetails: FormControl, + + /** + * Tax number of contact � this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) + * Max length: 50 + */ + TaxNumber: FormControl, + + /** The tax type from TaxRates */ + AccountsReceivableTaxType: FormControl, + + /** The tax type from TaxRates */ + AccountsPayableTaxType: FormControl, + + /** true or false � Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts payable invoice is generated against this contact. */ + IsSupplier: FormControl, + + /** true or false � Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts receivable invoice is generated against this contact. */ + IsCustomer: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + DefaultCurrency: FormControl, + + /** Store XeroNetworkKey for contacts. */ + XeroNetworkKey: FormControl, + + /** The default sales account code for contacts */ + SalesDefaultAccountCode: FormControl, + + /** The default purchases account code for contacts */ + PurchasesDefaultAccountCode: FormControl, + + /** The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ + TrackingCategoryName: FormControl, + + /** The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ + TrackingCategoryOption: FormControl, + + /** UTC timestamp of last update to contact */ + UpdatedDateUTC: FormControl, + + /** Website address for contact (read only) */ + Website: FormControl, + + /** + * The default discount rate for the contact (read only) + * Type: double + */ + Discount: FormControl, + + /** A boolean to indicate if a contact has an attachment */ + HasAttachments: FormControl, + + /** A boolean to indicate if a contact has an validation errors */ + HasValidationErrors: FormControl, + + /** Status of object */ + StatusAttributeString: FormControl, + } + export function CreateContactFormGroup() { + return new FormGroup({ + ContactID: new FormControl(undefined), + ContactNumber: new FormControl(undefined, [Validators.maxLength(50)]), + AccountNumber: new FormControl(undefined, [Validators.maxLength(50)]), + ContactStatus: new FormControl(undefined), + Name: new FormControl(undefined, [Validators.maxLength(255)]), + FirstName: new FormControl(undefined, [Validators.maxLength(255)]), + LastName: new FormControl(undefined, [Validators.maxLength(255)]), + EmailAddress: new FormControl(undefined, [Validators.maxLength(255)]), + SkypeUserName: new FormControl(undefined), + BankAccountDetails: new FormControl(undefined), + TaxNumber: new FormControl(undefined, [Validators.maxLength(50)]), + AccountsReceivableTaxType: new FormControl(undefined), + AccountsPayableTaxType: new FormControl(undefined), + IsSupplier: new FormControl(undefined), + IsCustomer: new FormControl(undefined), + DefaultCurrency: new FormControl(undefined), + XeroNetworkKey: new FormControl(undefined), + SalesDefaultAccountCode: new FormControl(undefined), + PurchasesDefaultAccountCode: new FormControl(undefined), + TrackingCategoryName: new FormControl(undefined), + TrackingCategoryOption: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + Website: new FormControl(undefined), + Discount: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + HasValidationErrors: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export enum ContactContactStatus { ACTIVE = 0, ARCHIVED = 1, GDPRREQUEST = 2 } + + export interface ContactPerson { + + /** First name of person */ + FirstName?: string | null; + + /** Last name of person */ + LastName?: string | null; + + /** Email address of person */ + EmailAddress?: string | null; + + /** boolean to indicate whether contact should be included on emails with invoices etc. */ + IncludeInEmails?: boolean | null; + } + export interface ContactPersonFormProperties { + + /** First name of person */ + FirstName: FormControl, + + /** Last name of person */ + LastName: FormControl, + + /** Email address of person */ + EmailAddress: FormControl, + + /** boolean to indicate whether contact should be included on emails with invoices etc. */ + IncludeInEmails: FormControl, + } + export function CreateContactPersonFormGroup() { + return new FormGroup({ + FirstName: new FormControl(undefined), + LastName: new FormControl(undefined), + EmailAddress: new FormControl(undefined), + IncludeInEmails: new FormControl(undefined), + }); + + } + + export interface SalesTrackingCategory { + + /** The default sales tracking category name for contacts */ + TrackingCategoryName?: string | null; + + /** The default purchase tracking category name for contacts */ + TrackingOptionName?: string | null; + } + export interface SalesTrackingCategoryFormProperties { + + /** The default sales tracking category name for contacts */ + TrackingCategoryName: FormControl, + + /** The default purchase tracking category name for contacts */ + TrackingOptionName: FormControl, + } + export function CreateSalesTrackingCategoryFormGroup() { + return new FormGroup({ + TrackingCategoryName: new FormControl(undefined), + TrackingOptionName: new FormControl(undefined), + }); + + } + + export interface PaymentTerm { + Bills?: Bill; + Sales?: Bill; + } + export interface PaymentTermFormProperties { + } + export function CreatePaymentTermFormGroup() { + return new FormGroup({ + }); + + } + + export interface Bill { + + /** + * Day of Month (0-31) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Day?: number | null; + Type?: BillType | null; + } + export interface BillFormProperties { + + /** + * Day of Month (0-31) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Day: FormControl, + Type: FormControl, + } + export function CreateBillFormGroup() { + return new FormGroup({ + Day: new FormControl(undefined), + Type: new FormControl(undefined), + }); + + } + + export enum BillType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } + + export interface ContactGroup { + + /** The Name of the contact group. Required when creating a new contact group */ + Name?: string | null; + + /** The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. */ + Status?: ContactGroupStatus | null; + + /** The Xero identifier for an contact group � specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + ContactGroupID?: string | null; + + /** The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. */ + Contacts?: Array; + } + export interface ContactGroupFormProperties { + + /** The Name of the contact group. Required when creating a new contact group */ + Name: FormControl, + + /** The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. */ + Status: FormControl, + + /** The Xero identifier for an contact group � specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + ContactGroupID: FormControl, + } + export function CreateContactGroupFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined), + Status: new FormControl(undefined), + ContactGroupID: new FormControl(undefined), + }); + + } + + export enum ContactGroupStatus { ACTIVE = 0, DELETED = 1 } + + export interface BrandingTheme { + + /** Xero identifier */ + BrandingThemeID?: string | null; + + /** Name of branding theme */ + Name?: string | null; + + /** The location of the image file used as the logo on this branding theme */ + LogoUrl?: string | null; + + /** Always INVOICE */ + Type?: BrandingThemeType | null; + + /** + * Integer � ranked order of branding theme. The default branding theme has a value of 0 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + SortOrder?: number | null; + + /** UTC timestamp of creation date of branding theme */ + CreatedDateUTC?: Date | null; + } + export interface BrandingThemeFormProperties { + + /** Xero identifier */ + BrandingThemeID: FormControl, + + /** Name of branding theme */ + Name: FormControl, + + /** The location of the image file used as the logo on this branding theme */ + LogoUrl: FormControl, + + /** Always INVOICE */ + Type: FormControl, + + /** + * Integer � ranked order of branding theme. The default branding theme has a value of 0 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + SortOrder: FormControl, + + /** UTC timestamp of creation date of branding theme */ + CreatedDateUTC: FormControl, + } + export function CreateBrandingThemeFormGroup() { + return new FormGroup({ + BrandingThemeID: new FormControl(undefined), + Name: new FormControl(undefined), + LogoUrl: new FormControl(undefined), + Type: new FormControl(undefined), + SortOrder: new FormControl(undefined), + CreatedDateUTC: new FormControl(undefined), + }); + + } + + export enum BrandingThemeType { INVOICE = 0 } + + + /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ + export interface Balances { + AccountsReceivable?: AccountsReceivable; + AccountsPayable?: AccountsPayable; + } + + /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ + export interface BalancesFormProperties { + } + export function CreateBalancesFormGroup() { + return new FormGroup({ + }); + + } + + export interface AccountsReceivable { + + /** Type: double */ + Outstanding?: number | null; + + /** Type: double */ + Overdue?: number | null; + } + export interface AccountsReceivableFormProperties { + + /** Type: double */ + Outstanding: FormControl, + + /** Type: double */ + Overdue: FormControl, + } + export function CreateAccountsReceivableFormGroup() { + return new FormGroup({ + Outstanding: new FormControl(undefined), + Overdue: new FormControl(undefined), + }); + + } + + export interface AccountsPayable { + + /** Type: double */ + Outstanding?: number | null; + + /** Type: double */ + Overdue?: number | null; + } + export interface AccountsPayableFormProperties { + + /** Type: double */ + Outstanding: FormControl, + + /** Type: double */ + Overdue: FormControl, + } + export function CreateAccountsPayableFormGroup() { + return new FormGroup({ + Outstanding: new FormControl(undefined), + Overdue: new FormControl(undefined), + }); + + } + + export interface LineItem { + + /** LineItem unique ID */ + LineItemID?: string | null; + + /** Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character */ + Description?: string | null; + + /** + * LineItem Quantity + * Type: double + */ + Quantity?: number | null; + + /** + * LineItem Unit Amount + * Type: double + */ + UnitAmount?: number | null; + + /** See Items */ + ItemCode?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** + * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. + * Type: double + */ + TaxAmount?: number | null; + + /** + * If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 � DiscountRate)/100) + * Type: double + */ + LineAmount?: number | null; + + /** Optional Tracking Category � see Tracking. Any LineItem can have a maximum of 2 elements. */ + Tracking?: Array; + + /** + * Percentage discount being applied to a line item (only supported on ACCREC invoices � ACC PAY invoices and credit notes in Xero do not support discounts + * Type: double + */ + DiscountRate?: number | null; + + /** + * Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. + * Type: double + */ + DiscountAmount?: number | null; + + /** The Xero identifier for a Repeating Invoice */ + RepeatingInvoiceID?: string | null; + } + export interface LineItemFormProperties { + + /** LineItem unique ID */ + LineItemID: FormControl, + + /** Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character */ + Description: FormControl, + + /** + * LineItem Quantity + * Type: double + */ + Quantity: FormControl, + + /** + * LineItem Unit Amount + * Type: double + */ + UnitAmount: FormControl, + + /** See Items */ + ItemCode: FormControl, + + /** See Accounts */ + AccountCode: FormControl, + + /** The tax type from TaxRates */ + TaxType: FormControl, + + /** + * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. + * Type: double + */ + TaxAmount: FormControl, + + /** + * If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 � DiscountRate)/100) + * Type: double + */ + LineAmount: FormControl, + + /** + * Percentage discount being applied to a line item (only supported on ACCREC invoices � ACC PAY invoices and credit notes in Xero do not support discounts + * Type: double + */ + DiscountRate: FormControl, + + /** + * Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. + * Type: double + */ + DiscountAmount: FormControl, + + /** The Xero identifier for a Repeating Invoice */ + RepeatingInvoiceID: FormControl, + } + export function CreateLineItemFormGroup() { + return new FormGroup({ + LineItemID: new FormControl(undefined), + Description: new FormControl(undefined), + Quantity: new FormControl(undefined), + UnitAmount: new FormControl(undefined), + ItemCode: new FormControl(undefined), + AccountCode: new FormControl(undefined), + TaxType: new FormControl(undefined), + TaxAmount: new FormControl(undefined), + LineAmount: new FormControl(undefined), + DiscountRate: new FormControl(undefined), + DiscountAmount: new FormControl(undefined), + RepeatingInvoiceID: new FormControl(undefined), + }); + + } + + export interface LineItemTracking { + + /** The Xero identifier for a tracking category */ + TrackingCategoryID?: string | null; + + /** The Xero identifier for a tracking category option */ + TrackingOptionID?: string | null; + + /** + * The name of the tracking category + * Max length: 100 + */ + Name?: string | null; + + /** See Tracking Options */ + Option?: string | null; + } + export interface LineItemTrackingFormProperties { + + /** The Xero identifier for a tracking category */ + TrackingCategoryID: FormControl, + + /** The Xero identifier for a tracking category option */ + TrackingOptionID: FormControl, + + /** + * The name of the tracking category + * Max length: 100 + */ + Name: FormControl, + + /** See Tracking Options */ + Option: FormControl, + } + export function CreateLineItemTrackingFormGroup() { + return new FormGroup({ + TrackingCategoryID: new FormControl(undefined), + TrackingOptionID: new FormControl(undefined), + Name: new FormControl(undefined, [Validators.maxLength(100)]), + Option: new FormControl(undefined), + }); + + } + + export enum BankTransactionStatus { AUTHORISED = 0, DELETED = 1, VOIDED = 2 } + + export enum BankTransactionLineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } + + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + export enum LineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } + + export interface BankTransfers { + BankTransfers1?: Array; + } + export interface BankTransfersFormProperties { + } + export function CreateBankTransfersFormGroup() { + return new FormGroup({ + }); + + } + + export interface BankTransfer { + + /** Required */ + FromBankAccount: Account; + + /** Required */ + ToBankAccount: Account; + + /** + * amount of the transaction + * Required + * Type: double + */ + Amount: number; + + /** + * The date of the Transfer YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** The identifier of the Bank Transfer */ + BankTransferID?: string | null; + + /** + * The currency rate + * Type: double + */ + CurrencyRate?: number | null; + + /** The Bank Transaction ID for the source account */ + FromBankTransactionID?: string | null; + + /** The Bank Transaction ID for the destination account */ + ToBankTransactionID?: string | null; + + /** Boolean to indicate if a Bank Transfer has an attachment */ + HasAttachments?: boolean | null; + + /** UTC timestamp of creation date of bank transfer */ + CreatedDateUTC?: Date | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface BankTransferFormProperties { + + /** + * amount of the transaction + * Required + * Type: double + */ + Amount: FormControl, + + /** + * The date of the Transfer YYYY-MM-DD + * Type: DateOnly + */ + Date: FormControl, + + /** The identifier of the Bank Transfer */ + BankTransferID: FormControl, + + /** + * The currency rate + * Type: double + */ + CurrencyRate: FormControl, + + /** The Bank Transaction ID for the source account */ + FromBankTransactionID: FormControl, + + /** The Bank Transaction ID for the destination account */ + ToBankTransactionID: FormControl, + + /** Boolean to indicate if a Bank Transfer has an attachment */ + HasAttachments: FormControl, + + /** UTC timestamp of creation date of bank transfer */ + CreatedDateUTC: FormControl, + } + export function CreateBankTransferFormGroup() { + return new FormGroup({ + Amount: new FormControl(undefined, [Validators.required]), + Date: CreateDateOnlyFormControl(), + BankTransferID: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + FromBankTransactionID: new FormControl(undefined), + ToBankTransactionID: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + CreatedDateUTC: new FormControl(undefined), + }); + + } + + export interface BatchPayments { + BatchPayments1?: Array; + } + export interface BatchPaymentsFormProperties { + } + export function CreateBatchPaymentsFormGroup() { + return new FormGroup({ + }); + + } + + export interface BatchPayment { + Account?: Account; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Reference?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Particulars?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Code?: string | null; + + /** + * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * Max length: 18 + */ + Details?: string | null; + + /** + * (UK Only) Only shows on the statement line in Xero. Max length =18 + * Max length: 18 + */ + Narrative?: string | null; + + /** The Xero generated unique identifier for the bank transaction (read-only) */ + BatchPaymentID?: string | null; + + /** Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 */ + DateString?: string | null; + + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * Type: DateOnly + */ + Date?: Date | null; + + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * Type: double + */ + Amount?: number | null; + Payments?: Array; + + /** PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) */ + Type?: BatchPaymentType | null; + + /** AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. */ + Status?: PaymentStatus | null; + + /** The total of the payments that make up the batch (read-only) */ + TotalAmount?: string | null; + + /** UTC timestamp of last update to the payment */ + UpdatedDateUTC?: Date | null; + + /** Booelan that tells you if the batch payment has been reconciled (read-only) */ + IsReconciled?: string | null; + } + export interface BatchPaymentFormProperties { + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Reference: FormControl, + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Particulars: FormControl, + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Code: FormControl, + + /** + * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * Max length: 18 + */ + Details: FormControl, + + /** + * (UK Only) Only shows on the statement line in Xero. Max length =18 + * Max length: 18 + */ + Narrative: FormControl, + + /** The Xero generated unique identifier for the bank transaction (read-only) */ + BatchPaymentID: FormControl, + + /** Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 */ + DateString: FormControl, + + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * Type: DateOnly + */ + Date: FormControl, + + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * Type: double + */ + Amount: FormControl, + + /** PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) */ + Type: FormControl, + + /** AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. */ + Status: FormControl, + + /** The total of the payments that make up the batch (read-only) */ + TotalAmount: FormControl, + + /** UTC timestamp of last update to the payment */ + UpdatedDateUTC: FormControl, + + /** Booelan that tells you if the batch payment has been reconciled (read-only) */ + IsReconciled: FormControl, + } + export function CreateBatchPaymentFormGroup() { + return new FormGroup({ + Reference: new FormControl(undefined, [Validators.maxLength(12)]), + Particulars: new FormControl(undefined, [Validators.maxLength(12)]), + Code: new FormControl(undefined, [Validators.maxLength(12)]), + Details: new FormControl(undefined, [Validators.maxLength(18)]), + Narrative: new FormControl(undefined, [Validators.maxLength(18)]), + BatchPaymentID: new FormControl(undefined), + DateString: new FormControl(undefined), + Date: CreateDateOnlyFormControl(), + Amount: new FormControl(undefined), + Type: new FormControl(undefined), + Status: new FormControl(undefined), + TotalAmount: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + IsReconciled: new FormControl(undefined), + }); + + } + + export interface Payment { + Invoice?: Invoice; + CreditNote?: CreditNote; + Prepayment?: Prepayment; + Overpayment?: Overpayment; + + /** Number of invoice or credit note you are applying payment to e.g.INV-4003 */ + InvoiceNumber?: string | null; + + /** Number of invoice or credit note you are applying payment to e.g. INV-4003 */ + CreditNoteNumber?: string | null; + Account?: Account; + + /** Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) */ + Code?: string | null; + + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * Type: DateOnly + */ + Date?: Date | null; + + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * Type: double + */ + Amount?: number | null; + + /** An optional description for the payment e.g. Direct Debit */ + Reference?: string | null; + + /** An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET */ + IsReconciled?: boolean | null; + + /** The status of the payment. */ + Status?: PaymentStatus | null; + + /** See Payment Types. */ + PaymentType?: PaymentPaymentType | null; + + /** UTC timestamp of last update to the payment */ + UpdatedDateUTC?: Date | null; + + /** The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + PaymentID?: string | null; + + /** The suppliers bank account number the payment is being made to */ + BankAccountNumber?: string | null; + + /** The suppliers bank account number the payment is being made to */ + Particulars?: string | null; + + /** The information to appear on the supplier's bank account */ + Details?: string | null; + + /** A boolean to indicate if a contact has an validation errors */ + HasAccount?: boolean | null; + + /** A boolean to indicate if a contact has an validation errors */ + HasValidationErrors?: boolean | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface PaymentFormProperties { + + /** Number of invoice or credit note you are applying payment to e.g.INV-4003 */ + InvoiceNumber: FormControl, + + /** Number of invoice or credit note you are applying payment to e.g. INV-4003 */ + CreditNoteNumber: FormControl, + + /** Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) */ + Code: FormControl, + + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * Type: DateOnly + */ + Date: FormControl, + + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + * Type: double + */ + CurrencyRate: FormControl, + + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * Type: double + */ + Amount: FormControl, + + /** An optional description for the payment e.g. Direct Debit */ + Reference: FormControl, + + /** An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET */ + IsReconciled: FormControl, + + /** The status of the payment. */ + Status: FormControl, + + /** See Payment Types. */ + PaymentType: FormControl, + + /** UTC timestamp of last update to the payment */ + UpdatedDateUTC: FormControl, + + /** The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + PaymentID: FormControl, + + /** The suppliers bank account number the payment is being made to */ + BankAccountNumber: FormControl, + + /** The suppliers bank account number the payment is being made to */ + Particulars: FormControl, + + /** The information to appear on the supplier's bank account */ + Details: FormControl, + + /** A boolean to indicate if a contact has an validation errors */ + HasAccount: FormControl, + + /** A boolean to indicate if a contact has an validation errors */ + HasValidationErrors: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreatePaymentFormGroup() { + return new FormGroup({ + InvoiceNumber: new FormControl(undefined), + CreditNoteNumber: new FormControl(undefined), + Code: new FormControl(undefined), + Date: CreateDateOnlyFormControl(), + CurrencyRate: new FormControl(undefined), + Amount: new FormControl(undefined), + Reference: new FormControl(undefined), + IsReconciled: new FormControl(undefined), + Status: new FormControl(undefined), + PaymentType: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + PaymentID: new FormControl(undefined), + BankAccountNumber: new FormControl(undefined), + Particulars: new FormControl(undefined), + Details: new FormControl(undefined), + HasAccount: new FormControl(undefined), + HasValidationErrors: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export interface Invoice { + + /** See Invoice Types */ + Type?: InvoiceType | null; + Contact?: Contact; + + /** See LineItems */ + LineItems?: Array; + + /** + * Date invoice was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** + * Date invoice is due � YYYY-MM-DD + * Type: DateOnly + */ + DueDate?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** + * ACCREC � Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) + * Max length: 255 + */ + InvoiceNumber?: string | null; + + /** + * ACCREC only � additional reference number (max length = 255) + * Max length: 255 + */ + Reference?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ + Url?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) + * Type: double + */ + CurrencyRate?: number | null; + + /** See Invoice Status Codes */ + Status?: InvoiceStatus | null; + + /** Boolean to set whether the invoice in the Xero app should be marked as �sent�. This can be set only on invoices that have been approved */ + SentToContact?: boolean | null; + + /** + * Shown on sales invoices (Accounts Receivable) when this has been set + * Type: DateOnly + */ + ExpectedPaymentDate?: Date | null; + + /** + * Shown on bills (Accounts Payable) when this has been set + * Type: DateOnly + */ + PlannedPaymentDate?: Date | null; + + /** + * CIS deduction for UK contractors + * Type: double + */ + CISDeduction?: number | null; + + /** + * Total of invoice excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on invoice + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts + * Type: double + */ + Total?: number | null; + + /** + * Total of discounts applied on the invoice line items + * Type: double + */ + TotalDiscount?: number | null; + + /** Xero generated unique identifier for invoice */ + InvoiceID?: string | null; + + /** boolean to indicate if an invoice has an attachment */ + HasAttachments?: boolean | null; + + /** boolean to indicate if an invoice has a discount */ + IsDiscounted?: boolean | null; + + /** See Payments */ + Payments?: Array; + + /** See Prepayments */ + Prepayments?: Array; + + /** See Overpayments */ + Overpayments?: Array; + + /** + * Amount remaining to be paid on invoice + * Type: double + */ + AmountDue?: number | null; + + /** + * Sum of payments received for invoice + * Type: double + */ + AmountPaid?: number | null; + + /** + * The date the invoice was fully paid. Only returned on fully paid invoices + * Type: DateOnly + */ + FullyPaidOnDate?: Date | null; + + /** + * Sum of all credit notes, over-payments and pre-payments applied to invoice + * Type: double + */ + AmountCredited?: number | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Details of credit notes that have been applied to an invoice */ + CreditNotes?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + + /** A boolean to indicate if a invoice has an validation errors */ + HasErrors?: boolean | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + } + export interface InvoiceFormProperties { + + /** See Invoice Types */ + Type: FormControl, + + /** + * Date invoice was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date: FormControl, + + /** + * Date invoice is due � YYYY-MM-DD + * Type: DateOnly + */ + DueDate: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** + * ACCREC � Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) + * Max length: 255 + */ + InvoiceNumber: FormControl, + + /** + * ACCREC only � additional reference number (max length = 255) + * Max length: 255 + */ + Reference: FormControl, + + /** See BrandingThemes */ + BrandingThemeID: FormControl, + + /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ + Url: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) + * Type: double + */ + CurrencyRate: FormControl, + + /** See Invoice Status Codes */ + Status: FormControl, + + /** Boolean to set whether the invoice in the Xero app should be marked as �sent�. This can be set only on invoices that have been approved */ + SentToContact: FormControl, + + /** + * Shown on sales invoices (Accounts Receivable) when this has been set + * Type: DateOnly + */ + ExpectedPaymentDate: FormControl, + + /** + * Shown on bills (Accounts Payable) when this has been set + * Type: DateOnly + */ + PlannedPaymentDate: FormControl, + + /** + * CIS deduction for UK contractors + * Type: double + */ + CISDeduction: FormControl, + + /** + * Total of invoice excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * Total tax on invoice + * Type: double + */ + TotalTax: FormControl, + + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts + * Type: double + */ + Total: FormControl, + + /** + * Total of discounts applied on the invoice line items + * Type: double + */ + TotalDiscount: FormControl, + + /** Xero generated unique identifier for invoice */ + InvoiceID: FormControl, + + /** boolean to indicate if an invoice has an attachment */ + HasAttachments: FormControl, + + /** boolean to indicate if an invoice has a discount */ + IsDiscounted: FormControl, + + /** + * Amount remaining to be paid on invoice + * Type: double + */ + AmountDue: FormControl, + + /** + * Sum of payments received for invoice + * Type: double + */ + AmountPaid: FormControl, + + /** + * The date the invoice was fully paid. Only returned on fully paid invoices + * Type: DateOnly + */ + FullyPaidOnDate: FormControl, + + /** + * Sum of all credit notes, over-payments and pre-payments applied to invoice + * Type: double + */ + AmountCredited: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** A boolean to indicate if a invoice has an validation errors */ + HasErrors: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreateInvoiceFormGroup() { + return new FormGroup({ + Type: new FormControl(undefined), + Date: CreateDateOnlyFormControl(), + DueDate: CreateDateOnlyFormControl(), + LineAmountTypes: new FormControl(undefined), + InvoiceNumber: new FormControl(undefined, [Validators.maxLength(255)]), + Reference: new FormControl(undefined, [Validators.maxLength(255)]), + BrandingThemeID: new FormControl(undefined), + Url: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + Status: new FormControl(undefined), + SentToContact: new FormControl(undefined), + ExpectedPaymentDate: CreateDateOnlyFormControl(), + PlannedPaymentDate: CreateDateOnlyFormControl(), + CISDeduction: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + TotalDiscount: new FormControl(undefined), + InvoiceID: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + IsDiscounted: new FormControl(undefined), + AmountDue: new FormControl(undefined), + AmountPaid: new FormControl(undefined), + FullyPaidOnDate: CreateDateOnlyFormControl(), + AmountCredited: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + HasErrors: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export enum InvoiceType { ACCPAY = 0, ACCPAYCREDIT = 1, APOVERPAYMENT = 2, APPREPAYMENT = 3, ACCREC = 4, ACCRECCREDIT = 5, AROVERPAYMENT = 6, ARPREPAYMENT = 7 } + + export enum InvoiceStatus { DRAFT = 0, SUBMITTED = 1, DELETED = 2, AUTHORISED = 3, PAID = 4, VOIDED = 5 } + + export interface Prepayment { + + /** See Prepayment Types */ + Type?: PrepaymentType | null; + Contact?: Contact; + + /** + * The date the prepayment is created YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** See Prepayment Status Codes */ + Status?: PrepaymentStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Prepayment Line Items */ + LineItems?: Array; + + /** + * The subtotal of the prepayment excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * The total tax on the prepayment + * Type: double + */ + TotalTax?: number | null; + + /** + * The total of the prepayment(subtotal + total tax) + * Type: double + */ + Total?: number | null; + + /** Returns Invoice number field. Reference field isn't available. */ + Reference?: string | null; + + /** UTC timestamp of last update to the prepayment */ + UpdatedDateUTC?: Date | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** Xero generated unique identifier */ + PrepaymentID?: string | null; + + /** + * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The remaining credit balance on the prepayment + * Type: double + */ + RemainingCredit?: number | null; + + /** See Allocations */ + Allocations?: Array; + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount?: number | null; + + /** boolean to indicate if a prepayment has an attachment */ + HasAttachments?: boolean | null; + + /** See Attachments */ + Attachments?: Array; + } + export interface PrepaymentFormProperties { + + /** See Prepayment Types */ + Type: FormControl, + + /** + * The date the prepayment is created YYYY-MM-DD + * Type: DateOnly + */ + Date: FormControl, + + /** See Prepayment Status Codes */ + Status: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** + * The subtotal of the prepayment excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * The total tax on the prepayment + * Type: double + */ + TotalTax: FormControl, + + /** + * The total of the prepayment(subtotal + total tax) + * Type: double + */ + Total: FormControl, + + /** Returns Invoice number field. Reference field isn't available. */ + Reference: FormControl, + + /** UTC timestamp of last update to the prepayment */ + UpdatedDateUTC: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** Xero generated unique identifier */ + PrepaymentID: FormControl, + + /** + * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate: FormControl, + + /** + * The remaining credit balance on the prepayment + * Type: double + */ + RemainingCredit: FormControl, + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount: FormControl, + + /** boolean to indicate if a prepayment has an attachment */ + HasAttachments: FormControl, + } + export function CreatePrepaymentFormGroup() { + return new FormGroup({ + Type: new FormControl(undefined), + Date: CreateDateOnlyFormControl(), + Status: new FormControl(undefined), + LineAmountTypes: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + Reference: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + PrepaymentID: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + RemainingCredit: new FormControl(undefined), + AppliedAmount: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + }); + + } + + export enum PrepaymentType { 'RECEIVE-PREPAYMENT' = 0, 'SPEND-PREPAYMENT' = 1, ARPREPAYMENT = 2, APPREPAYMENT = 3 } + + export enum PrepaymentStatus { AUTHORISED = 0, PAID = 1, VOIDED = 2 } + + export interface Allocation { + + /** Required */ + Invoice: Invoice; + Overpayment?: Overpayment; + Prepayment?: Prepayment; + CreditNote?: CreditNote; + + /** + * the amount being applied to the invoice + * Required + * Type: double + */ + Amount: number; + + /** + * the date the allocation is applied YYYY-MM-DD. + * Required + * Type: DateOnly + */ + Date: Date; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface AllocationFormProperties { + + /** + * the amount being applied to the invoice + * Required + * Type: double + */ + Amount: FormControl, + + /** + * the date the allocation is applied YYYY-MM-DD. + * Required + * Type: DateOnly + */ + Date: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreateAllocationFormGroup() { + return new FormGroup({ + Amount: new FormControl(undefined, [Validators.required]), + Date: CreateDateOnlyFormControl(), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export interface Overpayment { + + /** See Overpayment Types */ + Type?: OverpaymentType | null; + Contact?: Contact; + + /** + * The date the overpayment is created YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** See Overpayment Status Codes */ + Status?: PrepaymentStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Overpayment Line Items */ + LineItems?: Array; + + /** + * The subtotal of the overpayment excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * The total tax on the overpayment + * Type: double + */ + TotalTax?: number | null; + + /** + * The total of the overpayment (subtotal + total tax) + * Type: double + */ + Total?: number | null; + + /** UTC timestamp of last update to the overpayment */ + UpdatedDateUTC?: Date | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** Xero generated unique identifier */ + OverpaymentID?: string | null; + + /** + * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The remaining credit balance on the overpayment + * Type: double + */ + RemainingCredit?: number | null; + + /** See Allocations */ + Allocations?: Array; + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount?: number | null; + + /** See Payments */ + Payments?: Array; + + /** boolean to indicate if a overpayment has an attachment */ + HasAttachments?: boolean | null; + + /** See Attachments */ + Attachments?: Array; + } + export interface OverpaymentFormProperties { + + /** See Overpayment Types */ + Type: FormControl, + + /** + * The date the overpayment is created YYYY-MM-DD + * Type: DateOnly + */ + Date: FormControl, + + /** See Overpayment Status Codes */ + Status: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** + * The subtotal of the overpayment excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * The total tax on the overpayment + * Type: double + */ + TotalTax: FormControl, + + /** + * The total of the overpayment (subtotal + total tax) + * Type: double + */ + Total: FormControl, + + /** UTC timestamp of last update to the overpayment */ + UpdatedDateUTC: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** Xero generated unique identifier */ + OverpaymentID: FormControl, + + /** + * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate: FormControl, + + /** + * The remaining credit balance on the overpayment + * Type: double + */ + RemainingCredit: FormControl, + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount: FormControl, + + /** boolean to indicate if a overpayment has an attachment */ + HasAttachments: FormControl, + } + export function CreateOverpaymentFormGroup() { + return new FormGroup({ + Type: new FormControl(undefined), + Date: CreateDateOnlyFormControl(), + Status: new FormControl(undefined), + LineAmountTypes: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + OverpaymentID: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + RemainingCredit: new FormControl(undefined), + AppliedAmount: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + }); + + } + + export enum OverpaymentType { 'RECEIVE-OVERPAYMENT' = 0, 'SPEND-OVERPAYMENT' = 1, AROVERPAYMENT = 2 } + + export interface CreditNote { + + /** See Credit Note Types */ + Type?: CreditNoteType | null; + Contact?: Contact; + + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** See Credit Note Status Codes */ + Status?: InvoiceStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Invoice Line Items */ + LineItems?: Array; + + /** + * The subtotal of the credit note excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * The total tax on the credit note + * Type: double + */ + TotalTax?: number | null; + + /** + * The total of the Credit Note(subtotal + total tax) + * Type: double + */ + Total?: number | null; + + /** UTC timestamp of last update to the credit note */ + UpdatedDateUTC?: Date | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * Date when credit note was fully paid(UTC format) + * Type: DateOnly + */ + FullyPaidOnDate?: Date | null; + + /** Xero generated unique identifier */ + CreditNoteID?: string | null; + + /** ACCRECCREDIT � Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) */ + CreditNoteNumber?: string | null; + + /** ACCRECCREDIT only � additional reference number */ + Reference?: string | null; + + /** boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) */ + SentToContact?: boolean | null; + + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The remaining credit balance on the Credit Note + * Type: double + */ + RemainingCredit?: number | null; + + /** See Allocations */ + Allocations?: Array; + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount?: number | null; + + /** See Payments */ + Payments?: Array; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** boolean to indicate if a credit note has an attachment */ + HasAttachments?: boolean | null; + + /** A boolean to indicate if a credit note has an validation errors */ + HasErrors?: boolean | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface CreditNoteFormProperties { + + /** See Credit Note Types */ + Type: FormControl, + + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date: FormControl, + + /** See Credit Note Status Codes */ + Status: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** + * The subtotal of the credit note excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * The total tax on the credit note + * Type: double + */ + TotalTax: FormControl, + + /** + * The total of the Credit Note(subtotal + total tax) + * Type: double + */ + Total: FormControl, + + /** UTC timestamp of last update to the credit note */ + UpdatedDateUTC: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** + * Date when credit note was fully paid(UTC format) + * Type: DateOnly + */ + FullyPaidOnDate: FormControl, + + /** Xero generated unique identifier */ + CreditNoteID: FormControl, + + /** ACCRECCREDIT � Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) */ + CreditNoteNumber: FormControl, + + /** ACCRECCREDIT only � additional reference number */ + Reference: FormControl, + + /** boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) */ + SentToContact: FormControl, + + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate: FormControl, + + /** + * The remaining credit balance on the Credit Note + * Type: double + */ + RemainingCredit: FormControl, + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount: FormControl, + + /** See BrandingThemes */ + BrandingThemeID: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + + /** boolean to indicate if a credit note has an attachment */ + HasAttachments: FormControl, + + /** A boolean to indicate if a credit note has an validation errors */ + HasErrors: FormControl, + } + export function CreateCreditNoteFormGroup() { + return new FormGroup({ + Type: new FormControl(undefined), + Date: CreateDateOnlyFormControl(), + Status: new FormControl(undefined), + LineAmountTypes: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + FullyPaidOnDate: CreateDateOnlyFormControl(), + CreditNoteID: new FormControl(undefined), + CreditNoteNumber: new FormControl(undefined), + Reference: new FormControl(undefined), + SentToContact: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + RemainingCredit: new FormControl(undefined), + AppliedAmount: new FormControl(undefined), + BrandingThemeID: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + HasErrors: new FormControl(undefined), + }); + + } + + export enum CreditNoteType { ACCPAYCREDIT = 0, ACCRECCREDIT = 1 } + + export enum PaymentStatus { AUTHORISED = 0, DELETED = 1 } + + export enum PaymentPaymentType { ACCRECPAYMENT = 0, ACCPAYPAYMENT = 1, ARCREDITPAYMENT = 2, APCREDITPAYMENT = 3, AROVERPAYMENTPAYMENT = 4, ARPREPAYMENTPAYMENT = 5, APPREPAYMENTPAYMENT = 6, APOVERPAYMENTPAYMENT = 7 } + + export enum BatchPaymentType { PAYBATCH = 0, RECBATCH = 1 } + + + /** Bank details for use on a batch payment stored with each contact */ + export interface BatchPaymentDetails { + + /** Bank account number for use with Batch Payments */ + BankAccountNumber?: string | null; + + /** Name of bank for use with Batch Payments */ + BankAccountName?: string | null; + + /** + * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * Max length: 18 + */ + Details?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Code?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Reference?: string | null; + } + + /** Bank details for use on a batch payment stored with each contact */ + export interface BatchPaymentDetailsFormProperties { + + /** Bank account number for use with Batch Payments */ + BankAccountNumber: FormControl, + + /** Name of bank for use with Batch Payments */ + BankAccountName: FormControl, + + /** + * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * Max length: 18 + */ + Details: FormControl, + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Code: FormControl, + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Reference: FormControl, + } + export function CreateBatchPaymentDetailsFormGroup() { + return new FormGroup({ + BankAccountNumber: new FormControl(undefined), + BankAccountName: new FormControl(undefined), + Details: new FormControl(undefined, [Validators.maxLength(18)]), + Code: new FormControl(undefined, [Validators.maxLength(12)]), + Reference: new FormControl(undefined, [Validators.maxLength(12)]), + }); + + } + + export interface BrandingThemes { + BrandingThemes1?: Array; + } + export interface BrandingThemesFormProperties { + } + export function CreateBrandingThemesFormGroup() { + return new FormGroup({ + }); + + } + + export interface PaymentServices { + PaymentServices1?: Array; + } + export interface PaymentServicesFormProperties { + } + export function CreatePaymentServicesFormGroup() { + return new FormGroup({ + }); + + } + + export interface PaymentService { + + /** Xero identifier */ + PaymentServiceID?: string | null; + + /** Name of payment service */ + PaymentServiceName?: string | null; + + /** The custom payment URL */ + PaymentServiceUrl?: string | null; + + /** The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card */ + PayNowText?: string | null; + + /** This will always be CUSTOM for payment services created via the API. */ + PaymentServiceType?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface PaymentServiceFormProperties { + + /** Xero identifier */ + PaymentServiceID: FormControl, + + /** Name of payment service */ + PaymentServiceName: FormControl, + + /** The custom payment URL */ + PaymentServiceUrl: FormControl, + + /** The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card */ + PayNowText: FormControl, + + /** This will always be CUSTOM for payment services created via the API. */ + PaymentServiceType: FormControl, + } + export function CreatePaymentServiceFormGroup() { + return new FormGroup({ + PaymentServiceID: new FormControl(undefined), + PaymentServiceName: new FormControl(undefined), + PaymentServiceUrl: new FormControl(undefined), + PayNowText: new FormControl(undefined), + PaymentServiceType: new FormControl(undefined), + }); + + } + + export interface Contacts { + Contacts1?: Array; + } + export interface ContactsFormProperties { + } + export function CreateContactsFormGroup() { + return new FormGroup({ + }); + + } + + export interface CISSettings { + CISSettings1?: Array; + } + export interface CISSettingsFormProperties { + } + export function CreateCISSettingsFormGroup() { + return new FormGroup({ + }); + + } + + export interface CISSetting { + + /** Boolean that describes if the contact is a CIS Subcontractor */ + CISEnabled?: boolean | null; + + /** + * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Rate?: number | null; + } + export interface CISSettingFormProperties { + + /** Boolean that describes if the contact is a CIS Subcontractor */ + CISEnabled: FormControl, + + /** + * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Rate: FormControl, + } + export function CreateCISSettingFormGroup() { + return new FormGroup({ + CISEnabled: new FormControl(undefined), + Rate: new FormControl(undefined), + }); + + } + + export interface CISOrgSetting { + + /** true or false - Boolean that describes if the organisation is a CIS Contractor */ + CISContractorEnabled?: boolean | null; + + /** true or false - Boolean that describes if the organisation is a CIS SubContractor */ + CISSubContractorEnabled?: boolean | null; + + /** + * CIS Deduction rate for the organisation + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Rate?: number | null; + } + export interface CISOrgSettingFormProperties { + + /** true or false - Boolean that describes if the organisation is a CIS Contractor */ + CISContractorEnabled: FormControl, + + /** true or false - Boolean that describes if the organisation is a CIS SubContractor */ + CISSubContractorEnabled: FormControl, + + /** + * CIS Deduction rate for the organisation + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Rate: FormControl, + } + export function CreateCISOrgSettingFormGroup() { + return new FormGroup({ + CISContractorEnabled: new FormControl(undefined), + CISSubContractorEnabled: new FormControl(undefined), + Rate: new FormControl(undefined), + }); + + } + + export interface ContactGroups { + ContactGroups1?: Array; + } + export interface ContactGroupsFormProperties { + } + export function CreateContactGroupsFormGroup() { + return new FormGroup({ + }); + + } + + export interface RequestEmpty { + + /** Need at least one field to create an empty JSON payload */ + Status?: string | null; + } + export interface RequestEmptyFormProperties { + + /** Need at least one field to create an empty JSON payload */ + Status: FormControl, + } + export function CreateRequestEmptyFormGroup() { + return new FormGroup({ + Status: new FormControl(undefined), + }); + + } + + export interface CreditNotes { + CreditNotes1?: Array; + } + export interface CreditNotesFormProperties { + } + export function CreateCreditNotesFormGroup() { + return new FormGroup({ + }); + + } + + export interface Allocations { + Allocations1?: Array; + } + export interface AllocationsFormProperties { + } + export function CreateAllocationsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Currencies { + Currencies1?: Array; + } + export interface CurrenciesFormProperties { + } + export function CreateCurrenciesFormGroup() { + return new FormGroup({ + }); + + } + + export interface Currency { + + /** 3 letter alpha code for the currency � see list of currency codes */ + Code?: AccountCurrencyCode | null; + + /** Name of Currency */ + Description?: string | null; + } + export interface CurrencyFormProperties { + + /** 3 letter alpha code for the currency � see list of currency codes */ + Code: FormControl, + + /** Name of Currency */ + Description: FormControl, + } + export function CreateCurrencyFormGroup() { + return new FormGroup({ + Code: new FormControl(undefined), + Description: new FormControl(undefined), + }); + + } + + + /** 3 letter alpha code for the currency � see list of currency codes */ + export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + export interface Employees { + Employees1?: Array; + } + export interface EmployeesFormProperties { + } + export function CreateEmployeesFormGroup() { + return new FormGroup({ + }); + + } + + export interface Employee { + + /** The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + EmployeeID?: string | null; + + /** Current status of an employee � see contact status types */ + Status?: ContactContactStatus | null; + + /** + * First name of an employee (max length = 255) + * Max length: 255 + */ + FirstName?: string | null; + + /** + * Last name of an employee (max length = 255) + * Max length: 255 + */ + LastName?: string | null; + ExternalLink?: ExternalLink; + UpdatedDateUTC?: Date | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface EmployeeFormProperties { + + /** The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + EmployeeID: FormControl, + + /** Current status of an employee � see contact status types */ + Status: FormControl, + + /** + * First name of an employee (max length = 255) + * Max length: 255 + */ + FirstName: FormControl, + + /** + * Last name of an employee (max length = 255) + * Max length: 255 + */ + LastName: FormControl, + UpdatedDateUTC: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreateEmployeeFormGroup() { + return new FormGroup({ + EmployeeID: new FormControl(undefined), + Status: new FormControl(undefined), + FirstName: new FormControl(undefined, [Validators.maxLength(255)]), + LastName: new FormControl(undefined, [Validators.maxLength(255)]), + UpdatedDateUTC: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export interface ExternalLink { + + /** See External link types */ + LinkType?: ExternalLinkLinkType | null; + + /** URL for service e.g. http://twitter.com/xeroapi */ + Url?: string | null; + Description?: string | null; + } + export interface ExternalLinkFormProperties { + + /** See External link types */ + LinkType: FormControl, + + /** URL for service e.g. http://twitter.com/xeroapi */ + Url: FormControl, + Description: FormControl, + } + export function CreateExternalLinkFormGroup() { + return new FormGroup({ + LinkType: new FormControl(undefined), + Url: new FormControl(undefined), + Description: new FormControl(undefined), + }); + + } + + export enum ExternalLinkLinkType { Facebook = 0, GooglePlus = 1, LinkedIn = 2, Twitter = 3, Website = 4 } + + export interface ExpenseClaims { + ExpenseClaims1?: Array; + } + export interface ExpenseClaimsFormProperties { + } + export function CreateExpenseClaimsFormGroup() { + return new FormGroup({ + }); + + } + + export interface ExpenseClaim { + + /** Xero generated unique identifier for an expense claim */ + ExpenseClaimID?: string | null; + + /** Current status of an expense claim � see status types */ + Status?: ExpenseClaimStatus | null; + + /** See Payments */ + Payments?: Array; + User?: User; + Receipts?: Array; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** + * The total of an expense claim being paid + * Type: double + */ + Total?: number | null; + + /** + * The amount due to be paid for an expense claim + * Type: double + */ + AmountDue?: number | null; + + /** + * The amount still to pay for an expense claim + * Type: double + */ + AmountPaid?: number | null; + + /** + * The date when the expense claim is due to be paid YYYY-MM-DD + * Type: DateOnly + */ + PaymentDueDate?: Date | null; + + /** + * The date the expense claim will be reported in Xero YYYY-MM-DD + * Type: DateOnly + */ + ReportingDate?: Date | null; + + /** The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 */ + ReceiptID?: string | null; + } + export interface ExpenseClaimFormProperties { + + /** Xero generated unique identifier for an expense claim */ + ExpenseClaimID: FormControl, + + /** Current status of an expense claim � see status types */ + Status: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** + * The total of an expense claim being paid + * Type: double + */ + Total: FormControl, + + /** + * The amount due to be paid for an expense claim + * Type: double + */ + AmountDue: FormControl, + + /** + * The amount still to pay for an expense claim + * Type: double + */ + AmountPaid: FormControl, + + /** + * The date when the expense claim is due to be paid YYYY-MM-DD + * Type: DateOnly + */ + PaymentDueDate: FormControl, + + /** + * The date the expense claim will be reported in Xero YYYY-MM-DD + * Type: DateOnly + */ + ReportingDate: FormControl, + + /** The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 */ + ReceiptID: FormControl, + } + export function CreateExpenseClaimFormGroup() { + return new FormGroup({ + ExpenseClaimID: new FormControl(undefined), + Status: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + Total: new FormControl(undefined), + AmountDue: new FormControl(undefined), + AmountPaid: new FormControl(undefined), + PaymentDueDate: CreateDateOnlyFormControl(), + ReportingDate: CreateDateOnlyFormControl(), + ReceiptID: new FormControl(undefined), + }); + + } + + export enum ExpenseClaimStatus { SUBMITTED = 0, AUTHORISED = 1, PAID = 2, VOIDED = 3, DELETED = 4 } + + export interface User { + + /** Xero identifier */ + UserID?: string | null; + + /** Email address of user */ + EmailAddress?: string | null; + + /** First name of user */ + FirstName?: string | null; + + /** Last name of user */ + LastName?: string | null; + + /** Timestamp of last change to user */ + UpdatedDateUTC?: Date | null; + + /** Boolean to indicate if user is the subscriber */ + IsSubscriber?: boolean | null; + + /** User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) */ + OrganisationRole?: UserOrganisationRole | null; + } + export interface UserFormProperties { + + /** Xero identifier */ + UserID: FormControl, + + /** Email address of user */ + EmailAddress: FormControl, + + /** First name of user */ + FirstName: FormControl, + + /** Last name of user */ + LastName: FormControl, + + /** Timestamp of last change to user */ + UpdatedDateUTC: FormControl, + + /** Boolean to indicate if user is the subscriber */ + IsSubscriber: FormControl, + + /** User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) */ + OrganisationRole: FormControl, + } + export function CreateUserFormGroup() { + return new FormGroup({ + UserID: new FormControl(undefined), + EmailAddress: new FormControl(undefined), + FirstName: new FormControl(undefined), + LastName: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + IsSubscriber: new FormControl(undefined), + OrganisationRole: new FormControl(undefined), + }); + + } + + export enum UserOrganisationRole { READONLY = 0, INVOICEONLY = 1, STANDARD = 2, FINANCIALADVISER = 3, MANAGEDCLIENT = 4, CASHBOOKCLIENT = 5, UNKNOWN = 6 } + + export interface Receipt { + + /** + * Date of receipt � YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + Contact?: Contact; + LineItems?: Array; + User?: User; + + /** Additional reference number */ + Reference?: string | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** + * Total of receipt excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on receipt + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total?: number | null; + + /** Xero generated unique identifier for receipt */ + ReceiptID?: string | null; + + /** Current status of receipt � see status types */ + Status?: ReceiptStatus | null; + + /** Xero generated sequence number for receipt in current claim for a given user */ + ReceiptNumber?: string | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** boolean to indicate if a receipt has an attachment */ + HasAttachments?: boolean | null; + + /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ + Url?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + export interface ReceiptFormProperties { + + /** + * Date of receipt � YYYY-MM-DD + * Type: DateOnly + */ + Date: FormControl, + + /** Additional reference number */ + Reference: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** + * Total of receipt excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * Total tax on receipt + * Type: double + */ + TotalTax: FormControl, + + /** + * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total: FormControl, + + /** Xero generated unique identifier for receipt */ + ReceiptID: FormControl, + + /** Current status of receipt � see status types */ + Status: FormControl, + + /** Xero generated sequence number for receipt in current claim for a given user */ + ReceiptNumber: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** boolean to indicate if a receipt has an attachment */ + HasAttachments: FormControl, + + /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ + Url: FormControl, + } + export function CreateReceiptFormGroup() { + return new FormGroup({ + Date: CreateDateOnlyFormControl(), + Reference: new FormControl(undefined), + LineAmountTypes: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + ReceiptID: new FormControl(undefined), + Status: new FormControl(undefined), + ReceiptNumber: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + Url: new FormControl(undefined), + }); + + } + + export enum ReceiptStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, DECLINED = 3, VOIDED = 4 } + + export interface HistoryRecords { + HistoryRecords1?: Array; + } + export interface HistoryRecordsFormProperties { + } + export function CreateHistoryRecordsFormGroup() { + return new FormGroup({ + }); + + } + + export interface HistoryRecord { + + /** details */ + Details?: string | null; + + /** Name of branding theme */ + Changes?: string | null; + + /** has a value of 0 */ + User?: string | null; + + /** UTC timestamp of creation date of branding theme */ + DateUTC?: Date | null; + } + export interface HistoryRecordFormProperties { + + /** details */ + Details: FormControl, + + /** Name of branding theme */ + Changes: FormControl, + + /** has a value of 0 */ + User: FormControl, + + /** UTC timestamp of creation date of branding theme */ + DateUTC: FormControl, + } + export function CreateHistoryRecordFormGroup() { + return new FormGroup({ + Details: new FormControl(undefined), + Changes: new FormControl(undefined), + User: new FormControl(undefined), + DateUTC: new FormControl(undefined), + }); + + } + + export interface Invoices { + Invoices1?: Array; + } + export interface InvoicesFormProperties { + } + export function CreateInvoicesFormGroup() { + return new FormGroup({ + }); + + } + + export interface OnlineInvoices { + OnlineInvoices1?: Array; + } + export interface OnlineInvoicesFormProperties { + } + export function CreateOnlineInvoicesFormGroup() { + return new FormGroup({ + }); + + } + + export interface OnlineInvoice { + + /** the URL to an online invoice */ + OnlineInvoiceUrl?: string | null; + } + export interface OnlineInvoiceFormProperties { + + /** the URL to an online invoice */ + OnlineInvoiceUrl: FormControl, + } + export function CreateOnlineInvoiceFormGroup() { + return new FormGroup({ + OnlineInvoiceUrl: new FormControl(undefined), + }); + + } + + export interface InvoiceReminders { + InvoiceReminders1?: Array; + } + export interface InvoiceRemindersFormProperties { + } + export function CreateInvoiceRemindersFormGroup() { + return new FormGroup({ + }); + + } + + export interface InvoiceReminder { + + /** setting for on or off */ + Enabled?: boolean | null; + } + export interface InvoiceReminderFormProperties { + + /** setting for on or off */ + Enabled: FormControl, + } + export function CreateInvoiceReminderFormGroup() { + return new FormGroup({ + Enabled: new FormControl(undefined), + }); + + } + + export interface Items { + Items1?: Array; + } + export interface ItemsFormProperties { + } + export function CreateItemsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Item { + + /** + * User defined item code (max length = 30) + * Required + * Max length: 30 + */ + Code: string; + + /** The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item */ + InventoryAssetAccountCode?: string | null; + + /** + * The name of the item (max length = 50) + * Max length: 50 + */ + Name?: string | null; + + /** Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. */ + IsSold?: boolean | null; + + /** Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. */ + IsPurchased?: boolean | null; + + /** + * The sales description of the item (max length = 4000) + * Max length: 4000 + */ + Description?: string | null; + + /** + * The purchase description of the item (max length = 4000) + * Max length: 4000 + */ + PurchaseDescription?: string | null; + PurchaseDetails?: Purchase; + SalesDetails?: Purchase; + + /** True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. */ + IsTrackedAsInventory?: boolean | null; + + /** + * The value of the item on hand. Calculated using average cost accounting. + * Type: double + */ + TotalCostPool?: number | null; + + /** + * The quantity of the item on hand + * Type: double + */ + QuantityOnHand?: number | null; + + /** Last modified date in UTC format */ + UpdatedDateUTC?: Date | null; + + /** The Xero identifier for an Item */ + ItemID?: string | null; + + /** Status of object */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface ItemFormProperties { + + /** + * User defined item code (max length = 30) + * Required + * Max length: 30 + */ + Code: FormControl, + + /** The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item */ + InventoryAssetAccountCode: FormControl, + + /** + * The name of the item (max length = 50) + * Max length: 50 + */ + Name: FormControl, + + /** Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. */ + IsSold: FormControl, + + /** Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. */ + IsPurchased: FormControl, + + /** + * The sales description of the item (max length = 4000) + * Max length: 4000 + */ + Description: FormControl, + + /** + * The purchase description of the item (max length = 4000) + * Max length: 4000 + */ + PurchaseDescription: FormControl, + + /** True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. */ + IsTrackedAsInventory: FormControl, + + /** + * The value of the item on hand. Calculated using average cost accounting. + * Type: double + */ + TotalCostPool: FormControl, + + /** + * The quantity of the item on hand + * Type: double + */ + QuantityOnHand: FormControl, + + /** Last modified date in UTC format */ + UpdatedDateUTC: FormControl, + + /** The Xero identifier for an Item */ + ItemID: FormControl, + + /** Status of object */ + StatusAttributeString: FormControl, + } + export function CreateItemFormGroup() { + return new FormGroup({ + Code: new FormControl(undefined, [Validators.required, Validators.maxLength(30)]), + InventoryAssetAccountCode: new FormControl(undefined), + Name: new FormControl(undefined, [Validators.maxLength(50)]), + IsSold: new FormControl(undefined), + IsPurchased: new FormControl(undefined), + Description: new FormControl(undefined, [Validators.maxLength(4000)]), + PurchaseDescription: new FormControl(undefined, [Validators.maxLength(4000)]), + IsTrackedAsInventory: new FormControl(undefined), + TotalCostPool: new FormControl(undefined), + QuantityOnHand: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + ItemID: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export interface Purchase { + + /** + * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. + * Type: double + */ + UnitPrice?: number | null; + + /** Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items */ + AccountCode?: string | null; + + /** Cost of goods sold account. Only applicable to the purchase details of tracked items. */ + COGSAccountCode?: string | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + } + export interface PurchaseFormProperties { + + /** + * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. + * Type: double + */ + UnitPrice: FormControl, + + /** Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items */ + AccountCode: FormControl, + + /** Cost of goods sold account. Only applicable to the purchase details of tracked items. */ + COGSAccountCode: FormControl, + + /** The tax type from TaxRates */ + TaxType: FormControl, + } + export function CreatePurchaseFormGroup() { + return new FormGroup({ + UnitPrice: new FormControl(undefined), + AccountCode: new FormControl(undefined), + COGSAccountCode: new FormControl(undefined), + TaxType: new FormControl(undefined), + }); + + } + + export interface Journals { + Journals1?: Array; + } + export interface JournalsFormProperties { + } + export function CreateJournalsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Journal { + + /** Xero identifier */ + JournalID?: string | null; + + /** + * Date the journal was posted + * Type: DateOnly + */ + JournalDate?: Date | null; + + /** + * Xero generated journal number + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + JournalNumber?: number | null; + + /** Created date UTC format */ + CreatedDateUTC?: Date | null; + + /** reference field for additional indetifying information */ + Reference?: string | null; + + /** The identifier for the source transaction (e.g. InvoiceID) */ + SourceID?: string | null; + + /** The journal source type. The type of transaction that created the journal */ + SourceType?: JournalSourceType | null; + + /** See JournalLines */ + JournalLines?: Array; + } + export interface JournalFormProperties { + + /** Xero identifier */ + JournalID: FormControl, + + /** + * Date the journal was posted + * Type: DateOnly + */ + JournalDate: FormControl, + + /** + * Xero generated journal number + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + JournalNumber: FormControl, + + /** Created date UTC format */ + CreatedDateUTC: FormControl, + + /** reference field for additional indetifying information */ + Reference: FormControl, + + /** The identifier for the source transaction (e.g. InvoiceID) */ + SourceID: FormControl, + + /** The journal source type. The type of transaction that created the journal */ + SourceType: FormControl, + } + export function CreateJournalFormGroup() { + return new FormGroup({ + JournalID: new FormControl(undefined), + JournalDate: CreateDateOnlyFormControl(), + JournalNumber: new FormControl(undefined), + CreatedDateUTC: new FormControl(undefined), + Reference: new FormControl(undefined), + SourceID: new FormControl(undefined), + SourceType: new FormControl(undefined), + }); + + } + + export enum JournalSourceType { ACCREC = 0, ACCPAY = 1, ACCRECCREDIT = 2, ACCPAYCREDIT = 3, ACCRECPAYMENT = 4, ACCPAYPAYMENT = 5, ARCREDITPAYMENT = 6, APCREDITPAYMENT = 7, CASHREC = 8, CASHPAID = 9, TRANSFER = 10, ARPREPAYMENT = 11, APPREPAYMENT = 12, AROVERPAYMENT = 13, APOVERPAYMENT = 14, EXPCLAIM = 15, EXPPAYMENT = 16, MANJOURNAL = 17, PAYSLIP = 18, WAGEPAYABLE = 19, INTEGRATEDPAYROLLPE = 20, INTEGRATEDPAYROLLPT = 21, EXTERNALSPENDMONEY = 22, INTEGRATEDPAYROLLPTPAYMENT = 23, INTEGRATEDPAYROLLCN = 24 } + + export interface JournalLine { + + /** Xero identifier for Journal */ + JournalLineID?: string | null; + + /** See Accounts */ + AccountID?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** See Account Types */ + AccountType?: AccountType | null; + + /** See AccountCodes */ + AccountName?: string | null; + + /** The description from the source transaction line item. Only returned if populated. */ + Description?: string | null; + + /** + * Net amount of journal line. This will be a positive value for a debit and negative for a credit + * Type: double + */ + NetAmount?: number | null; + + /** + * Gross amount of journal line (NetAmount + TaxAmount). + * Type: double + */ + GrossAmount?: number | null; + + /** + * Total tax on a journal line + * Type: double + */ + TaxAmount?: number | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** see TaxRates */ + TaxName?: string | null; + + /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ + TrackingCategories?: Array; + } + export interface JournalLineFormProperties { + + /** Xero identifier for Journal */ + JournalLineID: FormControl, + + /** See Accounts */ + AccountID: FormControl, + + /** See Accounts */ + AccountCode: FormControl, + + /** See Account Types */ + AccountType: FormControl, + + /** See AccountCodes */ + AccountName: FormControl, + + /** The description from the source transaction line item. Only returned if populated. */ + Description: FormControl, + + /** + * Net amount of journal line. This will be a positive value for a debit and negative for a credit + * Type: double + */ + NetAmount: FormControl, + + /** + * Gross amount of journal line (NetAmount + TaxAmount). + * Type: double + */ + GrossAmount: FormControl, + + /** + * Total tax on a journal line + * Type: double + */ + TaxAmount: FormControl, + + /** The tax type from TaxRates */ + TaxType: FormControl, + + /** see TaxRates */ + TaxName: FormControl, + } + export function CreateJournalLineFormGroup() { + return new FormGroup({ + JournalLineID: new FormControl(undefined), + AccountID: new FormControl(undefined), + AccountCode: new FormControl(undefined), + AccountType: new FormControl(undefined), + AccountName: new FormControl(undefined), + Description: new FormControl(undefined), + NetAmount: new FormControl(undefined), + GrossAmount: new FormControl(undefined), + TaxAmount: new FormControl(undefined), + TaxType: new FormControl(undefined), + TaxName: new FormControl(undefined), + }); + + } + + export interface TrackingCategory { + + /** The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + TrackingCategoryID?: string | null; + + /** The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f */ + TrackingOptionID?: string | null; + + /** + * The name of the tracking category e.g. Department, Region (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** + * The option name of the tracking option e.g. East, West (max length = 100) + * Max length: 100 + */ + Option?: string | null; + + /** The status of a tracking category */ + Status?: AccountStatus | null; + + /** See Tracking Options */ + Options?: Array; + } + export interface TrackingCategoryFormProperties { + + /** The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + TrackingCategoryID: FormControl, + + /** The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f */ + TrackingOptionID: FormControl, + + /** + * The name of the tracking category e.g. Department, Region (max length = 100) + * Max length: 100 + */ + Name: FormControl, + + /** + * The option name of the tracking option e.g. East, West (max length = 100) + * Max length: 100 + */ + Option: FormControl, + + /** The status of a tracking category */ + Status: FormControl, + } + export function CreateTrackingCategoryFormGroup() { + return new FormGroup({ + TrackingCategoryID: new FormControl(undefined), + TrackingOptionID: new FormControl(undefined), + Name: new FormControl(undefined, [Validators.maxLength(100)]), + Option: new FormControl(undefined, [Validators.maxLength(100)]), + Status: new FormControl(undefined), + }); + + } + + export interface TrackingOption { + + /** The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a */ + TrackingOptionID?: string | null; + + /** + * The name of the tracking option e.g. Marketing, East (max length = 50) + * Max length: 50 + */ + Name?: string | null; + + /** The status of a tracking option */ + Status?: AccountStatus | null; + + /** Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + TrackingCategoryID?: string | null; + } + export interface TrackingOptionFormProperties { + + /** The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a */ + TrackingOptionID: FormControl, + + /** + * The name of the tracking option e.g. Marketing, East (max length = 50) + * Max length: 50 + */ + Name: FormControl, + + /** The status of a tracking option */ + Status: FormControl, + + /** Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + TrackingCategoryID: FormControl, + } + export function CreateTrackingOptionFormGroup() { + return new FormGroup({ + TrackingOptionID: new FormControl(undefined), + Name: new FormControl(undefined, [Validators.maxLength(50)]), + Status: new FormControl(undefined), + TrackingCategoryID: new FormControl(undefined), + }); + + } + + export interface LinkedTransactions { + LinkedTransactions1?: Array; + } + export interface LinkedTransactionsFormProperties { + } + export function CreateLinkedTransactionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface LinkedTransaction { + + /** Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice */ + SourceTransactionID?: string | null; + + /** The line item identifier from the source transaction. */ + SourceLineItemID?: string | null; + + /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ + ContactID?: string | null; + + /** Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice */ + TargetTransactionID?: string | null; + + /** The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. */ + TargetLineItemID?: string | null; + + /** The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + LinkedTransactionID?: string | null; + + /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ + Status?: LinkedTransactionStatus | null; + + /** This will always be BILLABLEEXPENSE. More types may be added in future. */ + Type?: LinkedTransactionType | null; + + /** The last modified date in UTC format */ + UpdatedDateUTC?: Date | null; + + /** The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. */ + SourceTransactionTypeCode?: LinkedTransactionSourceTransactionTypeCode | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface LinkedTransactionFormProperties { + + /** Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice */ + SourceTransactionID: FormControl, + + /** The line item identifier from the source transaction. */ + SourceLineItemID: FormControl, + + /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ + ContactID: FormControl, + + /** Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice */ + TargetTransactionID: FormControl, + + /** The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. */ + TargetLineItemID: FormControl, + + /** The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + LinkedTransactionID: FormControl, + + /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ + Status: FormControl, + + /** This will always be BILLABLEEXPENSE. More types may be added in future. */ + Type: FormControl, + + /** The last modified date in UTC format */ + UpdatedDateUTC: FormControl, + + /** The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. */ + SourceTransactionTypeCode: FormControl, + } + export function CreateLinkedTransactionFormGroup() { + return new FormGroup({ + SourceTransactionID: new FormControl(undefined), + SourceLineItemID: new FormControl(undefined), + ContactID: new FormControl(undefined), + TargetTransactionID: new FormControl(undefined), + TargetLineItemID: new FormControl(undefined), + LinkedTransactionID: new FormControl(undefined), + Status: new FormControl(undefined), + Type: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + SourceTransactionTypeCode: new FormControl(undefined), + }); + + } + + export enum LinkedTransactionStatus { APPROVED = 0, DRAFT = 1, ONDRAFT = 2, BILLED = 3, VOIDED = 4 } + + export enum LinkedTransactionType { BILLABLEEXPENSE = 0 } + + export enum LinkedTransactionSourceTransactionTypeCode { ACCPAY = 0, SPEND = 1 } + + export interface ManualJournals { + ManualJournals1?: Array; + } + export interface ManualJournalsFormProperties { + } + export function CreateManualJournalsFormGroup() { + return new FormGroup({ + }); + + } + + export interface ManualJournal { + + /** + * Description of journal being posted + * Required + */ + Narration: string; + + /** See JournalLines */ + JournalLines?: Array; + + /** + * Date journal was posted � YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Manual Journal Status Codes */ + Status?: ManualJournalStatus | null; + + /** Url link to a source document � shown as �Go to [appName]� in the Xero app */ + Url?: string | null; + + /** Boolean � default is true if not specified */ + ShowOnCashBasisReports?: boolean | null; + + /** Boolean to indicate if a manual journal has an attachment */ + HasAttachments?: boolean | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** The Xero identifier for a Manual Journal */ + ManualJournalID?: string | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + export interface ManualJournalFormProperties { + + /** + * Description of journal being posted + * Required + */ + Narration: FormControl, + + /** + * Date journal was posted � YYYY-MM-DD + * Type: DateOnly + */ + Date: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** See Manual Journal Status Codes */ + Status: FormControl, + + /** Url link to a source document � shown as �Go to [appName]� in the Xero app */ + Url: FormControl, + + /** Boolean � default is true if not specified */ + ShowOnCashBasisReports: FormControl, + + /** Boolean to indicate if a manual journal has an attachment */ + HasAttachments: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** The Xero identifier for a Manual Journal */ + ManualJournalID: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreateManualJournalFormGroup() { + return new FormGroup({ + Narration: new FormControl(undefined, [Validators.required]), + Date: CreateDateOnlyFormControl(), + LineAmountTypes: new FormControl(undefined), + Status: new FormControl(undefined), + Url: new FormControl(undefined), + ShowOnCashBasisReports: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + ManualJournalID: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export interface ManualJournalLine { + + /** + * total for line. Debits are positive, credits are negative value + * Type: double + */ + LineAmount?: number | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** Description for journal line */ + Description?: string | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ + Tracking?: Array; + + /** + * The calculated tax amount based on the TaxType and LineAmount + * Type: double + */ + TaxAmount?: number | null; + + /** is the line blank */ + IsBlank?: boolean | null; + } + export interface ManualJournalLineFormProperties { + + /** + * total for line. Debits are positive, credits are negative value + * Type: double + */ + LineAmount: FormControl, + + /** See Accounts */ + AccountCode: FormControl, + + /** Description for journal line */ + Description: FormControl, + + /** The tax type from TaxRates */ + TaxType: FormControl, + + /** + * The calculated tax amount based on the TaxType and LineAmount + * Type: double + */ + TaxAmount: FormControl, + + /** is the line blank */ + IsBlank: FormControl, + } + export function CreateManualJournalLineFormGroup() { + return new FormGroup({ + LineAmount: new FormControl(undefined), + AccountCode: new FormControl(undefined), + Description: new FormControl(undefined), + TaxType: new FormControl(undefined), + TaxAmount: new FormControl(undefined), + IsBlank: new FormControl(undefined), + }); + + } + + export enum ManualJournalStatus { DRAFT = 0, POSTED = 1, DELETED = 2, VOIDED = 3, ARCHIVED = 4 } + + export interface Organisations { + Organisations1?: Array; + } + export interface OrganisationsFormProperties { + } + export function CreateOrganisationsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Organisation { + + /** Unique Xero identifier */ + OrganisationID?: string | null; + + /** Display a unique key used for Xero-to-Xero transactions */ + APIKey?: string | null; + + /** Display name of organisation shown in Xero */ + Name?: string | null; + + /** Organisation name shown on Reports */ + LegalName?: string | null; + + /** Boolean to describe if organisation is registered with a local tax authority i.e. true, false */ + PaysTax?: boolean | null; + + /** See Version Types */ + Version?: OrganisationVersion | null; + + /** Organisation Type */ + OrganisationType?: OrganisationOrganisationType | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + BaseCurrency?: AccountCurrencyCode | null; + CountryCode?: OrganisationCountryCode | null; + + /** Boolean to describe if organisation is a demo company. */ + IsDemoCompany?: boolean | null; + + /** Will be set to ACTIVE if you can connect to organisation via the Xero API */ + OrganisationStatus?: string | null; + + /** Shows for New Zealand, Australian and UK organisations */ + RegistrationNumber?: string | null; + + /** Shown if set. US Only. */ + EmployerIdentificationNumber?: string | null; + + /** Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). */ + TaxNumber?: string | null; + + /** + * Calendar day e.g. 0-31 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + FinancialYearEndDay?: number | null; + + /** + * Calendar Month e.g. 1-12 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + FinancialYearEndMonth?: number | null; + + /** The accounting basis used for tax returns. See Sales Tax Basis */ + SalesTaxBasis?: OrganisationSalesTaxBasis | null; + + /** The frequency with which tax returns are processed. See Sales Tax Period */ + SalesTaxPeriod?: OrganisationSalesTaxPeriod | null; + + /** The default for LineAmountTypes on sales transactions */ + DefaultSalesTax?: string | null; + + /** The default for LineAmountTypes on purchase transactions */ + DefaultPurchasesTax?: string | null; + + /** + * Shown if set. See lock dates + * Type: DateOnly + */ + PeriodLockDate?: Date | null; + + /** + * Shown if set. See lock dates + * Type: DateOnly + */ + EndOfYearLockDate?: Date | null; + + /** Timestamp when the organisation was created in Xero */ + CreatedDateUTC?: Date | null; + + /** Timezone specifications */ + Timezone?: OrganisationTimezone | null; + + /** Organisation Type */ + OrganisationEntityType?: OrganisationOrganisationType | null; + + /** A unique identifier for the organisation. Potential uses. */ + ShortCode?: string | null; + + /** Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) */ + Class?: OrganisationClass | null; + + /** BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) */ + Edition?: OrganisationEdition | null; + + /** Description of business type as defined in Organisation settings */ + LineOfBusiness?: string | null; + + /** Address details for organisation � see Addresses */ + Addresses?: Array
; + + /** Phones details for organisation � see Phones */ + Phones?: Array; + + /** Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below */ + ExternalLinks?: Array; + PaymentTerms?: PaymentTerm; + } + export interface OrganisationFormProperties { + + /** Unique Xero identifier */ + OrganisationID: FormControl, + + /** Display a unique key used for Xero-to-Xero transactions */ + APIKey: FormControl, + + /** Display name of organisation shown in Xero */ + Name: FormControl, + + /** Organisation name shown on Reports */ + LegalName: FormControl, + + /** Boolean to describe if organisation is registered with a local tax authority i.e. true, false */ + PaysTax: FormControl, + + /** See Version Types */ + Version: FormControl, + + /** Organisation Type */ + OrganisationType: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + BaseCurrency: FormControl, + CountryCode: FormControl, + + /** Boolean to describe if organisation is a demo company. */ + IsDemoCompany: FormControl, + + /** Will be set to ACTIVE if you can connect to organisation via the Xero API */ + OrganisationStatus: FormControl, + + /** Shows for New Zealand, Australian and UK organisations */ + RegistrationNumber: FormControl, + + /** Shown if set. US Only. */ + EmployerIdentificationNumber: FormControl, + + /** Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). */ + TaxNumber: FormControl, + + /** + * Calendar day e.g. 0-31 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + FinancialYearEndDay: FormControl, + + /** + * Calendar Month e.g. 1-12 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + FinancialYearEndMonth: FormControl, + + /** The accounting basis used for tax returns. See Sales Tax Basis */ + SalesTaxBasis: FormControl, + + /** The frequency with which tax returns are processed. See Sales Tax Period */ + SalesTaxPeriod: FormControl, + + /** The default for LineAmountTypes on sales transactions */ + DefaultSalesTax: FormControl, + + /** The default for LineAmountTypes on purchase transactions */ + DefaultPurchasesTax: FormControl, + + /** + * Shown if set. See lock dates + * Type: DateOnly + */ + PeriodLockDate: FormControl, + + /** + * Shown if set. See lock dates + * Type: DateOnly + */ + EndOfYearLockDate: FormControl, + + /** Timestamp when the organisation was created in Xero */ + CreatedDateUTC: FormControl, + + /** Timezone specifications */ + Timezone: FormControl, + + /** Organisation Type */ + OrganisationEntityType: FormControl, + + /** A unique identifier for the organisation. Potential uses. */ + ShortCode: FormControl, + + /** Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) */ + Class: FormControl, + + /** BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) */ + Edition: FormControl, + + /** Description of business type as defined in Organisation settings */ + LineOfBusiness: FormControl, + } + export function CreateOrganisationFormGroup() { + return new FormGroup({ + OrganisationID: new FormControl(undefined), + APIKey: new FormControl(undefined), + Name: new FormControl(undefined), + LegalName: new FormControl(undefined), + PaysTax: new FormControl(undefined), + Version: new FormControl(undefined), + OrganisationType: new FormControl(undefined), + BaseCurrency: new FormControl(undefined), + CountryCode: new FormControl(undefined), + IsDemoCompany: new FormControl(undefined), + OrganisationStatus: new FormControl(undefined), + RegistrationNumber: new FormControl(undefined), + EmployerIdentificationNumber: new FormControl(undefined), + TaxNumber: new FormControl(undefined), + FinancialYearEndDay: new FormControl(undefined), + FinancialYearEndMonth: new FormControl(undefined), + SalesTaxBasis: new FormControl(undefined), + SalesTaxPeriod: new FormControl(undefined), + DefaultSalesTax: new FormControl(undefined), + DefaultPurchasesTax: new FormControl(undefined), + PeriodLockDate: CreateDateOnlyFormControl(), + EndOfYearLockDate: CreateDateOnlyFormControl(), + CreatedDateUTC: new FormControl(undefined), + Timezone: new FormControl(undefined), + OrganisationEntityType: new FormControl(undefined), + ShortCode: new FormControl(undefined), + Class: new FormControl(undefined), + Edition: new FormControl(undefined), + LineOfBusiness: new FormControl(undefined), + }); + + } + + export enum OrganisationVersion { AU = 0, NZ = 1, GLOBAL = 2, UK = 3, US = 4, AUONRAMP = 5, NZONRAMP = 6, GLOBALONRAMP = 7, UKONRAMP = 8, USONRAMP = 9 } + + export enum OrganisationOrganisationType { ACCOUNTING_PRACTICE = 0, COMPANY = 1, CHARITY = 2, CLUB_OR_SOCIETY = 3, LOOK_THROUGH_COMPANY = 4, NOT_FOR_PROFIT = 5, PARTNERSHIP = 6, S_CORPORATION = 7, SELF_MANAGED_SUPERANNUATION_FUND = 8, SOLE_TRADER = 9, SUPERANNUATION_FUND = 10, TRUST = 11 } + + export enum OrganisationCountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + export enum OrganisationSalesTaxBasis { PAYMENTS = 0, INVOICE = 1, NONE = 2, CASH = 3, ACCRUAL = 4, FLATRATECASH = 5, FLATRATEACCRUAL = 6, ACCRUALS = 7 } + + export enum OrganisationSalesTaxPeriod { MONTHLY = 0, QUARTERLY1 = 1, QUARTERLY2 = 2, QUARTERLY3 = 3, ANNUALLY = 4, ONEMONTHS = 5, TWOMONTHS = 6, SIXMONTHS = 7, '1MONTHLY' = 8, '2MONTHLY' = 9, '3MONTHLY' = 10, '6MONTHLY' = 11, QUARTERLY = 12, YEARLY = 13, NONE = 14 } + + export enum OrganisationTimezone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } + + export enum OrganisationClass { DEMO = 0, TRIAL = 1, STARTER = 2, STANDARD = 3, PREMIUM = 4, PREMIUM_20 = 5, PREMIUM_50 = 6, PREMIUM_100 = 7, LEDGER = 8, GST_CASHBOOK = 9, NON_GST_CASHBOOK = 10 } + + export enum OrganisationEdition { BUSINESS = 0, PARTNER = 1 } + + export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + + /** Timezone specifications */ + export enum TimeZone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } + + export enum PaymentTermType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } + + export interface Overpayments { + Overpayments1?: Array; + } + export interface OverpaymentsFormProperties { + } + export function CreateOverpaymentsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Payments { + Payments1?: Array; + } + export interface PaymentsFormProperties { + } + export function CreatePaymentsFormGroup() { + return new FormGroup({ + }); + + } + + export interface PaymentDelete { + + /** + * The status of the payment. + * Required + */ + Status: string; + } + export interface PaymentDeleteFormProperties { + + /** + * The status of the payment. + * Required + */ + Status: FormControl, + } + export function CreatePaymentDeleteFormGroup() { + return new FormGroup({ + Status: new FormControl(undefined, [Validators.required]), + }); + + } + + export interface Prepayments { + Prepayments1?: Array; + } + export interface PrepaymentsFormProperties { + } + export function CreatePrepaymentsFormGroup() { + return new FormGroup({ + }); + + } + + export interface PurchaseOrders { + PurchaseOrders1?: Array; + } + export interface PurchaseOrdersFormProperties { + } + export function CreatePurchaseOrdersFormGroup() { + return new FormGroup({ + }); + + } + + export interface PurchaseOrder { + Contact?: Contact; + + /** See LineItems */ + LineItems?: Array; + + /** + * Date purchase order was issued � YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** + * Date the goods are to be delivered � YYYY-MM-DD + * Type: DateOnly + */ + DeliveryDate?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) */ + PurchaseOrderNumber?: string | null; + + /** Additional reference number */ + Reference?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** See Purchase Order Status Codes */ + Status?: PurchaseOrderStatus | null; + + /** Boolean to set whether the purchase order should be marked as �sent�. This can be set only on purchase orders that have been approved or billed */ + SentToContact?: boolean | null; + + /** The address the goods are to be delivered to */ + DeliveryAddress?: string | null; + + /** The person that the delivery is going to */ + AttentionTo?: string | null; + + /** The phone number for the person accepting the delivery */ + Telephone?: string | null; + + /** A free text feild for instructions (500 characters max) */ + DeliveryInstructions?: string | null; + + /** + * The date the goods are expected to arrive. + * Type: DateOnly + */ + ExpectedArrivalDate?: Date | null; + + /** Xero generated unique identifier for purchase order */ + PurchaseOrderID?: string | null; + + /** + * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. + * Type: double + */ + CurrencyRate?: number | null; + + /** + * Total of purchase order excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on purchase order + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total?: number | null; + + /** + * Total of discounts applied on the purchase order line items + * Type: double + */ + TotalDiscount?: number | null; + + /** boolean to indicate if a purchase order has an attachment */ + HasAttachments?: boolean | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + export interface PurchaseOrderFormProperties { + + /** + * Date purchase order was issued � YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date: FormControl, + + /** + * Date the goods are to be delivered � YYYY-MM-DD + * Type: DateOnly + */ + DeliveryDate: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) */ + PurchaseOrderNumber: FormControl, + + /** Additional reference number */ + Reference: FormControl, + + /** See BrandingThemes */ + BrandingThemeID: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** See Purchase Order Status Codes */ + Status: FormControl, + + /** Boolean to set whether the purchase order should be marked as �sent�. This can be set only on purchase orders that have been approved or billed */ + SentToContact: FormControl, + + /** The address the goods are to be delivered to */ + DeliveryAddress: FormControl, + + /** The person that the delivery is going to */ + AttentionTo: FormControl, + + /** The phone number for the person accepting the delivery */ + Telephone: FormControl, + + /** A free text feild for instructions (500 characters max) */ + DeliveryInstructions: FormControl, + + /** + * The date the goods are expected to arrive. + * Type: DateOnly + */ + ExpectedArrivalDate: FormControl, + + /** Xero generated unique identifier for purchase order */ + PurchaseOrderID: FormControl, + + /** + * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. + * Type: double + */ + CurrencyRate: FormControl, + + /** + * Total of purchase order excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * Total tax on purchase order + * Type: double + */ + TotalTax: FormControl, + + /** + * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total: FormControl, + + /** + * Total of discounts applied on the purchase order line items + * Type: double + */ + TotalDiscount: FormControl, + + /** boolean to indicate if a purchase order has an attachment */ + HasAttachments: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreatePurchaseOrderFormGroup() { + return new FormGroup({ + Date: CreateDateOnlyFormControl(), + DeliveryDate: CreateDateOnlyFormControl(), + LineAmountTypes: new FormControl(undefined), + PurchaseOrderNumber: new FormControl(undefined), + Reference: new FormControl(undefined), + BrandingThemeID: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + Status: new FormControl(undefined), + SentToContact: new FormControl(undefined), + DeliveryAddress: new FormControl(undefined), + AttentionTo: new FormControl(undefined), + Telephone: new FormControl(undefined), + DeliveryInstructions: new FormControl(undefined), + ExpectedArrivalDate: CreateDateOnlyFormControl(), + PurchaseOrderID: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + TotalDiscount: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export enum PurchaseOrderStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, BILLED = 3, DELETED = 4 } + + export interface Quotes { + Quotes1?: Array; + } + export interface QuotesFormProperties { + } + export function CreateQuotesFormGroup() { + return new FormGroup({ + }); + + } + + export interface Quote { + + /** QuoteID GUID is automatically generated and is returned after create or GET. */ + QuoteID?: string | null; + + /** + * Unique alpha numeric code identifying a quote (Max Length = 255) + * Max length: 255 + */ + QuoteNumber?: string | null; + + /** + * Additional reference number + * Max length: 4000 + */ + Reference?: string | null; + + /** + * Terms of the quote + * Max length: 4000 + */ + Terms?: string | null; + Contact?: Contact; + + /** See LineItems */ + LineItems?: Array; + + /** + * Date quote was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** Date the quote was issued (YYYY-MM-DD) */ + DateString?: string | null; + + /** + * Date the quote expires � YYYY-MM-DD. + * Type: DateOnly + */ + ExpiryDate?: Date | null; + + /** Date the quote expires � YYYY-MM-DD. */ + ExpiryDateString?: string | null; + + /** The status of the quote. */ + Status?: QuoteStatus | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * The currency rate for a multicurrency quote + * Type: double + */ + CurrencyRate?: number | null; + + /** + * Total of quote excluding taxes. + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on quote + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts + * Type: double + */ + Total?: number | null; + + /** + * Total of discounts applied on the quote line items + * Type: double + */ + TotalDiscount?: number | null; + + /** + * Title text for the quote + * Max length: 100 + */ + Title?: string | null; + + /** + * Summary text for the quote + * Max length: 3000 + */ + Summary?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: QuoteLineAmountTypes | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + export interface QuoteFormProperties { + + /** QuoteID GUID is automatically generated and is returned after create or GET. */ + QuoteID: FormControl, + + /** + * Unique alpha numeric code identifying a quote (Max Length = 255) + * Max length: 255 + */ + QuoteNumber: FormControl, + + /** + * Additional reference number + * Max length: 4000 + */ + Reference: FormControl, + + /** + * Terms of the quote + * Max length: 4000 + */ + Terms: FormControl, + + /** + * Date quote was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date: FormControl, + + /** Date the quote was issued (YYYY-MM-DD) */ + DateString: FormControl, + + /** + * Date the quote expires � YYYY-MM-DD. + * Type: DateOnly + */ + ExpiryDate: FormControl, + + /** Date the quote expires � YYYY-MM-DD. */ + ExpiryDateString: FormControl, + + /** The status of the quote. */ + Status: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** + * The currency rate for a multicurrency quote + * Type: double + */ + CurrencyRate: FormControl, + + /** + * Total of quote excluding taxes. + * Type: double + */ + SubTotal: FormControl, + + /** + * Total tax on quote + * Type: double + */ + TotalTax: FormControl, + + /** + * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts + * Type: double + */ + Total: FormControl, + + /** + * Total of discounts applied on the quote line items + * Type: double + */ + TotalDiscount: FormControl, + + /** + * Title text for the quote + * Max length: 100 + */ + Title: FormControl, + + /** + * Summary text for the quote + * Max length: 3000 + */ + Summary: FormControl, + + /** See BrandingThemes */ + BrandingThemeID: FormControl, + + /** Last modified date UTC format */ + UpdatedDateUTC: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** A string to indicate if a invoice status */ + StatusAttributeString: FormControl, + } + export function CreateQuoteFormGroup() { + return new FormGroup({ + QuoteID: new FormControl(undefined), + QuoteNumber: new FormControl(undefined, [Validators.maxLength(255)]), + Reference: new FormControl(undefined, [Validators.maxLength(4000)]), + Terms: new FormControl(undefined, [Validators.maxLength(4000)]), + Date: CreateDateOnlyFormControl(), + DateString: new FormControl(undefined), + ExpiryDate: CreateDateOnlyFormControl(), + ExpiryDateString: new FormControl(undefined), + Status: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + CurrencyRate: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + TotalDiscount: new FormControl(undefined), + Title: new FormControl(undefined, [Validators.maxLength(100)]), + Summary: new FormControl(undefined, [Validators.maxLength(3000)]), + BrandingThemeID: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + LineAmountTypes: new FormControl(undefined), + StatusAttributeString: new FormControl(undefined), + }); + + } + + export enum QuoteStatus { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } + + export enum QuoteLineAmountTypes { EXCLUSIVE = 0, INCLUSIVE = 1, NOTAX = 2 } + + + /** The status of the quote. */ + export enum QuoteStatusCodes { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } + + export interface Receipts { + Receipts1?: Array; + } + export interface ReceiptsFormProperties { + } + export function CreateReceiptsFormGroup() { + return new FormGroup({ + }); + + } + + export interface RepeatingInvoices { + RepeatingInvoices1?: Array; + } + export interface RepeatingInvoicesFormProperties { + } + export function CreateRepeatingInvoicesFormGroup() { + return new FormGroup({ + }); + + } + + export interface RepeatingInvoice { + + /** See Invoice Types */ + Type?: RepeatingInvoiceType | null; + Contact?: Contact; + Schedule?: Schedule; + + /** See LineItems */ + LineItems?: Array; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** ACCREC only � additional reference number */ + Reference?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** One of the following - DRAFT or AUTHORISED � See Invoice Status Codes */ + Status?: RepeatingInvoiceStatus | null; + + /** + * Total of invoice excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on invoice + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total?: number | null; + + /** Xero generated unique identifier for repeating invoice template */ + RepeatingInvoiceID?: string | null; + + /** Xero generated unique identifier for repeating invoice template */ + ID?: string | null; + + /** boolean to indicate if an invoice has an attachment */ + HasAttachments?: boolean | null; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + export interface RepeatingInvoiceFormProperties { + + /** See Invoice Types */ + Type: FormControl, + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes: FormControl, + + /** ACCREC only � additional reference number */ + Reference: FormControl, + + /** See BrandingThemes */ + BrandingThemeID: FormControl, + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode: FormControl, + + /** One of the following - DRAFT or AUTHORISED � See Invoice Status Codes */ + Status: FormControl, + + /** + * Total of invoice excluding taxes + * Type: double + */ + SubTotal: FormControl, + + /** + * Total tax on invoice + * Type: double + */ + TotalTax: FormControl, + + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total: FormControl, + + /** Xero generated unique identifier for repeating invoice template */ + RepeatingInvoiceID: FormControl, + + /** Xero generated unique identifier for repeating invoice template */ + ID: FormControl, + + /** boolean to indicate if an invoice has an attachment */ + HasAttachments: FormControl, + } + export function CreateRepeatingInvoiceFormGroup() { + return new FormGroup({ + Type: new FormControl(undefined), + LineAmountTypes: new FormControl(undefined), + Reference: new FormControl(undefined), + BrandingThemeID: new FormControl(undefined), + CurrencyCode: new FormControl(undefined), + Status: new FormControl(undefined), + SubTotal: new FormControl(undefined), + TotalTax: new FormControl(undefined), + Total: new FormControl(undefined), + RepeatingInvoiceID: new FormControl(undefined), + ID: new FormControl(undefined), + HasAttachments: new FormControl(undefined), + }); + + } + + export enum RepeatingInvoiceType { ACCPAY = 0, ACCREC = 1 } + + export interface Schedule { + + /** + * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Period?: number | null; + + /** One of the following - WEEKLY or MONTHLY */ + Unit?: ScheduleUnit | null; + + /** + * Integer used with due date type e.g 20 (of following month), 31 (of current month) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + DueDate?: number | null; + + /** the payment terms */ + DueDateType?: ScheduleDueDateType | null; + + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) + * Type: DateOnly + */ + StartDate?: Date | null; + + /** + * The calendar date of the next invoice in the schedule to be generated + * Type: DateOnly + */ + NextScheduledDate?: Date | null; + + /** + * Invoice end date � only returned if the template has an end date set + * Type: DateOnly + */ + EndDate?: Date | null; + } + export interface ScheduleFormProperties { + + /** + * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Period: FormControl, + + /** One of the following - WEEKLY or MONTHLY */ + Unit: FormControl, + + /** + * Integer used with due date type e.g 20 (of following month), 31 (of current month) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + DueDate: FormControl, + + /** the payment terms */ + DueDateType: FormControl, + + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) + * Type: DateOnly + */ + StartDate: FormControl, + + /** + * The calendar date of the next invoice in the schedule to be generated + * Type: DateOnly + */ + NextScheduledDate: FormControl, + + /** + * Invoice end date � only returned if the template has an end date set + * Type: DateOnly + */ + EndDate: FormControl, + } + export function CreateScheduleFormGroup() { + return new FormGroup({ + Period: new FormControl(undefined), + Unit: new FormControl(undefined), + DueDate: new FormControl(undefined), + DueDateType: new FormControl(undefined), + StartDate: CreateDateOnlyFormControl(), + NextScheduledDate: CreateDateOnlyFormControl(), + EndDate: CreateDateOnlyFormControl(), + }); + + } + + export enum ScheduleUnit { WEEKLY = 0, MONTHLY = 1 } + + export enum ScheduleDueDateType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, DAYSAFTERINVOICEDATE = 2, DAYSAFTERINVOICEMONTH = 3, OFCURRENTMONTH = 4, OFFOLLOWINGMONTH = 5 } + + export enum RepeatingInvoiceStatus { DRAFT = 0, AUTHORISED = 1, DELETED = 2 } + + export interface ReportWithRows { + Reports?: Array; + } + export interface ReportWithRowsFormProperties { + } + export function CreateReportWithRowsFormGroup() { + return new FormGroup({ + }); + + } + + export interface ReportWithRow { + + /** Report id */ + ReportID?: string | null; + + /** Name of the report */ + ReportName?: string | null; + + /** Title of the report */ + ReportTitle?: string | null; + + /** The type of report (BalanceSheet,ProfitLoss, etc) */ + ReportType?: string | null; + + /** Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) */ + ReportTitles?: Array; + + /** Date of report */ + ReportDate?: string | null; + Rows?: Array; + + /** Updated Date */ + UpdatedDateUTC?: Date | null; + Fields?: Array; + } + export interface ReportWithRowFormProperties { + + /** Report id */ + ReportID: FormControl, + + /** Name of the report */ + ReportName: FormControl, + + /** Title of the report */ + ReportTitle: FormControl, + + /** The type of report (BalanceSheet,ProfitLoss, etc) */ + ReportType: FormControl, + + /** Date of report */ + ReportDate: FormControl, + + /** Updated Date */ + UpdatedDateUTC: FormControl, + } + export function CreateReportWithRowFormGroup() { + return new FormGroup({ + ReportID: new FormControl(undefined), + ReportName: new FormControl(undefined), + ReportTitle: new FormControl(undefined), + ReportType: new FormControl(undefined), + ReportDate: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export interface ReportRows { + RowType?: ReportRowsRowType | null; + Title?: string | null; + Cells?: Array; + Rows?: Array; + } + export interface ReportRowsFormProperties { + RowType: FormControl, + Title: FormControl, + } + export function CreateReportRowsFormGroup() { + return new FormGroup({ + RowType: new FormControl(undefined), + Title: new FormControl(undefined), + }); + + } + + export enum ReportRowsRowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } + + export interface ReportCell { + Value?: string | null; + Attributes?: Array; + } + export interface ReportCellFormProperties { + Value: FormControl, + } + export function CreateReportCellFormGroup() { + return new FormGroup({ + Value: new FormControl(undefined), + }); + + } + + export interface ReportAttribute { + Id?: string | null; + Value?: string | null; + } + export interface ReportAttributeFormProperties { + Id: FormControl, + Value: FormControl, + } + export function CreateReportAttributeFormGroup() { + return new FormGroup({ + Id: new FormControl(undefined), + Value: new FormControl(undefined), + }); + + } + + export interface ReportRow { + RowType?: ReportRowsRowType | null; + Title?: string | null; + Cells?: Array; + } + export interface ReportRowFormProperties { + RowType: FormControl, + Title: FormControl, + } + export function CreateReportRowFormGroup() { + return new FormGroup({ + RowType: new FormControl(undefined), + Title: new FormControl(undefined), + }); + + } + + export interface ReportFields { + FieldID?: string | null; + Description?: string | null; + Value?: string | null; + } + export interface ReportFieldsFormProperties { + FieldID: FormControl, + Description: FormControl, + Value: FormControl, + } + export function CreateReportFieldsFormGroup() { + return new FormGroup({ + FieldID: new FormControl(undefined), + Description: new FormControl(undefined), + Value: new FormControl(undefined), + }); + + } + + export enum RowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } + + export interface Reports { + Reports1?: Array; + } + export interface ReportsFormProperties { + } + export function CreateReportsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Report { + + /** See Prepayment Types */ + ReportID?: string | null; + + /** See Prepayment Types */ + ReportName?: string | null; + + /** See Prepayment Types */ + ReportType?: ReportReportType | null; + + /** See Prepayment Types */ + ReportTitle?: string | null; + + /** Date of report */ + ReportDate?: string | null; + + /** Updated Date */ + UpdatedDateUTC?: Date | null; + Contacts?: Array; + } + export interface ReportFormProperties { + + /** See Prepayment Types */ + ReportID: FormControl, + + /** See Prepayment Types */ + ReportName: FormControl, + + /** See Prepayment Types */ + ReportType: FormControl, + + /** See Prepayment Types */ + ReportTitle: FormControl, + + /** Date of report */ + ReportDate: FormControl, + + /** Updated Date */ + UpdatedDateUTC: FormControl, + } + export function CreateReportFormGroup() { + return new FormGroup({ + ReportID: new FormControl(undefined), + ReportName: new FormControl(undefined), + ReportType: new FormControl(undefined), + ReportTitle: new FormControl(undefined), + ReportDate: new FormControl(undefined), + UpdatedDateUTC: new FormControl(undefined), + }); + + } + + export enum ReportReportType { AgedPayablesByContact = 0 } + + export interface TenNinteyNineContact { + + /** + * Box 1 on 1099 Form + * Type: double + */ + Box1?: number | null; + + /** + * Box 2 on 1099 Form + * Type: double + */ + Box2?: number | null; + + /** + * Box 3 on 1099 Form + * Type: double + */ + Box3?: number | null; + + /** + * Box 4 on 1099 Form + * Type: double + */ + Box4?: number | null; + + /** + * Box 5 on 1099 Form + * Type: double + */ + Box5?: number | null; + + /** + * Box 6 on 1099 Form + * Type: double + */ + Box6?: number | null; + + /** + * Box 7 on 1099 Form + * Type: double + */ + Box7?: number | null; + + /** + * Box 8 on 1099 Form + * Type: double + */ + Box8?: number | null; + + /** + * Box 9 on 1099 Form + * Type: double + */ + Box9?: number | null; + + /** + * Box 10 on 1099 Form + * Type: double + */ + Box10?: number | null; + + /** + * Box 11 on 1099 Form + * Type: double + */ + Box11?: number | null; + + /** + * Box 13 on 1099 Form + * Type: double + */ + Box13?: number | null; + + /** + * Box 14 on 1099 Form + * Type: double + */ + Box14?: number | null; + + /** Contact name on 1099 Form */ + Name?: string | null; + + /** Contact Fed Tax ID type */ + FederalTaxIDType?: string | null; + + /** Contact city on 1099 Form */ + City?: string | null; + + /** Contact zip on 1099 Form */ + Zip?: string | null; + + /** Contact State on 1099 Form */ + State?: string | null; + + /** Contact email on 1099 Form */ + Email?: string | null; + + /** Contact address on 1099 Form */ + StreetAddress?: string | null; + + /** Contact tax id on 1099 Form */ + TaxID?: string | null; + + /** Contact contact id */ + ContactId?: string | null; + } + export interface TenNinteyNineContactFormProperties { + + /** + * Box 1 on 1099 Form + * Type: double + */ + Box1: FormControl, + + /** + * Box 2 on 1099 Form + * Type: double + */ + Box2: FormControl, + + /** + * Box 3 on 1099 Form + * Type: double + */ + Box3: FormControl, + + /** + * Box 4 on 1099 Form + * Type: double + */ + Box4: FormControl, + + /** + * Box 5 on 1099 Form + * Type: double + */ + Box5: FormControl, + + /** + * Box 6 on 1099 Form + * Type: double + */ + Box6: FormControl, + + /** + * Box 7 on 1099 Form + * Type: double + */ + Box7: FormControl, + + /** + * Box 8 on 1099 Form + * Type: double + */ + Box8: FormControl, + + /** + * Box 9 on 1099 Form + * Type: double + */ + Box9: FormControl, + + /** + * Box 10 on 1099 Form + * Type: double + */ + Box10: FormControl, + + /** + * Box 11 on 1099 Form + * Type: double + */ + Box11: FormControl, + + /** + * Box 13 on 1099 Form + * Type: double + */ + Box13: FormControl, + + /** + * Box 14 on 1099 Form + * Type: double + */ + Box14: FormControl, + + /** Contact name on 1099 Form */ + Name: FormControl, + + /** Contact Fed Tax ID type */ + FederalTaxIDType: FormControl, + + /** Contact city on 1099 Form */ + City: FormControl, + + /** Contact zip on 1099 Form */ + Zip: FormControl, + + /** Contact State on 1099 Form */ + State: FormControl, + + /** Contact email on 1099 Form */ + Email: FormControl, + + /** Contact address on 1099 Form */ + StreetAddress: FormControl, + + /** Contact tax id on 1099 Form */ + TaxID: FormControl, + + /** Contact contact id */ + ContactId: FormControl, + } + export function CreateTenNinteyNineContactFormGroup() { + return new FormGroup({ + Box1: new FormControl(undefined), + Box2: new FormControl(undefined), + Box3: new FormControl(undefined), + Box4: new FormControl(undefined), + Box5: new FormControl(undefined), + Box6: new FormControl(undefined), + Box7: new FormControl(undefined), + Box8: new FormControl(undefined), + Box9: new FormControl(undefined), + Box10: new FormControl(undefined), + Box11: new FormControl(undefined), + Box13: new FormControl(undefined), + Box14: new FormControl(undefined), + Name: new FormControl(undefined), + FederalTaxIDType: new FormControl(undefined), + City: new FormControl(undefined), + Zip: new FormControl(undefined), + State: new FormControl(undefined), + Email: new FormControl(undefined), + StreetAddress: new FormControl(undefined), + TaxID: new FormControl(undefined), + ContactId: new FormControl(undefined), + }); + + } + + export interface TaxRates { + TaxRates1?: Array; + } + export interface TaxRatesFormProperties { + } + export function CreateTaxRatesFormGroup() { + return new FormGroup({ + }); + + } + + export interface TaxRate { + + /** Name of tax rate */ + Name?: string | null; + + /** The tax type */ + TaxType?: string | null; + + /** See TaxComponents */ + TaxComponents?: Array; + + /** See Status Codes */ + Status?: TaxRateStatus | null; + + /** See ReportTaxTypes */ + ReportTaxType?: TaxRateReportTaxType | null; + + /** Boolean to describe if tax rate can be used for asset accounts i.e. true,false */ + CanApplyToAssets?: boolean | null; + + /** Boolean to describe if tax rate can be used for equity accounts i.e true,false */ + CanApplyToEquity?: boolean | null; + + /** Boolean to describe if tax rate can be used for expense accounts i.e. true,false */ + CanApplyToExpenses?: boolean | null; + + /** Boolean to describe if tax rate can be used for liability accounts i.e. true,false */ + CanApplyToLiabilities?: boolean | null; + + /** Boolean to describe if tax rate can be used for revenue accounts i.e. true,false */ + CanApplyToRevenue?: boolean | null; + + /** + * Tax Rate (decimal to 4dp) e.g 12.5000 + * Type: double + */ + DisplayTaxRate?: number | null; + + /** + * Effective Tax Rate (decimal to 4dp) e.g 12.5000 + * Type: double + */ + EffectiveRate?: number | null; + } + export interface TaxRateFormProperties { + + /** Name of tax rate */ + Name: FormControl, + + /** The tax type */ + TaxType: FormControl, + + /** See Status Codes */ + Status: FormControl, + + /** See ReportTaxTypes */ + ReportTaxType: FormControl, + + /** Boolean to describe if tax rate can be used for asset accounts i.e. true,false */ + CanApplyToAssets: FormControl, + + /** Boolean to describe if tax rate can be used for equity accounts i.e true,false */ + CanApplyToEquity: FormControl, + + /** Boolean to describe if tax rate can be used for expense accounts i.e. true,false */ + CanApplyToExpenses: FormControl, + + /** Boolean to describe if tax rate can be used for liability accounts i.e. true,false */ + CanApplyToLiabilities: FormControl, + + /** Boolean to describe if tax rate can be used for revenue accounts i.e. true,false */ + CanApplyToRevenue: FormControl, + + /** + * Tax Rate (decimal to 4dp) e.g 12.5000 + * Type: double + */ + DisplayTaxRate: FormControl, + + /** + * Effective Tax Rate (decimal to 4dp) e.g 12.5000 + * Type: double + */ + EffectiveRate: FormControl, + } + export function CreateTaxRateFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined), + TaxType: new FormControl(undefined), + Status: new FormControl(undefined), + ReportTaxType: new FormControl(undefined), + CanApplyToAssets: new FormControl(undefined), + CanApplyToEquity: new FormControl(undefined), + CanApplyToExpenses: new FormControl(undefined), + CanApplyToLiabilities: new FormControl(undefined), + CanApplyToRevenue: new FormControl(undefined), + DisplayTaxRate: new FormControl(undefined), + EffectiveRate: new FormControl(undefined), + }); + + } + + export interface TaxComponent { + + /** Name of Tax Component */ + Name?: string | null; + + /** + * Tax Rate (up to 4dp) + * Type: double + */ + Rate?: number | null; + + /** Boolean to describe if Tax rate is compounded. */ + IsCompound?: boolean | null; + + /** Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations */ + IsNonRecoverable?: boolean | null; + } + export interface TaxComponentFormProperties { + + /** Name of Tax Component */ + Name: FormControl, + + /** + * Tax Rate (up to 4dp) + * Type: double + */ + Rate: FormControl, + + /** Boolean to describe if Tax rate is compounded. */ + IsCompound: FormControl, + + /** Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations */ + IsNonRecoverable: FormControl, + } + export function CreateTaxComponentFormGroup() { + return new FormGroup({ + Name: new FormControl(undefined), + Rate: new FormControl(undefined), + IsCompound: new FormControl(undefined), + IsNonRecoverable: new FormControl(undefined), + }); + + } + + export enum TaxRateStatus { ACTIVE = 0, DELETED = 1, ARCHIVED = 2, PENDING = 3 } + + export enum TaxRateReportTaxType { AVALARA = 0, BASEXCLUDED = 1, CAPITALSALESOUTPUT = 2, CAPITALEXPENSESINPUT = 3, ECOUTPUT = 4, ECOUTPUTSERVICES = 5, ECINPUT = 6, ECACQUISITIONS = 7, EXEMPTEXPENSES = 8, EXEMPTINPUT = 9, EXEMPTOUTPUT = 10, GSTONIMPORTS = 11, INPUT = 12, INPUTTAXED = 13, MOSSSALES = 14, NONE = 15, NONEOUTPUT = 16, OUTPUT = 17, PURCHASESINPUT = 18, SALESOUTPUT = 19, EXEMPTCAPITAL = 20, EXEMPTEXPORT = 21, CAPITALEXINPUT = 22, GSTONCAPIMPORTS = 23, GSTONCAPITALIMPORTS = 24, REVERSECHARGES = 25, PAYMENTS = 26, INVOICE = 27, CASH = 28, ACCRUAL = 29, FLATRATECASH = 30, FLATRATEACCRUAL = 31, ACCRUALS = 32, TXCA = 33, SRCAS = 34, DSOUTPUT = 35, BLINPUT2 = 36, EPINPUT = 37, IMINPUT2 = 38, MEINPUT = 39, IGDSINPUT2 = 40, ESN33OUTPUT = 41, OPINPUT = 42, OSOUTPUT = 43, TXN33INPUT = 44, TXESSINPUT = 45, TXREINPUT = 46, TXPETINPUT = 47, NRINPUT = 48, ES33OUTPUT = 49, ZERORATEDINPUT = 50, ZERORATEDOUTPUT = 51, DRCHARGESUPPLY = 52, DRCHARGE = 53, CAPINPUT = 54, CAPIMPORTS = 55, IMINPUT = 56, INPUT2 = 57, CIUINPUT = 58, SRINPUT = 59, OUTPUT2 = 60, SROUTPUT = 61, CAPOUTPUT = 62, SROUTPUT2 = 63, CIUOUTPUT = 64, ZROUTPUT = 65, ZREXPORT = 66, ACC28PLUS = 67, ACCUPTO28 = 68, OTHEROUTPUT = 69, SHOUTPUT = 70, ZRINPUT = 71, BADDEBT = 72, OTHERINPUT = 73 } + + + /** See Tax Types � can only be used on update calls */ + export enum TaxType { OUTPUT = 0, INPUT = 1, CAPEXINPUT = 2, EXEMPTEXPORT = 3, EXEMPTEXPENSES = 4, EXEMPTCAPITAL = 5, EXEMPTOUTPUT = 6, INPUTTAXED = 7, BASEXCLUDED = 8, GSTONCAPIMPORTS = 9, GSTONIMPORTS = 10, NONE = 11, INPUT2 = 12, ZERORATED = 13, OUTPUT2 = 14, CAPEXINPUT2 = 15, CAPEXOUTPUT = 16, CAPEXOUTPUT2 = 17, CAPEXSRINPUT = 18, CAPEXSROUTPUT = 19, ECACQUISITIONS = 20, ECZRINPUT = 21, ECZROUTPUT = 22, ECZROUTPUTSERVICES = 23, EXEMPTINPUT = 24, REVERSECHARGES = 25, RRINPUT = 26, RROUTPUT = 27, SRINPUT = 28, SROUTPUT = 29, ZERORATEDINPUT = 30, ZERORATEDOUTPUT = 31, BLINPUT = 32, DSOUTPUT = 33, EPINPUT = 34, ES33OUTPUT = 35, ESN33OUTPUT = 36, IGDSINPUT2 = 37, IMINPUT2 = 38, MEINPUT = 39, NRINPUT = 40, OPINPUT = 41, OSOUTPUT = 42, TXESSINPUT = 43, TXN33INPUT = 44, TXPETINPUT = 45, TXREINPUT = 46, INPUT3 = 47, INPUT4 = 48, OUTPUT3 = 49, OUTPUT4 = 50, SROUTPUT2 = 51, TXCA = 52, SRCAS = 53, BLINPUT2 = 54, DRCHARGESUPPLY20 = 55, DRCHARGE20 = 56, DRCHARGESUPPLY5 = 57, DRCHARGE5 = 58 } + + export interface TrackingCategories { + TrackingCategories1?: Array; + } + export interface TrackingCategoriesFormProperties { + } + export function CreateTrackingCategoriesFormGroup() { + return new FormGroup({ + }); + + } + + export interface TrackingOptions { + Options?: Array; + } + export interface TrackingOptionsFormProperties { + } + export function CreateTrackingOptionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Users { + Users1?: Array; + } + export interface UsersFormProperties { + } + export function CreateUsersFormGroup() { + return new FormGroup({ + }); + + } + + export interface Error { + + /** + * Exception number + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ErrorNumber?: number | null; + + /** Exception type */ + Type?: string | null; + + /** Exception message */ + Message?: string | null; + + /** Array of Elements of validation Errors */ + Elements?: Array; + } + export interface ErrorFormProperties { + + /** + * Exception number + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ErrorNumber: FormControl, + + /** Exception type */ + Type: FormControl, + + /** Exception message */ + Message: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + ErrorNumber: new FormControl(undefined), + Type: new FormControl(undefined), + Message: new FormControl(undefined), + }); + + } + + export interface Element { + + /** Array of Validation Error message */ + ValidationErrors?: Array; + + /** Unique ID for batch payment object with validation error */ + BatchPaymentID?: string | null; + BankTransactionID?: string | null; + CreditNoteID?: string | null; + ContactID?: string | null; + InvoiceID?: string | null; + ItemID?: string | null; + PurchaseOrderID?: string | null; + } + export interface ElementFormProperties { + + /** Unique ID for batch payment object with validation error */ + BatchPaymentID: FormControl, + BankTransactionID: FormControl, + CreditNoteID: FormControl, + ContactID: FormControl, + InvoiceID: FormControl, + ItemID: FormControl, + PurchaseOrderID: FormControl, + } + export function CreateElementFormGroup() { + return new FormGroup({ + BatchPaymentID: new FormControl(undefined), + BankTransactionID: new FormControl(undefined), + CreditNoteID: new FormControl(undefined), + ContactID: new FormControl(undefined), + InvoiceID: new FormControl(undefined), + ItemID: new FormControl(undefined), + PurchaseOrderID: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Allows you to retrieve the full chart of accounts + * Get Accounts + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Accounts} Success - return response of type Accounts array with 0 to n Account + */ + GetAccounts(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Accounts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create a new chart of accounts + * Put Accounts + * @param {Account} requestBody Account object in body of request + * @return {Accounts} Success - created new Account and return response of type Accounts array with new Account + */ + CreateAccount(requestBody: Account): Observable { + return this.http.put(this.baseUri + 'Accounts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a single chart of accounts + * Get Accounts/{AccountID} + * @param {string} AccountID Unique identifier for retrieving single object + * @return {Accounts} Success - return response of type Accounts array with one Account + */ + GetAccount(AccountID: string): Observable { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); + } + + /** + * Allows you to update a chart of accounts + * Post Accounts/{AccountID} + * @param {string} AccountID Unique identifier for retrieving single object + * @param {Accounts} requestBody Request of type Accounts array with one Account + * @return {Accounts} Success - update existing Account and return response of type Accounts array with updated Account + */ + UpdateAccount(AccountID: string, requestBody: Accounts): Observable { + return this.http.post(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a chart of accounts + * Delete Accounts/{AccountID} + * @param {string} AccountID Unique identifier for retrieving single object + * @return {Accounts} Success - delete existing Account and return response of type Accounts array with deleted Account + */ + DeleteAccount(AccountID: string): Observable { + return this.http.delete(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); + } + + /** + * Allows you to retrieve Attachments for accounts + * Get Accounts/{AccountID}/Attachments + * @param {string} AccountID Unique identifier for Account object + * @return {Attachments} Success - return response of type Attachments array of Attachment + */ + GetAccountAttachments(AccountID: string): Observable { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve specific Attachment on Account + * Get Accounts/{AccountID}/Attachments/{AttachmentID} + * @param {string} AccountID Unique identifier for Account object + * @param {string} AttachmentID Unique identifier for Attachment object + * @return {void} Success - return response of attachment for Account as binary data + */ + GetAccountAttachmentById(AccountID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachment on Account by Filename + * Get Accounts/{AccountID}/Attachments/{FileName} + * @param {string} AccountID Unique identifier for Account object + * @param {string} FileName Name of the attachment + * @return {void} Success - return response of attachment for Account as binary data + */ + GetAccountAttachmentByFileName(AccountID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieve either one or many BatchPayments for invoices + * Get BatchPayments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects + */ + GetBatchPayments(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'BatchPayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Create one or many BatchPayments for invoices + * Put BatchPayments + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {BatchPayments} requestBody BatchPayments with an array of Payments in body of request + * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects + */ + CreateBatchPayment(summarizeErrors: boolean | null | undefined, requestBody: BatchPayments): Observable { + return this.http.put(this.baseUri + 'BatchPayments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve history from a Batch Payment + * Get BatchPayments/{BatchPaymentID}/History + * @param {string} BatchPaymentID Unique identifier for BatchPayment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetBatchPaymentHistory(BatchPaymentID: string): Observable { + return this.http.get(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', {}); + } + + /** + * Allows you to create a history record for a Batch Payment + * Put BatchPayments/{BatchPaymentID}/History + * @param {string} BatchPaymentID Unique identifier for BatchPayment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateBatchPaymentHistoryRecord(BatchPaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any spend or receive money transactions + * Get BankTransactions + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page Up to 100 bank transactions will be returned in a single API call with line items details + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with 0 to n BankTransaction + */ + GetBankTransactions(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'BankTransactions?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create one or more spend or receive money transaction + * Put BankTransactions + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {BankTransactions} requestBody BankTransactions with an array of BankTransaction objects in body of request + * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction + */ + CreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { + return this.http.put(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update or create one or more spend or receive money transaction + * Post BankTransactions + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction + */ + UpdateOrCreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { + return this.http.post(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a single spend or receive money transaction + * Get BankTransactions/{BankTransactionID} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with a specific BankTransaction + */ + GetBankTransaction(BankTransactionID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a single spend or receive money transaction + * Post BankTransactions/{BankTransactionID} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with updated BankTransaction + */ + UpdateBankTransaction(BankTransactionID: string, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { + return this.http.post(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any attachments to bank transactions + * Get BankTransactions/{BankTransactionID}/Attachments + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @return {Attachments} Success - return response of type Attachments array with 0 to n Attachment + */ + GetBankTransactionAttachments(BankTransactionID: string): Observable { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on a specific BankTransaction + * Get BankTransactions/{BankTransactionID}/Attachments/{AttachmentID} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {string} AttachmentID Xero generated unique identifier for an attachment + * @return {void} Success - return response of attachment for BankTransaction as binary data + */ + GetBankTransactionAttachmentById(BankTransactionID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on BankTransaction by Filename + * Get BankTransactions/{BankTransactionID}/Attachments/{FileName} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {string} FileName The name of the file being attached + * @return {void} Success - return response of attachment for BankTransaction as binary data + */ + GetBankTransactionAttachmentByFileName(BankTransactionID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history from a bank transactions + * Get BankTransactions/{BankTransactionID}/History + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetBankTransactionsHistory(BankTransactionID: string): Observable { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', {}); + } + + /** + * Allows you to create history record for a bank transactions + * Put BankTransactions/{BankTransactionID}/History + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateBankTransactionHistoryRecord(BankTransactionID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve all bank transfers + * Get BankTransfers + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {BankTransfers} Success - return response of BankTransfers array of 0 to N BankTransfer + */ + GetBankTransfers(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'BankTransfers?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create a bank transfers + * Put BankTransfers + * @param {BankTransfers} requestBody BankTransfers with array of BankTransfer objects in request body + * @return {BankTransfers} Success - return response of BankTransfers array of one BankTransfer + */ + CreateBankTransfer(requestBody: BankTransfers): Observable { + return this.http.put(this.baseUri + 'BankTransfers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any bank transfers + * Get BankTransfers/{BankTransferID} + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @return {BankTransfers} Success - return response of BankTransfers array with one BankTransfer + */ + GetBankTransfer(BankTransferID: string): Observable { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)), {}); + } + + /** + * Allows you to retrieve Attachments from bank transfers + * Get BankTransfers/{BankTransferID}/Attachments + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @return {Attachments} Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + */ + GetBankTransferAttachments(BankTransferID: string): Observable { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on BankTransfer + * Get BankTransfers/{BankTransferID}/Attachments/{AttachmentID} + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @param {string} AttachmentID Xero generated unique identifier for an Attachment to a bank transfer + * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer + */ + GetBankTransferAttachmentById(BankTransferID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on BankTransfer by file name + * Get BankTransfers/{BankTransferID}/Attachments/{FileName} + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @param {string} FileName The name of the file being attached to a Bank Transfer + * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer + */ + GetBankTransferAttachmentByFileName(BankTransferID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history from a bank transfers + * Get BankTransfers/{BankTransferID}/History + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetBankTransferHistory(BankTransferID: string): Observable { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', {}); + } + + /** + * Put BankTransfers/{BankTransferID}/History + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateBankTransferHistoryRecord(BankTransferID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve all the BrandingThemes + * Get BrandingThemes + * @return {BrandingThemes} Success - return response of type BrandingThemes + */ + GetBrandingThemes(): Observable { + return this.http.get(this.baseUri + 'BrandingThemes', {}); + } + + /** + * Allows you to retrieve a specific BrandingThemes + * Get BrandingThemes/{BrandingThemeID} + * @param {string} BrandingThemeID Unique identifier for a Branding Theme + * @return {BrandingThemes} Success - return response of type BrandingThemes with one BrandingTheme + */ + GetBrandingTheme(BrandingThemeID: string): Observable { + return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)), {}); + } + + /** + * Allows you to retrieve the Payment services for a Branding Theme + * Get BrandingThemes/{BrandingThemeID}/PaymentServices + * @param {string} BrandingThemeID Unique identifier for a Branding Theme + * @return {PaymentServices} Success - return response of type PaymentServices array with 0 to N PaymentService + */ + GetBrandingThemePaymentServices(BrandingThemeID: string): Observable { + return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', {}); + } + + /** + * Allow for the creation of new custom payment service for specified Branding Theme + * Post BrandingThemes/{BrandingThemeID}/PaymentServices + * @param {string} BrandingThemeID Unique identifier for a Branding Theme + * @param {PaymentService} requestBody PaymentService object in body of request + * @return {PaymentServices} Success - return response of type PaymentServices array with newly created PaymentService + */ + CreateBrandingThemePaymentServices(BrandingThemeID: string, requestBody: PaymentService): Observable { + return this.http.post(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve all contacts in a Xero organisation + * Get Contacts + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {Array} IDs Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + * @param {number} page e.g. page=1 - Up to 100 contacts will be returned in a single API call. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + * @return {Contacts} Success - return response of type Contacts array with 0 to N Contact + */ + GetContacts(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Contacts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived, {}); + } + + /** + * Allows you to create a multiple contacts (bulk) in a Xero organisation + * Put Contacts + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Contacts} requestBody Contacts with an array of Contact objects to create in body of request + * @return {Contacts} Success - return response of type Contacts array with newly created Contact + */ + CreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { + return this.http.put(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more contacts in a Xero organisation + * Post Contacts + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @return {Contacts} Success - return response of type Contacts array with newly created Contact + */ + UpdateOrCreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { + return this.http.post(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a single contact by Contact Number in a Xero organisation + * Get Contacts/{ContactNumber} + * @param {string} ContactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). + * @return {Contacts} Success - return response of type Contacts array with a unique Contact + */ + GetContactByContactNumber(ContactNumber: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactNumber == null ? '' : encodeURIComponent(ContactNumber)), {}); + } + + /** + * Allows you to retrieve a single contacts in a Xero organisation + * Get Contacts/{ContactID} + * @param {string} ContactID Unique identifier for a Contact + * @return {Contacts} Success - return response of type Contacts array with a unique Contact + */ + GetContact(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), {}); + } + + /** + * Post Contacts/{ContactID} + * @param {string} ContactID Unique identifier for a Contact + * @param {Contacts} requestBody an array of Contacts containing single Contact object with properties to update + * @return {Contacts} Success - return response of type Contacts array with an updated Contact + */ + UpdateContact(ContactID: string, requestBody: Contacts): Observable { + return this.http.post(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve, add and update contacts in a Xero organisation + * Get Contacts/{ContactID}/Attachments + * @param {string} ContactID Unique identifier for a Contact + * @return {Attachments} Success - return response of type Attachments array with 0 to N Attachment + */ + GetContactAttachments(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on Contacts + * Get Contacts/{ContactID}/Attachments/{AttachmentID} + * @param {string} ContactID Unique identifier for a Contact + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Contact as binary data + */ + GetContactAttachmentById(ContactID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on Contacts by file name + * Get Contacts/{ContactID}/Attachments/{FileName} + * @param {string} ContactID Unique identifier for a Contact + * @param {string} FileName Name for the file you are attaching + * @return {void} Success - return response of attachment for Contact as binary data + */ + GetContactAttachmentByFileName(ContactID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve CISSettings for a contact in a Xero organisation + * Get Contacts/{ContactID}/CISSettings + * @param {string} ContactID Unique identifier for a Contact + * @return {CISSettings} Success - return response of type CISSettings for a specific Contact + */ + GetContactCISSettings(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/CISSettings', {}); + } + + /** + * Allows you to retrieve a history records of an Contact + * Get Contacts/{ContactID}/History + * @param {string} ContactID Unique identifier for a Contact + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetContactHistory(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an Contact + * Put Contacts/{ContactID}/History + * @param {string} ContactID Unique identifier for a Contact + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateContactHistory(ContactID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve the ContactID and Name of all the contacts in a contact group + * Get ContactGroups + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {ContactGroups} Success - return response of type Contact Groups array of Contact Group + */ + GetContactGroups(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ContactGroups?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create a contact group + * Put ContactGroups + * @param {ContactGroups} requestBody ContactGroups with an array of names in request body + * @return {ContactGroups} Success - return response of type Contact Groups array of newly created Contact Group + */ + CreateContactGroup(requestBody: ContactGroups): Observable { + return this.http.put(this.baseUri + 'ContactGroups', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a unique Contact Group by ID + * Get ContactGroups/{ContactGroupID} + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @return {ContactGroups} Success - return response of type Contact Groups array with a specific Contact Group + */ + GetContactGroup(ContactGroupID: string): Observable { + return this.http.get(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), {}); + } + + /** + * Allows you to update a Contact Group + * Post ContactGroups/{ContactGroupID} + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @param {ContactGroups} requestBody an array of Contact groups with Name of specific group to update + * @return {ContactGroups} Success - return response of type Contact Groups array of updated Contact Group + */ + UpdateContactGroup(ContactGroupID: string, requestBody: ContactGroups): Observable { + return this.http.post(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to add Contacts to a Contact Group + * Put ContactGroups/{ContactGroupID}/Contacts + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @param {Contacts} requestBody Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request + * @return {Contacts} Success - return response of type Contacts array of added Contacts + */ + CreateContactGroupContacts(ContactGroupID: string, requestBody: Contacts): Observable { + return this.http.put(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete all Contacts from a Contact Group + * Delete ContactGroups/{ContactGroupID}/Contacts + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @return {void} + */ + DeleteContactGroupContacts(ContactGroupID: string): Observable> { + return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to delete a specific Contact from a Contact Group + * Delete ContactGroups/{ContactGroupID}/Contacts/{ContactID} + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @param {string} ContactID Unique identifier for a Contact + * @return {void} + */ + DeleteContactGroupContact(ContactGroupID: string, ContactID: string): Observable> { + return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve any credit notes + * Get CreditNotes + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {CreditNotes} Success - return response of type Credit Notes array of CreditNote + */ + GetCreditNotes(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'CreditNotes?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create a credit note + * Put CreditNotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {CreditNotes} requestBody Credit Notes with array of CreditNote object in body of request + * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote + */ + CreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { + return this.http.put(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more credit notes + * Post CreditNotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {CreditNotes} requestBody an array of Credit Notes with a single CreditNote object. + * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote + */ + UpdateOrCreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { + return this.http.post(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specific credit note + * Get CreditNotes/{CreditNoteID} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {CreditNotes} Success - return response of type Credit Notes array with a unique CreditNote + */ + GetCreditNote(CreditNoteID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a specific credit note + * Post CreditNotes/{CreditNoteID} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {CreditNotes} requestBody an array of Credit Notes containing credit note details to update + * @return {CreditNotes} Success - return response of type Credit Notes array with updated CreditNote + */ + UpdateCreditNote(CreditNoteID: string, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { + return this.http.post(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve Attachments for credit notes + * Get CreditNotes/{CreditNoteID}/Attachments + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @return {Attachments} Success - return response of type Attachments array with all Attachment for specific Credit Note + */ + GetCreditNoteAttachments(CreditNoteID: string): Observable { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on CreditNote + * Get CreditNotes/{CreditNoteID}/Attachments/{AttachmentID} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Credit Note as binary data + */ + GetCreditNoteAttachmentById(CreditNoteID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on CreditNote by file name + * Get CreditNotes/{CreditNoteID}/Attachments/{FileName} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {string} FileName Name of the file you are attaching to Credit Note + * @return {void} Success - return response of attachment for Credit Note as binary data + */ + GetCreditNoteAttachmentByFileName(CreditNoteID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Credit Note as PDF files + * Get CreditNotes/{CreditNoteID}/pdf + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @return {void} Success - return response of binary data from the Attachment to a Credit Note + */ + GetCreditNoteAsPdf(CreditNoteID: string): Observable> { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to create Allocation on CreditNote + * Put CreditNotes/{CreditNoteID}/Allocations + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Allocations} requestBody Allocations with array of Allocation object in body of request. + * @return {Allocations} Success - return response of type Allocations array with newly created Allocation for specific Credit Note + */ + CreateCreditNoteAllocation(CreditNoteID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { + return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an CreditNote + * Get CreditNotes/{CreditNoteID}/History + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetCreditNoteHistory(CreditNoteID: string): Observable { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an CreditNote + * Put CreditNotes/{CreditNoteID}/History + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateCreditNoteHistory(CreditNoteID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve currencies for your organisation + * Get Currencies + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Currencies} Success - return response of type Currencies array with all Currencies + */ + GetCurrencies(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Currencies?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Put Currencies + * @param {Currency} requestBody Currency obejct in the body of request + * @return {Currencies} Unsupported - return response incorrect exception, API is not able to create new Currency + */ + CreateCurrency(requestBody: Currency): Observable { + return this.http.put(this.baseUri + 'Currencies', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve employees used in Xero payrun + * Get Employees + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Employees} Success - return response of type Employees array with all Employee + */ + GetEmployees(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create new employees used in Xero payrun + * Put Employees + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Employees} requestBody Employees with array of Employee object in body of request + * @return {Employees} Success - return response of type Employees array with new Employee + */ + CreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { + return this.http.put(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to create a single new employees used in Xero payrun + * Post Employees + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Employees} requestBody Employees with array of Employee object in body of request + * @return {Employees} Success - return response of type Employees array with new Employee + */ + UpdateOrCreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { + return this.http.post(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specific employee used in Xero payrun + * Get Employees/{EmployeeID} + * @param {string} EmployeeID Unique identifier for a Employee + * @return {Employees} Success - return response of type Employees array with specified Employee + */ + GetEmployee(EmployeeID: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeID == null ? '' : encodeURIComponent(EmployeeID)), {}); + } + + /** + * Allows you to retrieve expense claims + * Get ExpenseClaims + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with all ExpenseClaims + */ + GetExpenseClaims(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ExpenseClaims?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to retrieve expense claims + * Put ExpenseClaims + * @param {ExpenseClaims} requestBody ExpenseClaims with array of ExpenseClaim object in body of request + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with newly created ExpenseClaim + */ + CreateExpenseClaims(requestBody: ExpenseClaims): Observable { + return this.http.put(this.baseUri + 'ExpenseClaims', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified expense claim + * Get ExpenseClaims/{ExpenseClaimID} + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with specified ExpenseClaim + */ + GetExpenseClaim(ExpenseClaimID: string): Observable { + return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), {}); + } + + /** + * Allows you to update specified expense claims + * Post ExpenseClaims/{ExpenseClaimID} + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with updated ExpenseClaim + */ + UpdateExpenseClaim(ExpenseClaimID: string, requestBody: ExpenseClaims): Observable { + return this.http.post(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an ExpenseClaim + * Get ExpenseClaims/{ExpenseClaimID}/History + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetExpenseClaimHistory(ExpenseClaimID: string): Observable { + return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', {}); + } + + /** + * Allows you to create a history records of an ExpenseClaim + * Put ExpenseClaims/{ExpenseClaimID}/History + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateExpenseClaimHistory(ExpenseClaimID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any sales invoices or purchase bills + * Get Invoices + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {Array} IDs Filter by a comma-separated list of InvoicesIDs. + * @param {Array} InvoiceNumbers Filter by a comma-separated list of InvoiceNumbers. + * @param {Array} ContactIDs Filter by a comma-separated list of ContactIDs. + * @param {Array} Statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + * @param {number} page e.g. page=1 � Up to 100 invoices will be returned in a single API call with line items shown for each invoice + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + * @param {boolean} createdByMyApp When set to true you'll only retrieve Invoices created by your app + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with all Invoices + */ + GetInvoices(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, InvoiceNumbers: Array | null | undefined, ContactIDs: Array | null | undefined, Statuses: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined, createdByMyApp: boolean | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Invoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&' + InvoiceNumbers?.map(z => `InvoiceNumbers=${encodeURIComponent(z)}`).join('&') + '&' + ContactIDs?.map(z => `ContactIDs=${encodeURIComponent(z)}`).join('&') + '&' + Statuses?.map(z => `Statuses=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived + '&createdByMyApp=' + createdByMyApp + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create one or more sales invoices or purchase bills + * Put Invoices + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {Invoices} requestBody Invoices with an array of invoice objects in body of request + * @return {Invoices} Success - return response of type Invoices array with newly created Invoice + */ + CreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { + return this.http.put(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more sales invoices or purchase bills + * Post Invoices + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with newly created Invoice + */ + UpdateOrCreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { + return this.http.post(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified sales invoice or purchase bill + * Get Invoices/{InvoiceID} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with specified Invoices + */ + GetInvoice(InvoiceID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a specified sales invoices or purchase bills + * Post Invoices/{InvoiceID} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with updated Invoice + */ + UpdateInvoice(InvoiceID: string, unitdp: number | null | undefined, requestBody: Invoices): Observable { + return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve invoices or purchase bills as PDF files + * Get Invoices/{InvoiceID}/pdf + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {void} Success - return response of byte array pdf version of specified Invoices + */ + GetInvoiceAsPdf(InvoiceID: string): Observable> { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on invoices or purchase bills + * Get Invoices/{InvoiceID}/Attachments + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {Attachments} Success - return response of type Attachments array of Attachments for specified Invoices + */ + GetInvoiceAttachments(InvoiceID: string): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID + * Get Invoices/{InvoiceID}/Attachments/{AttachmentID} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {string} AttachmentID Unique identifier for an Attachment + * @return {void} Success - return response of attachment for Invoice as binary data + */ + GetInvoiceAttachmentById(InvoiceID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachment on invoices or purchase bills by it's filename + * Get Invoices/{InvoiceID}/Attachments/{FileName} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {string} FileName Name of the file you are attaching + * @return {void} Success - return response of attachment for Invoice as binary data + */ + GetInvoiceAttachmentByFileName(InvoiceID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a URL to an online invoice + * Get Invoices/{InvoiceID}/OnlineInvoice + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {OnlineInvoices} Success - return response of type OnlineInvoice array with one OnlineInvoice + */ + GetOnlineInvoice(InvoiceID: string): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/OnlineInvoice', {}); + } + + /** + * Allows you to email a copy of invoice to related Contact + * Post Invoices/{InvoiceID}/Email + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {void} + */ + EmailInvoice(InvoiceID: string, requestBody: RequestEmpty): Observable> { + return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Email', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a history records of an invoice + * Get Invoices/{InvoiceID}/History + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetInvoiceHistory(InvoiceID: string): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an invoice + * Put Invoices/{InvoiceID}/History + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateInvoiceHistory(InvoiceID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve invoice reminder settings + * Get InvoiceReminders/Settings + * @return {InvoiceReminders} Success - return response of Invoice Reminders + */ + GetInvoiceReminders(): Observable { + return this.http.get(this.baseUri + 'InvoiceReminders/Settings', {}); + } + + /** + * Allows you to retrieve any items + * Get Items + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with all Item + */ + GetItems(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Items?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create one or more items + * Put Items + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {Items} requestBody Items with an array of Item objects in body of request + * @return {Items} Success - return response of type Items array with newly created Item + */ + CreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { + return this.http.put(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update or create one or more items + * Post Items + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with newly created Item + */ + UpdateOrCreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { + return this.http.post(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified item + * Get Items/{ItemID} + * @param {string} ItemID Unique identifier for an Item + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with specified Item + */ + GetItem(ItemID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a specified item + * Post Items/{ItemID} + * @param {string} ItemID Unique identifier for an Item + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with updated Item + */ + UpdateItem(ItemID: string, unitdp: number | null | undefined, requestBody: Items): Observable { + return this.http.post(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a specified item + * Delete Items/{ItemID} + * @param {string} ItemID Unique identifier for an Item + * @return {void} + */ + DeleteItem(ItemID: string): Observable> { + return this.http.delete(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history for items + * Get Items/{ItemID}/History + * @param {string} ItemID Unique identifier for an Item + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetItemHistory(ItemID: string): Observable { + return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', {}); + } + + /** + * Allows you to create a history record for items + * Put Items/{ItemID}/History + * @param {string} ItemID Unique identifier for an Item + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateItemHistory(ItemID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any journals. + * Get Journals + * @param {number} offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. + * @return {Journals} Success - return response of type Journals array with all Journals + */ + GetJournals(offset: number | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Journals?offset=' + offset + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve a specified journals. + * Get Journals/{JournalID} + * @param {string} JournalID Unique identifier for a Journal + * @return {Journals} Success - return response of type Journals array with specified Journal + */ + GetJournal(JournalID: string): Observable { + return this.http.get(this.baseUri + 'Journals/' + (JournalID == null ? '' : encodeURIComponent(JournalID)), {}); + } + + /** + * Retrieve linked transactions (billable expenses) + * Get LinkedTransactions + * @param {number} page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} LinkedTransactionID The Xero identifier for an Linked Transaction + * @param {string} SourceTransactionID Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + * @param {string} ContactID Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + * @param {string} Status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status + * @param {string} TargetTransactionID Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with all LinkedTransaction + */ + GetLinkedTransactions(page: number | null | undefined, LinkedTransactionID: string | null | undefined, SourceTransactionID: string | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, TargetTransactionID: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'LinkedTransactions?page=' + page + '&LinkedTransactionID=' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)) + '&SourceTransactionID=' + (SourceTransactionID == null ? '' : encodeURIComponent(SourceTransactionID)) + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&TargetTransactionID=' + (TargetTransactionID == null ? '' : encodeURIComponent(TargetTransactionID)), {}); + } + + /** + * Allows you to create linked transactions (billable expenses) + * Put LinkedTransactions + * @param {LinkedTransaction} requestBody LinkedTransaction object in body of request + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with newly created LinkedTransaction + */ + CreateLinkedTransaction(requestBody: LinkedTransaction): Observable { + return this.http.put(this.baseUri + 'LinkedTransactions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified linked transactions (billable expenses) + * Get LinkedTransactions/{LinkedTransactionID} + * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with a specified LinkedTransaction + */ + GetLinkedTransaction(LinkedTransactionID: string): Observable { + return this.http.get(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), {}); + } + + /** + * Allows you to update a specified linked transactions (billable expenses) + * Post LinkedTransactions/{LinkedTransactionID} + * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with updated LinkedTransaction + */ + UpdateLinkedTransaction(LinkedTransactionID: string, requestBody: LinkedTransactions): Observable { + return this.http.post(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a specified linked transactions (billable expenses) + * Delete LinkedTransactions/{LinkedTransactionID} + * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction + * @return {void} + */ + DeleteLinkedTransaction(LinkedTransactionID: string): Observable> { + return this.http.delete(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve any manual journals + * Get ManualJournals + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {ManualJournals} Success - return response of type ManualJournals array with a all ManualJournals + */ + GetManualJournals(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'ManualJournals?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Allows you to create one or more manual journals + * Put ManualJournals + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request + * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal + */ + CreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { + return this.http.put(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to create a single manual journal + * Post ManualJournals + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request + * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal + */ + UpdateOrCreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { + return this.http.post(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified manual journals + * Get ManualJournals/{ManualJournalID} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @return {ManualJournals} Success - return response of type ManualJournals array with a specified ManualJournals + */ + GetManualJournal(ManualJournalID: string): Observable { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), {}); + } + + /** + * Allows you to update a specified manual journal + * Post ManualJournals/{ManualJournalID} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @return {ManualJournals} Success - return response of type ManualJournals array with an updated ManualJournal + */ + UpdateManualJournal(ManualJournalID: string, requestBody: ManualJournals): Observable { + return this.http.post(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve Attachment for manual journals + * Get ManualJournals/{ManualJournalID}/Attachments + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @return {Attachments} Success - return response of type Attachments array with all Attachments for a ManualJournals + */ + GetManualJournalAttachments(ManualJournalID: string): Observable { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve specified Attachment on ManualJournals + * Get ManualJournals/{ManualJournalID}/Attachments/{AttachmentID} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Manual Journal as binary data + */ + GetManualJournalAttachmentById(ManualJournalID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve specified Attachment on ManualJournal by file name + * Get ManualJournals/{ManualJournalID}/Attachments/{FileName} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @param {string} FileName The name of the file being attached to a ManualJournal + * @return {void} Success - return response of attachment for Manual Journal as binary data + */ + GetManualJournalAttachmentByFileName(ManualJournalID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Organisation details + * Get Organisation + * @return {Organisations} Success - return response of type Organisation array with all Organisation + */ + GetOrganisations(): Observable { + return this.http.get(this.baseUri + 'Organisation', {}); + } + + /** + * Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + * Get Organisation/{OrganisationID}/CISSettings + * @param {string} OrganisationID The unique Xero identifier for an organisation + * @return {CISOrgSetting} Success - return response of type Organisation array with specified Organisation + */ + GetOrganisationCISSettings(OrganisationID: string): Observable { + return this.http.get(this.baseUri + 'Organisation/' + (OrganisationID == null ? '' : encodeURIComponent(OrganisationID)) + '/CISSettings', {}); + } + + /** + * Allows you to retrieve overpayments + * Get Overpayments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Overpayments} Success - return response of type Overpayments array with all Overpayments + */ + GetOverpayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Overpayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to retrieve a specified overpayments + * Get Overpayments/{OverpaymentID} + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @return {Overpayments} Success - return response of type Overpayments array with specified Overpayments + */ + GetOverpayment(OverpaymentID: string): Observable { + return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)), {}); + } + + /** + * Allows you to create a single allocation for an overpayment + * Put Overpayments/{OverpaymentID}/Allocations + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Allocations} requestBody Allocations array with Allocation object in body of request + * @return {Allocations} Success - return response of type Allocations array with all Allocation for Overpayments + */ + CreateOverpaymentAllocations(OverpaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { + return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an Overpayment + * Get Overpayments/{OverpaymentID}/History + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetOverpaymentHistory(OverpaymentID: string): Observable { + return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', {}); + } + + /** + * Allows you to create history records of an Overpayment + * Put Overpayments/{OverpaymentID}/History + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateOverpaymentHistory(OverpaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve payments for invoices and credit notes + * Get Payments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page Up to 100 payments will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Payments} Success - return response of type Payments array for all Payments + */ + GetPayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Payments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Allows you to create multiple payments for invoices or credit notes + * Put Payments + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Payments} requestBody Payments array with Payment object in body of request + * @return {Payments} Success - return response of type Payments array for newly created Payment + */ + CreatePayments(summarizeErrors: boolean | null | undefined, requestBody: Payments): Observable { + return this.http.put(this.baseUri + 'Payments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to create a single payment for invoices or credit notes + * Post Payments + * @param {Payment} requestBody Request body with a single Payment object + * @return {Payments} Success - return response of type Payments array for newly created Payment + */ + CreatePayment(requestBody: Payment): Observable { + return this.http.post(this.baseUri + 'Payments', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified payment for invoices and credit notes + * Get Payments/{PaymentID} + * @param {string} PaymentID Unique identifier for a Payment + * @return {Payments} Success - return response of type Payments array for specified Payment + */ + GetPayment(PaymentID: string): Observable { + return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), {}); + } + + /** + * Allows you to update a specified payment for invoices and credit notes + * Post Payments/{PaymentID} + * @param {string} PaymentID Unique identifier for a Payment + * @return {Payments} Success - return response of type Payments array for updated Payment + */ + DeletePayment(PaymentID: string, requestBody: PaymentDelete): Observable { + return this.http.post(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve history records of a payment + * Get Payments/{PaymentID}/History + * @param {string} PaymentID Unique identifier for a Payment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetPaymentHistory(PaymentID: string): Observable { + return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', {}); + } + + /** + * Allows you to create a history record for a payment + * Put Payments/{PaymentID}/History + * @param {string} PaymentID Unique identifier for a Payment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreatePaymentHistory(PaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve payment services + * Get PaymentServices + * @return {PaymentServices} Success - return response of type PaymentServices array for all PaymentService + */ + GetPaymentServices(): Observable { + return this.http.get(this.baseUri + 'PaymentServices', {}); + } + + /** + * Allows you to create payment services + * Put PaymentServices + * @param {PaymentServices} requestBody PaymentServices array with PaymentService object in body of request + * @return {PaymentServices} Success - return response of type PaymentServices array for newly created PaymentService + */ + CreatePaymentService(requestBody: PaymentServices): Observable { + return this.http.put(this.baseUri + 'PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve prepayments + * Get Prepayments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Prepayments} Success - return response of type Prepayments array for all Prepayment + */ + GetPrepayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Prepayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to retrieve a specified prepayments + * Get Prepayments/{PrepaymentID} + * @param {string} PrepaymentID Unique identifier for a PrePayment + * @return {Prepayments} Success - return response of type Prepayments array for a specified Prepayment + */ + GetPrepayment(PrepaymentID: string): Observable { + return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)), {}); + } + + /** + * Allows you to create an Allocation for prepayments + * Put Prepayments/{PrepaymentID}/Allocations + * @param {string} PrepaymentID Unique identifier for Prepayment + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Allocations} requestBody Allocations with an array of Allocation object in body of request + * @return {Allocations} Success - return response of type Allocations array of Allocation for all Prepayment + */ + CreatePrepaymentAllocations(PrepaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { + return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an Prepayment + * Get Prepayments/{PrepaymentID}/History + * @param {string} PrepaymentID Unique identifier for a PrePayment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetPrepaymentHistory(PrepaymentID: string): Observable { + return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', {}); + } + + /** + * Allows you to create a history record for an Prepayment + * Put Prepayments/{PrepaymentID}/History + * @param {string} PrepaymentID Unique identifier for a PrePayment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreatePrepaymentHistory(PrepaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve purchase orders + * Get PurchaseOrders + * @param {PurchaseOrderStatus} Status Filter by purchase order status + * @param {string} DateFrom Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param {string} DateTo Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param {string} order Order by an any element + * @param {number} page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array of all PurchaseOrder + */ + GetPurchaseOrders(Status: PurchaseOrderStatus | null | undefined, DateFrom: string | null | undefined, DateTo: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders?Status=' + Status + '&DateFrom=' + (DateFrom == null ? '' : encodeURIComponent(DateFrom)) + '&DateTo=' + (DateTo == null ? '' : encodeURIComponent(DateTo)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Allows you to create one or more purchase orders + * Put PurchaseOrders + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {PurchaseOrders} requestBody PurchaseOrders with an array of PurchaseOrder object in body of request + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + CreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { + return this.http.put(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update or create one or more purchase orders + * Post PurchaseOrders + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + UpdateOrCreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { + return this.http.post(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve purchase orders as PDF files + * Get PurchaseOrders/{PurchaseOrderID}/pdf + * @param {string} PurchaseOrderID Unique identifier for an Purchase Order + * @return {void} Success - return response of byte array pdf version of specified Purchase Orders + */ + GetPurchaseOrderAsPdf(PurchaseOrderID: string): Observable> { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a specified purchase orders + * Get PurchaseOrders/{PurchaseOrderID} + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + GetPurchaseOrder(PurchaseOrderID: string): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), {}); + } + + /** + * Allows you to update a specified purchase order + * Post PurchaseOrders/{PurchaseOrderID} + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for updated PurchaseOrder + */ + UpdatePurchaseOrder(PurchaseOrderID: string, requestBody: PurchaseOrders): Observable { + return this.http.post(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified purchase orders + * Get PurchaseOrders/{PurchaseOrderNumber} + * @param {string} PurchaseOrderNumber Unique identifier for a PurchaseOrder + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + GetPurchaseOrderByNumber(PurchaseOrderNumber: string): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderNumber == null ? '' : encodeURIComponent(PurchaseOrderNumber)), {}); + } + + /** + * Allows you to retrieve history for PurchaseOrder + * Get PurchaseOrders/{PurchaseOrderID}/History + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetPurchaseOrderHistory(PurchaseOrderID: string): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', {}); + } + + /** + * Allows you to create HistoryRecord for purchase orders + * Put PurchaseOrders/{PurchaseOrderID}/History + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreatePurchaseOrderHistory(PurchaseOrderID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any sales quotes + * Get Quotes + * @param {Date} DateFrom Filter for quotes after a particular date + * Type: DateOnly + * @param {Date} DateTo Filter for quotes before a particular date + * Type: DateOnly + * @param {Date} ExpiryDateFrom Filter for quotes expiring after a particular date + * Type: DateOnly + * @param {Date} ExpiryDateTo Filter for quotes before a particular date + * Type: DateOnly + * @param {string} ContactID Filter for quotes belonging to a particular contact + * @param {string} Status Filter for quotes of a particular Status + * @param {number} page e.g. page=1 � Up to 100 Quotes will be returned in a single API call with line items shown for each quote + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} order Order by an any element + * @return {Quotes} Success - return response of type quotes array with all quotes + */ + GetQuotes(DateFrom: Date | null | undefined, DateTo: Date | null | undefined, ExpiryDateFrom: Date | null | undefined, ExpiryDateTo: Date | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, page: number | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Quotes?DateFrom=' + DateFrom?.toISOString() + '&DateTo=' + DateTo?.toISOString() + '&ExpiryDateFrom=' + ExpiryDateFrom?.toISOString() + '&ExpiryDateTo=' + ExpiryDateTo?.toISOString() + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&page=' + page + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create one or more quotes + * Put Quotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Quotes} requestBody Quotes with an array of Quote object in body of request + * @return {Quotes} Success - return response of type Quotes with array with newly created Quote + */ + CreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { + return this.http.put(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more quotes + * Post Quotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @return {Quotes} Success - return response of type Quotes array with updated or created Quote + */ + UpdateOrCreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { + return this.http.post(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified quote + * Get Quotes/{QuoteID} + * @param {string} QuoteID Unique identifier for an Quote + * @return {Quotes} Success - return response of type Quotes array with specified Quote + */ + GetQuote(QuoteID: string): Observable { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), {}); + } + + /** + * Allows you to update a specified quote + * Post Quotes/{QuoteID} + * @param {string} QuoteID Unique identifier for an Quote + * @return {Quotes} Success - return response of type Quotes array with updated Quote + */ + UpdateQuote(QuoteID: string, requestBody: Quotes): Observable { + return this.http.post(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an quote + * Get Quotes/{QuoteID}/History + * @param {string} QuoteID Unique identifier for an Quote + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetQuoteHistory(QuoteID: string): Observable { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an quote + * Put Quotes/{QuoteID}/History + * @param {string} QuoteID Unique identifier for an Quote + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateQuoteHistory(QuoteID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve quotes as PDF files + * Get Quotes/{QuoteID}/pdf + * @param {string} QuoteID Unique identifier for an Quote + * @return {void} Success - return response of byte array pdf version of specified Quotes + */ + GetQuoteAsPdf(QuoteID: string): Observable> { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments for Quotes + * Get Quotes/{QuoteID}/Attachments + * @param {string} QuoteID Unique identifier for Quote object + * @return {Attachments} Success - return response of type Attachments array of Attachment + */ + GetQuoteAttachments(QuoteID: string): Observable { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve specific Attachment on Quote + * Get Quotes/{QuoteID}/Attachments/{AttachmentID} + * @param {string} QuoteID Unique identifier for Quote object + * @param {string} AttachmentID Unique identifier for Attachment object + * @return {void} Success - return response of attachment for Quote as binary data + */ + GetQuoteAttachmentById(QuoteID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachment on Quote by Filename + * Get Quotes/{QuoteID}/Attachments/{FileName} + * @param {string} QuoteID Unique identifier for Quote object + * @param {string} FileName Name of the attachment + * @return {void} Success - return response of attachment for Quote as binary data + */ + GetQuoteAttachmentByFileName(QuoteID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve draft expense claim receipts for any user + * Get Receipts + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Receipts} Success - return response of type Receipts array for all Receipt + */ + GetReceipts(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Receipts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create draft expense claim receipts for any user + * Put Receipts + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {Receipts} requestBody Receipts with an array of Receipt object in body of request + * @return {Receipts} Success - return response of type Receipts array for newly created Receipt + */ + CreateReceipt(unitdp: number | null | undefined, requestBody: Receipts): Observable { + return this.http.put(this.baseUri + 'Receipts?unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified draft expense claim receipts + * Get Receipts/{ReceiptID} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Receipts} Success - return response of type Receipts array for a specified Receipt + */ + GetReceipt(ReceiptID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to retrieve a specified draft expense claim receipts + * Post Receipts/{ReceiptID} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Receipts} Success - return response of type Receipts array for updated Receipt + */ + UpdateReceipt(ReceiptID: string, unitdp: number | null | undefined, requestBody: Receipts): Observable { + return this.http.post(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve Attachments for expense claim receipts + * Get Receipts/{ReceiptID}/Attachments + * @param {string} ReceiptID Unique identifier for a Receipt + * @return {Attachments} Success - return response of type Attachments array of Attachments for a specified Receipt + */ + GetReceiptAttachments(ReceiptID: string): Observable { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on expense claim receipts by ID + * Get Receipts/{ReceiptID}/Attachments/{AttachmentID} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Receipt as binary data + */ + GetReceiptAttachmentById(ReceiptID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on expense claim receipts by file name + * Get Receipts/{ReceiptID}/Attachments/{FileName} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {string} FileName The name of the file being attached to the Receipt + * @return {void} Success - return response of attachment for Receipt as binary data + */ + GetReceiptAttachmentByFileName(ReceiptID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a history records of an Receipt + * Get Receipts/{ReceiptID}/History + * @param {string} ReceiptID Unique identifier for a Receipt + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetReceiptHistory(ReceiptID: string): Observable { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an Receipt + * Put Receipts/{ReceiptID}/History + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateReceiptHistory(ReceiptID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any repeating invoices + * Get RepeatingInvoices + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array for all Repeating Invoice + */ + GetRepeatingInvoices(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to retrieve a specified repeating invoice + * Get RepeatingInvoices/{RepeatingInvoiceID} + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array with a specified Repeating Invoice + */ + GetRepeatingInvoice(RepeatingInvoiceID: string): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)), {}); + } + + /** + * Allows you to retrieve Attachments on repeating invoice + * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @return {Attachments} Success - return response of type Attachments array with all Attachments for a specified Repeating Invoice + */ + GetRepeatingInvoiceAttachments(RepeatingInvoiceID: string): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve a specified Attachments on repeating invoices + * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID} + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Repeating Invoice as binary data + */ + GetRepeatingInvoiceAttachmentById(RepeatingInvoiceID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve specified attachment on repeating invoices by file name + * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @param {string} FileName The name of the file being attached to a Repeating Invoice + * @return {void} Success - return response of attachment for Repeating Invoice as binary data + */ + GetRepeatingInvoiceAttachmentByFileName(RepeatingInvoiceID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history for a repeating invoice + * Get RepeatingInvoices/{RepeatingInvoiceID}/History + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetRepeatingInvoiceHistory(RepeatingInvoiceID: string): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', {}); + } + + /** + * Allows you to create history for a repeating invoice + * Put RepeatingInvoices/{RepeatingInvoiceID}/History + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateRepeatingInvoiceHistory(RepeatingInvoiceID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve report for TenNinetyNine + * Get Reports/TenNinetyNine + * @param {string} reportYear The year of the 1099 report + * @return {Reports} Success - return response of type Reports + */ + GetReportTenNinetyNine(reportYear: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/TenNinetyNine?reportYear=' + (reportYear == null ? '' : encodeURIComponent(reportYear)), {}); + } + + /** + * Allows you to retrieve report for AgedPayablesByContact + * Get Reports/AgedPayablesByContact + * @param {string} contactId Unique identifier for a Contact + * @param {Date} date The date of the Aged Payables By Contact report + * Type: DateOnly + * @param {Date} fromDate The from date of the Aged Payables By Contact report + * Type: DateOnly + * @param {Date} toDate The to date of the Aged Payables By Contact report + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportAgedPayablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/AgedPayablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for AgedReceivablesByContact + * Get Reports/AgedReceivablesByContact + * @param {string} contactId Unique identifier for a Contact + * @param {Date} date The date of the Aged Receivables By Contact report + * Type: DateOnly + * @param {Date} fromDate The from date of the Aged Receivables By Contact report + * Type: DateOnly + * @param {Date} toDate The to date of the Aged Receivables By Contact report + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportAgedReceivablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/AgedReceivablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for BalanceSheet + * Get Reports/BalanceSheet + * @param {string} date The date of the Balance Sheet report + * @param {number} periods The number of periods for the Balance Sheet report + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param {string} trackingOptionID1 The tracking option 1 for the Balance Sheet report + * @param {string} trackingOptionID2 The tracking option 2 for the Balance Sheet report + * @param {boolean} standardLayout The standard layout boolean for the Balance Sheet report + * @param {boolean} paymentsOnly return a cash basis for the Balance Sheet report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBalanceSheet(date: string | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingOptionID1: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/BalanceSheet?date=' + (date == null ? '' : encodeURIComponent(date)) + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingOptionID1=' + (trackingOptionID1 == null ? '' : encodeURIComponent(trackingOptionID1)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve report for BankSummary + * Get Reports/BankSummary + * @param {Date} fromDate The from date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @param {Date} toDate The to date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBankSummary(fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/BankSummary?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for BAS only valid for AU orgs + * Get Reports + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBASorGSTList(): Observable { + return this.http.get(this.baseUri + 'Reports', {}); + } + + /** + * Allows you to retrieve report for BAS only valid for AU orgs + * Get Reports/{ReportID} + * @param {string} ReportID Unique identifier for a Report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBASorGST(ReportID: string): Observable { + return this.http.get(this.baseUri + 'Reports/' + (ReportID == null ? '' : encodeURIComponent(ReportID)), {}); + } + + /** + * Allows you to retrieve report for Budget Summary + * Get Reports/BudgetSummary + * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @param {number} period The number of periods to compare (integer between 1 and 12) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} timeframe The period size to compare to (1=month, 3=quarter, 12=year) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {ReportWithRows} success- return a Report with Rows object + */ + GetReportBudgetSummary(date: Date | null | undefined, period: number | null | undefined, timeframe: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/BudgetSummary?date=' + date?.toISOString() + '&period=' + period + '&timeframe=' + timeframe, {}); + } + + /** + * Allows you to retrieve report for ExecutiveSummary + * Get Reports/ExecutiveSummary + * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportExecutiveSummary(date: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/ExecutiveSummary?date=' + date?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for ProfitAndLoss + * Get Reports/ProfitAndLoss + * @param {Date} fromDate The from date for the ProfitAndLoss report e.g. 2018-03-31 + * Type: DateOnly + * @param {Date} toDate The to date for the ProfitAndLoss report e.g. 2018-03-31 + * Type: DateOnly + * @param {number} periods The number of periods to compare (integer between 1 and 12) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param {string} trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report + * @param {string} trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report + * @param {string} trackingOptionID The tracking option 1 for the ProfitAndLoss report + * @param {string} trackingOptionID2 The tracking option 2 for the ProfitAndLoss report + * @param {boolean} standardLayout Return the standard layout for the ProfitAndLoss report + * @param {boolean} paymentsOnly Return cash only basis for the ProfitAndLoss report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportProfitAndLoss(fromDate: Date | null | undefined, toDate: Date | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingCategoryID: string | null | undefined, trackingCategoryID2: string | null | undefined, trackingOptionID: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/ProfitAndLoss?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString() + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingCategoryID=' + (trackingCategoryID == null ? '' : encodeURIComponent(trackingCategoryID)) + '&trackingCategoryID2=' + (trackingCategoryID2 == null ? '' : encodeURIComponent(trackingCategoryID2)) + '&trackingOptionID=' + (trackingOptionID == null ? '' : encodeURIComponent(trackingOptionID)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve report for TrialBalance + * Get Reports/TrialBalance + * @param {Date} date The date for the Trial Balance report e.g. 2018-03-31 + * Type: DateOnly + * @param {boolean} paymentsOnly Return cash only basis for the Trial Balance report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportTrialBalance(date: Date | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/TrialBalance?date=' + date?.toISOString() + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve Tax Rates + * Get TaxRates + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {string} TaxType Filter by tax type + * @return {TaxRates} Success - return response of type TaxRates array with TaxRates + */ + GetTaxRates(where: string | null | undefined, order: string | null | undefined, TaxType: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'TaxRates?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&TaxType=' + (TaxType == null ? '' : encodeURIComponent(TaxType)), {}); + } + + /** + * Allows you to create one or more Tax Rates + * Put TaxRates + * @param {TaxRates} requestBody TaxRates array with TaxRate object in body of request + * @return {TaxRates} Success - return response of type TaxRates array newly created TaxRate + */ + CreateTaxRates(requestBody: TaxRates): Observable { + return this.http.put(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update Tax Rates + * Post TaxRates + * @return {TaxRates} Success - return response of type TaxRates array updated TaxRate + */ + UpdateTaxRate(requestBody: TaxRates): Observable { + return this.http.post(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve tracking categories and options + * Get TrackingCategories + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {boolean} includeArchived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response + * @return {TrackingCategories} Success - return response of type TrackingCategories array of TrackingCategory + */ + GetTrackingCategories(where: string | null | undefined, order: string | null | undefined, includeArchived: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'TrackingCategories?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&includeArchived=' + includeArchived, {}); + } + + /** + * Allows you to create tracking categories + * Put TrackingCategories + * @param {TrackingCategory} requestBody TrackingCategory object in body of request + * @return {TrackingCategories} Success - return response of type TrackingCategories array of newly created TrackingCategory + */ + CreateTrackingCategory(requestBody: TrackingCategory): Observable { + return this.http.put(this.baseUri + 'TrackingCategories', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve tracking categories and options for specified category + * Get TrackingCategories/{TrackingCategoryID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @return {TrackingCategories} Success - return response of type TrackingCategories array of specified TrackingCategory + */ + GetTrackingCategory(TrackingCategoryID: string): Observable { + return this.http.get(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); + } + + /** + * Allows you to update tracking categories + * Post TrackingCategories/{TrackingCategoryID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @return {TrackingCategories} Success - return response of type TrackingCategories array of updated TrackingCategory + */ + UpdateTrackingCategory(TrackingCategoryID: string, requestBody: TrackingCategory): Observable { + return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete tracking categories + * Delete TrackingCategories/{TrackingCategoryID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @return {TrackingCategories} Success - return response of type TrackingCategories array of deleted TrackingCategory + */ + DeleteTrackingCategory(TrackingCategoryID: string): Observable { + return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); + } + + /** + * Allows you to create options for a specified tracking category + * Put TrackingCategories/{TrackingCategoryID}/Options + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @param {TrackingOption} requestBody TrackingOption object in body of request + * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category + */ + CreateTrackingOptions(TrackingCategoryID: string, requestBody: TrackingOption): Observable { + return this.http.put(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update options for a specified tracking category + * Post TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @param {string} TrackingOptionID Unique identifier for a Tracking Option + * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category + */ + UpdateTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string, requestBody: TrackingOption): Observable { + return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a specified option for a specified tracking category + * Delete TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @param {string} TrackingOptionID Unique identifier for a Tracking Option + * @return {TrackingOptions} Success - return response of type TrackingOptions array of remaining options for a specified category + */ + DeleteTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string): Observable { + return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), {}); + } + + /** + * Allows you to retrieve users + * Get Users + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Users} Success - return response of type Users array of all User + */ + GetUsers(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Users?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to retrieve a specified user + * Get Users/{UserID} + * @param {string} UserID Unique identifier for a User + * @return {Users} Success - return response of type Users array of specified User + */ + GetUser(UserID: string): Observable { + return this.http.get(this.baseUri + 'Users/' + (UserID == null ? '' : encodeURIComponent(UserID)), {}); + } + } + + export enum GetReportBalanceSheetTimeframe { MONTH = 0, QUARTER = 1, YEAR = 2 } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/xero_assets.txt b/Tests/SwagTsTests/NG2FormGroupResults/xero_assets.ts similarity index 96% rename from Tests/SwagTsTests/NG2FormGroupResults/xero_assets.txt rename to Tests/SwagTsTests/NG2FormGroupResults/xero_assets.ts index 76f12d1e..7339d76f 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/xero_assets.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/xero_assets.ts @@ -1,760 +1,760 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface Assets { - pagination?: Pagination; - items?: Array; - } - export interface AssetsFormProperties { - } - export function CreateAssetsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Asset { - - /** The Xero-generated Id for the asset */ - assetId?: string | null; - - /** - * The name of the asset - * Required - */ - assetName: string; - - /** The Xero-generated Id for the asset type */ - assetTypeId?: string | null; - - /** Must be unique. */ - assetNumber?: string | null; - - /** - * The date the asset was purchased YYYY-MM-DD - * Type: DateOnly - */ - purchaseDate?: Date | null; - - /** - * The purchase price of the asset - * Type: double - */ - purchasePrice?: number | null; - - /** - * The price the asset was disposed at - * Type: double - */ - disposalPrice?: number | null; - - /** See Asset Status Codes. */ - assetStatus?: AssetAssetStatus | null; - - /** The date the asset’s warranty expires (if needed) YYYY-MM-DD */ - warrantyExpiryDate?: string | null; - - /** The asset's serial number */ - serialNumber?: string | null; - bookDepreciationSetting?: BookDepreciationSetting; - bookDepreciationDetail?: BookDepreciationDetail; - - /** Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. */ - canRollback?: boolean | null; - - /** - * The accounting value of the asset - * Type: double - */ - accountingBookValue?: number | null; - - /** Boolean to indicate whether delete is enabled */ - isDeleteEnabledForDate?: boolean | null; - } - export interface AssetFormProperties { - - /** The Xero-generated Id for the asset */ - assetId: FormControl, - - /** - * The name of the asset - * Required - */ - assetName: FormControl, - - /** The Xero-generated Id for the asset type */ - assetTypeId: FormControl, - - /** Must be unique. */ - assetNumber: FormControl, - - /** - * The date the asset was purchased YYYY-MM-DD - * Type: DateOnly - */ - purchaseDate: FormControl, - - /** - * The purchase price of the asset - * Type: double - */ - purchasePrice: FormControl, - - /** - * The price the asset was disposed at - * Type: double - */ - disposalPrice: FormControl, - - /** See Asset Status Codes. */ - assetStatus: FormControl, - - /** The date the asset’s warranty expires (if needed) YYYY-MM-DD */ - warrantyExpiryDate: FormControl, - - /** The asset's serial number */ - serialNumber: FormControl, - - /** Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. */ - canRollback: FormControl, - - /** - * The accounting value of the asset - * Type: double - */ - accountingBookValue: FormControl, - - /** Boolean to indicate whether delete is enabled */ - isDeleteEnabledForDate: FormControl, - } - export function CreateAssetFormGroup() { - return new FormGroup({ - assetId: new FormControl(undefined), - assetName: new FormControl(undefined, [Validators.required]), - assetTypeId: new FormControl(undefined), - assetNumber: new FormControl(undefined), - purchaseDate: new FormControl(undefined), - purchasePrice: new FormControl(undefined), - disposalPrice: new FormControl(undefined), - assetStatus: new FormControl(undefined), - warrantyExpiryDate: new FormControl(undefined), - serialNumber: new FormControl(undefined), - canRollback: new FormControl(undefined), - accountingBookValue: new FormControl(undefined), - isDeleteEnabledForDate: new FormControl(undefined), - }); - - } - - export enum AssetAssetStatus { Draft = 0, Registered = 1, Disposed = 2 } - - export interface Pagination { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - page?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageSize?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageCount?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - itemCount?: number | null; - } - export interface PaginationFormProperties { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - page: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageSize: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageCount: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - itemCount: FormControl, - } - export function CreatePaginationFormGroup() { - return new FormGroup({ - page: new FormControl(undefined), - pageSize: new FormControl(undefined), - pageCount: new FormControl(undefined), - itemCount: new FormControl(undefined), - }); - - } - - - /** See Asset Status Codes. */ - export enum AssetStatus { Draft = 0, Registered = 1, Disposed = 2 } - - - /** See Asset Status Codes. */ - export enum AssetStatusQueryParam { DRAFT = 0, REGISTERED = 1, DISPOSED = 2 } - - export interface AssetType { - - /** Xero generated unique identifier for asset types */ - assetTypeId?: string | null; - - /** - * The name of the asset type - * Required - */ - assetTypeName: string; - - /** The asset account for fixed assets of this type */ - fixedAssetAccountId?: string | null; - - /** The expense account for the depreciation of fixed assets of this type */ - depreciationExpenseAccountId?: string | null; - - /** The account for accumulated depreciation of fixed assets of this type */ - accumulatedDepreciationAccountId?: string | null; - - /** Required */ - bookDepreciationSetting: BookDepreciationSetting; - - /** - * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - locks?: number | null; - } - export interface AssetTypeFormProperties { - - /** Xero generated unique identifier for asset types */ - assetTypeId: FormControl, - - /** - * The name of the asset type - * Required - */ - assetTypeName: FormControl, - - /** The asset account for fixed assets of this type */ - fixedAssetAccountId: FormControl, - - /** The expense account for the depreciation of fixed assets of this type */ - depreciationExpenseAccountId: FormControl, - - /** The account for accumulated depreciation of fixed assets of this type */ - accumulatedDepreciationAccountId: FormControl, - - /** - * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - locks: FormControl, - } - export function CreateAssetTypeFormGroup() { - return new FormGroup({ - assetTypeId: new FormControl(undefined), - assetTypeName: new FormControl(undefined, [Validators.required]), - fixedAssetAccountId: new FormControl(undefined), - depreciationExpenseAccountId: new FormControl(undefined), - accumulatedDepreciationAccountId: new FormControl(undefined), - locks: new FormControl(undefined), - }); - - } - - export interface BookDepreciationSetting { - - /** The method of depreciation applied to this asset. See Depreciation Methods */ - depreciationMethod?: BookDepreciationSettingDepreciationMethod | null; - - /** The method of averaging applied to this asset. See Averaging Methods */ - averagingMethod?: BookDepreciationSettingAveragingMethod | null; - - /** - * The rate of depreciation (e.g. 0.05) - * Type: double - */ - depreciationRate?: number | null; - - /** - * Effective life of the asset in years (e.g. 5) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - effectiveLifeYears?: number | null; - - /** See Depreciation Calculation Methods */ - depreciationCalculationMethod?: BookDepreciationSettingDepreciationCalculationMethod | null; - - /** Unique Xero identifier for the depreciable object */ - depreciableObjectId?: string | null; - - /** The type of asset object */ - depreciableObjectType?: string | null; - - /** Unique Xero identifier for the effective date change */ - bookEffectiveDateOfChangeId?: string | null; - } - export interface BookDepreciationSettingFormProperties { - - /** The method of depreciation applied to this asset. See Depreciation Methods */ - depreciationMethod: FormControl, - - /** The method of averaging applied to this asset. See Averaging Methods */ - averagingMethod: FormControl, - - /** - * The rate of depreciation (e.g. 0.05) - * Type: double - */ - depreciationRate: FormControl, - - /** - * Effective life of the asset in years (e.g. 5) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - effectiveLifeYears: FormControl, - - /** See Depreciation Calculation Methods */ - depreciationCalculationMethod: FormControl, - - /** Unique Xero identifier for the depreciable object */ - depreciableObjectId: FormControl, - - /** The type of asset object */ - depreciableObjectType: FormControl, - - /** Unique Xero identifier for the effective date change */ - bookEffectiveDateOfChangeId: FormControl, - } - export function CreateBookDepreciationSettingFormGroup() { - return new FormGroup({ - depreciationMethod: new FormControl(undefined), - averagingMethod: new FormControl(undefined), - depreciationRate: new FormControl(undefined), - effectiveLifeYears: new FormControl(undefined), - depreciationCalculationMethod: new FormControl(undefined), - depreciableObjectId: new FormControl(undefined), - depreciableObjectType: new FormControl(undefined), - bookEffectiveDateOfChangeId: new FormControl(undefined), - }); - - } - - export enum BookDepreciationSettingDepreciationMethod { NoDepreciation = 0, StraightLine = 1, DiminishingValue100 = 2, DiminishingValue150 = 3, DiminishingValue200 = 4, FullDepreciation = 5 } - - export enum BookDepreciationSettingAveragingMethod { FullMonth = 0, ActualDays = 1 } - - export enum BookDepreciationSettingDepreciationCalculationMethod { Rate = 0, Life = 1, None = 2 } - - export interface BookDepreciationDetail { - - /** - * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. - * Type: double - */ - currentCapitalGain?: number | null; - - /** - * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. - * Type: double - */ - currentGainLoss?: number | null; - - /** - * YYYY-MM-DD - * Type: DateOnly - */ - depreciationStartDate?: Date | null; - - /** - * The value of the asset you want to depreciate, if this is less than the cost of the asset. - * Type: double - */ - costLimit?: number | null; - - /** - * The value of the asset remaining when you've fully depreciated it. - * Type: double - */ - residualValue?: number | null; - - /** - * All depreciation prior to the current financial year. - * Type: double - */ - priorAccumDepreciationAmount?: number | null; - - /** - * All depreciation occurring in the current financial year. - * Type: double - */ - currentAccumDepreciationAmount?: number | null; - } - export interface BookDepreciationDetailFormProperties { - - /** - * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. - * Type: double - */ - currentCapitalGain: FormControl, - - /** - * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. - * Type: double - */ - currentGainLoss: FormControl, - - /** - * YYYY-MM-DD - * Type: DateOnly - */ - depreciationStartDate: FormControl, - - /** - * The value of the asset you want to depreciate, if this is less than the cost of the asset. - * Type: double - */ - costLimit: FormControl, - - /** - * The value of the asset remaining when you've fully depreciated it. - * Type: double - */ - residualValue: FormControl, - - /** - * All depreciation prior to the current financial year. - * Type: double - */ - priorAccumDepreciationAmount: FormControl, - - /** - * All depreciation occurring in the current financial year. - * Type: double - */ - currentAccumDepreciationAmount: FormControl, - } - export function CreateBookDepreciationDetailFormGroup() { - return new FormGroup({ - currentCapitalGain: new FormControl(undefined), - currentGainLoss: new FormControl(undefined), - depreciationStartDate: new FormControl(undefined), - costLimit: new FormControl(undefined), - residualValue: new FormControl(undefined), - priorAccumDepreciationAmount: new FormControl(undefined), - currentAccumDepreciationAmount: new FormControl(undefined), - }); - - } - - export interface Setting { - - /** The prefix used for fixed asset numbers (“FA-” by default) */ - assetNumberPrefix?: string | null; - - /** The next available sequence number */ - assetNumberSequence?: string | null; - - /** - * The date depreciation calculations started on registered fixed assets in Xero - * Type: DateOnly - */ - assetStartDate?: Date | null; - - /** - * The last depreciation date - * Type: DateOnly - */ - lastDepreciationDate?: Date | null; - - /** Default account that gains are posted to */ - defaultGainOnDisposalAccountId?: string | null; - - /** Default account that losses are posted to */ - defaultLossOnDisposalAccountId?: string | null; - - /** Default account that capital gains are posted to */ - defaultCapitalGainOnDisposalAccountId?: string | null; - - /** opt in for tax calculation */ - optInForTax?: boolean | null; - } - export interface SettingFormProperties { - - /** The prefix used for fixed asset numbers (“FA-” by default) */ - assetNumberPrefix: FormControl, - - /** The next available sequence number */ - assetNumberSequence: FormControl, - - /** - * The date depreciation calculations started on registered fixed assets in Xero - * Type: DateOnly - */ - assetStartDate: FormControl, - - /** - * The last depreciation date - * Type: DateOnly - */ - lastDepreciationDate: FormControl, - - /** Default account that gains are posted to */ - defaultGainOnDisposalAccountId: FormControl, - - /** Default account that losses are posted to */ - defaultLossOnDisposalAccountId: FormControl, - - /** Default account that capital gains are posted to */ - defaultCapitalGainOnDisposalAccountId: FormControl, - - /** opt in for tax calculation */ - optInForTax: FormControl, - } - export function CreateSettingFormGroup() { - return new FormGroup({ - assetNumberPrefix: new FormControl(undefined), - assetNumberSequence: new FormControl(undefined), - assetStartDate: new FormControl(undefined), - lastDepreciationDate: new FormControl(undefined), - defaultGainOnDisposalAccountId: new FormControl(undefined), - defaultLossOnDisposalAccountId: new FormControl(undefined), - defaultCapitalGainOnDisposalAccountId: new FormControl(undefined), - optInForTax: new FormControl(undefined), - }); - - } - - export interface Error { - - /** Array of elements of resource validation errors */ - resourceValidationErrors?: Array; - - /** Array of elements of field validation errors */ - fieldValidationErrors?: Array; - - /** The internal type of error, not accessible externally */ - type?: string | null; - - /** Title of the error */ - title?: string | null; - - /** Detail of the error */ - detail?: string | null; - } - export interface ErrorFormProperties { - - /** The internal type of error, not accessible externally */ - type: FormControl, - - /** Title of the error */ - title: FormControl, - - /** Detail of the error */ - detail: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - type: new FormControl(undefined), - title: new FormControl(undefined), - detail: new FormControl(undefined), - }); - - } - - export interface ResourceValidationErrorsElement { - - /** The field name of the erroneous field */ - resourceName?: string | null; - - /** Explaination of the resource validation error */ - localisedMessage?: string | null; - - /** Internal type of the resource error message */ - type?: string | null; - - /** Title of the resource validation error */ - title?: string | null; - - /** Detail of the resource validation error */ - detail?: string | null; - } - export interface ResourceValidationErrorsElementFormProperties { - - /** The field name of the erroneous field */ - resourceName: FormControl, - - /** Explaination of the resource validation error */ - localisedMessage: FormControl, - - /** Internal type of the resource error message */ - type: FormControl, - - /** Title of the resource validation error */ - title: FormControl, - - /** Detail of the resource validation error */ - detail: FormControl, - } - export function CreateResourceValidationErrorsElementFormGroup() { - return new FormGroup({ - resourceName: new FormControl(undefined), - localisedMessage: new FormControl(undefined), - type: new FormControl(undefined), - title: new FormControl(undefined), - detail: new FormControl(undefined), - }); - - } - - export interface FieldValidationErrorsElement { - - /** The field name of the erroneous field */ - fieldName?: string | null; - - /** The provided value */ - valueProvided?: string | null; - - /** Explaination of the field validation error */ - localisedMessage?: string | null; - - /** Internal type of the field validation error message */ - type?: string | null; - - /** Title of the field validation error */ - title?: string | null; - - /** Detail of the field validation error */ - detail?: string | null; - } - export interface FieldValidationErrorsElementFormProperties { - - /** The field name of the erroneous field */ - fieldName: FormControl, - - /** The provided value */ - valueProvided: FormControl, - - /** Explaination of the field validation error */ - localisedMessage: FormControl, - - /** Internal type of the field validation error message */ - type: FormControl, - - /** Title of the field validation error */ - title: FormControl, - - /** Detail of the field validation error */ - detail: FormControl, - } - export function CreateFieldValidationErrorsElementFormGroup() { - return new FormGroup({ - fieldName: new FormControl(undefined), - valueProvided: new FormControl(undefined), - localisedMessage: new FormControl(undefined), - type: new FormControl(undefined), - title: new FormControl(undefined), - detail: new FormControl(undefined), - }); - - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches fixed asset - * By passing in the appropriate options, you can search for available fixed asset in the system - * Get Assets - * @param {AssetStatusQueryParam} status Required when retrieving a collection of assets. See Asset Status Codes - * @param {number} page Results are paged. This specifies which page of the results to return. The default page is 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} pageSize The number of records returned per page. By default the number of records returned is 10. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {GetAssetsOrderBy} orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. - * @param {GetAssetsSortDirection} sortDirection ASC or DESC - * @param {GetAssetsFilterBy} filterBy A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. - * @return {Assets} search results matching criteria - */ - GetAssets(status: AssetStatusQueryParam, page: number | null | undefined, pageSize: number | null | undefined, orderBy: GetAssetsOrderBy | null | undefined, sortDirection: GetAssetsSortDirection | null | undefined, filterBy: GetAssetsFilterBy | null | undefined): Observable { - return this.http.get(this.baseUri + 'Assets?status=' + status + '&page=' + page + '&pageSize=' + pageSize + '&orderBy=' + orderBy + '&sortDirection=' + sortDirection + '&filterBy=' + filterBy, {}); - } - - /** - * adds a fixed asset - * Adds an asset to the system - * Post Assets - * @param {Asset} requestBody Fixed asset you are creating - * @return {Asset} return single object - create new asset - */ - CreateAsset(requestBody: Asset): Observable { - return this.http.post(this.baseUri + 'Assets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieves fixed asset by id - * By passing in the appropriate asset id, you can search for - * a specific fixed asset in the system - * Get Assets/{id} - * @param {string} id fixed asset id for single object - * @return {Asset} search results matching criteria - */ - GetAssetById(id: string): Observable { - return this.http.get(this.baseUri + 'Assets/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * searches fixed asset types - * By passing in the appropriate options, you can search for available fixed asset types in the system - * Get AssetTypes - * @return {Array} search results matching criteria - */ - GetAssetTypes(): Observable> { - return this.http.get>(this.baseUri + 'AssetTypes', {}); - } - - /** - * adds a fixed asset type - * Adds an fixed asset type to the system - * Post AssetTypes - * @param {AssetType} requestBody Asset type to add - * @return {AssetType} results single object - created fixed type - */ - CreateAssetType(requestBody: AssetType): Observable { - return this.http.post(this.baseUri + 'AssetTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches fixed asset settings - * By passing in the appropriate options, you can search for available fixed asset types in the system - * Get Settings - * @return {Setting} search results matching criteria - */ - GetAssetSettings(): Observable { - return this.http.get(this.baseUri + 'Settings', {}); - } - } - - export enum GetAssetsOrderBy { AssetType = 0, AssetName = 1, AssetNumber = 2, PurchaseDate = 3, PurchasePrice = 4, DisposalDate = 5, DisposalPrice = 6 } - - export enum GetAssetsSortDirection { asc = 0, desc = 1 } - - export enum GetAssetsFilterBy { AssetName = 0, AssetNumber = 1, Description = 2, AssetTypeName = 3 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface Assets { + pagination?: Pagination; + items?: Array; + } + export interface AssetsFormProperties { + } + export function CreateAssetsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Asset { + + /** The Xero-generated Id for the asset */ + assetId?: string | null; + + /** + * The name of the asset + * Required + */ + assetName: string; + + /** The Xero-generated Id for the asset type */ + assetTypeId?: string | null; + + /** Must be unique. */ + assetNumber?: string | null; + + /** + * The date the asset was purchased YYYY-MM-DD + * Type: DateOnly + */ + purchaseDate?: Date | null; + + /** + * The purchase price of the asset + * Type: double + */ + purchasePrice?: number | null; + + /** + * The price the asset was disposed at + * Type: double + */ + disposalPrice?: number | null; + + /** See Asset Status Codes. */ + assetStatus?: AssetAssetStatus | null; + + /** The date the asset’s warranty expires (if needed) YYYY-MM-DD */ + warrantyExpiryDate?: string | null; + + /** The asset's serial number */ + serialNumber?: string | null; + bookDepreciationSetting?: BookDepreciationSetting; + bookDepreciationDetail?: BookDepreciationDetail; + + /** Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. */ + canRollback?: boolean | null; + + /** + * The accounting value of the asset + * Type: double + */ + accountingBookValue?: number | null; + + /** Boolean to indicate whether delete is enabled */ + isDeleteEnabledForDate?: boolean | null; + } + export interface AssetFormProperties { + + /** The Xero-generated Id for the asset */ + assetId: FormControl, + + /** + * The name of the asset + * Required + */ + assetName: FormControl, + + /** The Xero-generated Id for the asset type */ + assetTypeId: FormControl, + + /** Must be unique. */ + assetNumber: FormControl, + + /** + * The date the asset was purchased YYYY-MM-DD + * Type: DateOnly + */ + purchaseDate: FormControl, + + /** + * The purchase price of the asset + * Type: double + */ + purchasePrice: FormControl, + + /** + * The price the asset was disposed at + * Type: double + */ + disposalPrice: FormControl, + + /** See Asset Status Codes. */ + assetStatus: FormControl, + + /** The date the asset’s warranty expires (if needed) YYYY-MM-DD */ + warrantyExpiryDate: FormControl, + + /** The asset's serial number */ + serialNumber: FormControl, + + /** Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. */ + canRollback: FormControl, + + /** + * The accounting value of the asset + * Type: double + */ + accountingBookValue: FormControl, + + /** Boolean to indicate whether delete is enabled */ + isDeleteEnabledForDate: FormControl, + } + export function CreateAssetFormGroup() { + return new FormGroup({ + assetId: new FormControl(undefined), + assetName: new FormControl(undefined, [Validators.required]), + assetTypeId: new FormControl(undefined), + assetNumber: new FormControl(undefined), + purchaseDate: CreateDateOnlyFormControl(), + purchasePrice: new FormControl(undefined), + disposalPrice: new FormControl(undefined), + assetStatus: new FormControl(undefined), + warrantyExpiryDate: new FormControl(undefined), + serialNumber: new FormControl(undefined), + canRollback: new FormControl(undefined), + accountingBookValue: new FormControl(undefined), + isDeleteEnabledForDate: new FormControl(undefined), + }); + + } + + export enum AssetAssetStatus { Draft = 0, Registered = 1, Disposed = 2 } + + export interface Pagination { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + page?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageSize?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageCount?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + itemCount?: number | null; + } + export interface PaginationFormProperties { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + page: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageSize: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageCount: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + itemCount: FormControl, + } + export function CreatePaginationFormGroup() { + return new FormGroup({ + page: new FormControl(undefined), + pageSize: new FormControl(undefined), + pageCount: new FormControl(undefined), + itemCount: new FormControl(undefined), + }); + + } + + + /** See Asset Status Codes. */ + export enum AssetStatus { Draft = 0, Registered = 1, Disposed = 2 } + + + /** See Asset Status Codes. */ + export enum AssetStatusQueryParam { DRAFT = 0, REGISTERED = 1, DISPOSED = 2 } + + export interface AssetType { + + /** Xero generated unique identifier for asset types */ + assetTypeId?: string | null; + + /** + * The name of the asset type + * Required + */ + assetTypeName: string; + + /** The asset account for fixed assets of this type */ + fixedAssetAccountId?: string | null; + + /** The expense account for the depreciation of fixed assets of this type */ + depreciationExpenseAccountId?: string | null; + + /** The account for accumulated depreciation of fixed assets of this type */ + accumulatedDepreciationAccountId?: string | null; + + /** Required */ + bookDepreciationSetting: BookDepreciationSetting; + + /** + * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + locks?: number | null; + } + export interface AssetTypeFormProperties { + + /** Xero generated unique identifier for asset types */ + assetTypeId: FormControl, + + /** + * The name of the asset type + * Required + */ + assetTypeName: FormControl, + + /** The asset account for fixed assets of this type */ + fixedAssetAccountId: FormControl, + + /** The expense account for the depreciation of fixed assets of this type */ + depreciationExpenseAccountId: FormControl, + + /** The account for accumulated depreciation of fixed assets of this type */ + accumulatedDepreciationAccountId: FormControl, + + /** + * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + locks: FormControl, + } + export function CreateAssetTypeFormGroup() { + return new FormGroup({ + assetTypeId: new FormControl(undefined), + assetTypeName: new FormControl(undefined, [Validators.required]), + fixedAssetAccountId: new FormControl(undefined), + depreciationExpenseAccountId: new FormControl(undefined), + accumulatedDepreciationAccountId: new FormControl(undefined), + locks: new FormControl(undefined), + }); + + } + + export interface BookDepreciationSetting { + + /** The method of depreciation applied to this asset. See Depreciation Methods */ + depreciationMethod?: BookDepreciationSettingDepreciationMethod | null; + + /** The method of averaging applied to this asset. See Averaging Methods */ + averagingMethod?: BookDepreciationSettingAveragingMethod | null; + + /** + * The rate of depreciation (e.g. 0.05) + * Type: double + */ + depreciationRate?: number | null; + + /** + * Effective life of the asset in years (e.g. 5) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + effectiveLifeYears?: number | null; + + /** See Depreciation Calculation Methods */ + depreciationCalculationMethod?: BookDepreciationSettingDepreciationCalculationMethod | null; + + /** Unique Xero identifier for the depreciable object */ + depreciableObjectId?: string | null; + + /** The type of asset object */ + depreciableObjectType?: string | null; + + /** Unique Xero identifier for the effective date change */ + bookEffectiveDateOfChangeId?: string | null; + } + export interface BookDepreciationSettingFormProperties { + + /** The method of depreciation applied to this asset. See Depreciation Methods */ + depreciationMethod: FormControl, + + /** The method of averaging applied to this asset. See Averaging Methods */ + averagingMethod: FormControl, + + /** + * The rate of depreciation (e.g. 0.05) + * Type: double + */ + depreciationRate: FormControl, + + /** + * Effective life of the asset in years (e.g. 5) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + effectiveLifeYears: FormControl, + + /** See Depreciation Calculation Methods */ + depreciationCalculationMethod: FormControl, + + /** Unique Xero identifier for the depreciable object */ + depreciableObjectId: FormControl, + + /** The type of asset object */ + depreciableObjectType: FormControl, + + /** Unique Xero identifier for the effective date change */ + bookEffectiveDateOfChangeId: FormControl, + } + export function CreateBookDepreciationSettingFormGroup() { + return new FormGroup({ + depreciationMethod: new FormControl(undefined), + averagingMethod: new FormControl(undefined), + depreciationRate: new FormControl(undefined), + effectiveLifeYears: new FormControl(undefined), + depreciationCalculationMethod: new FormControl(undefined), + depreciableObjectId: new FormControl(undefined), + depreciableObjectType: new FormControl(undefined), + bookEffectiveDateOfChangeId: new FormControl(undefined), + }); + + } + + export enum BookDepreciationSettingDepreciationMethod { NoDepreciation = 0, StraightLine = 1, DiminishingValue100 = 2, DiminishingValue150 = 3, DiminishingValue200 = 4, FullDepreciation = 5 } + + export enum BookDepreciationSettingAveragingMethod { FullMonth = 0, ActualDays = 1 } + + export enum BookDepreciationSettingDepreciationCalculationMethod { Rate = 0, Life = 1, None = 2 } + + export interface BookDepreciationDetail { + + /** + * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. + * Type: double + */ + currentCapitalGain?: number | null; + + /** + * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. + * Type: double + */ + currentGainLoss?: number | null; + + /** + * YYYY-MM-DD + * Type: DateOnly + */ + depreciationStartDate?: Date | null; + + /** + * The value of the asset you want to depreciate, if this is less than the cost of the asset. + * Type: double + */ + costLimit?: number | null; + + /** + * The value of the asset remaining when you've fully depreciated it. + * Type: double + */ + residualValue?: number | null; + + /** + * All depreciation prior to the current financial year. + * Type: double + */ + priorAccumDepreciationAmount?: number | null; + + /** + * All depreciation occurring in the current financial year. + * Type: double + */ + currentAccumDepreciationAmount?: number | null; + } + export interface BookDepreciationDetailFormProperties { + + /** + * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. + * Type: double + */ + currentCapitalGain: FormControl, + + /** + * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. + * Type: double + */ + currentGainLoss: FormControl, + + /** + * YYYY-MM-DD + * Type: DateOnly + */ + depreciationStartDate: FormControl, + + /** + * The value of the asset you want to depreciate, if this is less than the cost of the asset. + * Type: double + */ + costLimit: FormControl, + + /** + * The value of the asset remaining when you've fully depreciated it. + * Type: double + */ + residualValue: FormControl, + + /** + * All depreciation prior to the current financial year. + * Type: double + */ + priorAccumDepreciationAmount: FormControl, + + /** + * All depreciation occurring in the current financial year. + * Type: double + */ + currentAccumDepreciationAmount: FormControl, + } + export function CreateBookDepreciationDetailFormGroup() { + return new FormGroup({ + currentCapitalGain: new FormControl(undefined), + currentGainLoss: new FormControl(undefined), + depreciationStartDate: CreateDateOnlyFormControl(), + costLimit: new FormControl(undefined), + residualValue: new FormControl(undefined), + priorAccumDepreciationAmount: new FormControl(undefined), + currentAccumDepreciationAmount: new FormControl(undefined), + }); + + } + + export interface Setting { + + /** The prefix used for fixed asset numbers (“FA-” by default) */ + assetNumberPrefix?: string | null; + + /** The next available sequence number */ + assetNumberSequence?: string | null; + + /** + * The date depreciation calculations started on registered fixed assets in Xero + * Type: DateOnly + */ + assetStartDate?: Date | null; + + /** + * The last depreciation date + * Type: DateOnly + */ + lastDepreciationDate?: Date | null; + + /** Default account that gains are posted to */ + defaultGainOnDisposalAccountId?: string | null; + + /** Default account that losses are posted to */ + defaultLossOnDisposalAccountId?: string | null; + + /** Default account that capital gains are posted to */ + defaultCapitalGainOnDisposalAccountId?: string | null; + + /** opt in for tax calculation */ + optInForTax?: boolean | null; + } + export interface SettingFormProperties { + + /** The prefix used for fixed asset numbers (“FA-” by default) */ + assetNumberPrefix: FormControl, + + /** The next available sequence number */ + assetNumberSequence: FormControl, + + /** + * The date depreciation calculations started on registered fixed assets in Xero + * Type: DateOnly + */ + assetStartDate: FormControl, + + /** + * The last depreciation date + * Type: DateOnly + */ + lastDepreciationDate: FormControl, + + /** Default account that gains are posted to */ + defaultGainOnDisposalAccountId: FormControl, + + /** Default account that losses are posted to */ + defaultLossOnDisposalAccountId: FormControl, + + /** Default account that capital gains are posted to */ + defaultCapitalGainOnDisposalAccountId: FormControl, + + /** opt in for tax calculation */ + optInForTax: FormControl, + } + export function CreateSettingFormGroup() { + return new FormGroup({ + assetNumberPrefix: new FormControl(undefined), + assetNumberSequence: new FormControl(undefined), + assetStartDate: CreateDateOnlyFormControl(), + lastDepreciationDate: CreateDateOnlyFormControl(), + defaultGainOnDisposalAccountId: new FormControl(undefined), + defaultLossOnDisposalAccountId: new FormControl(undefined), + defaultCapitalGainOnDisposalAccountId: new FormControl(undefined), + optInForTax: new FormControl(undefined), + }); + + } + + export interface Error { + + /** Array of elements of resource validation errors */ + resourceValidationErrors?: Array; + + /** Array of elements of field validation errors */ + fieldValidationErrors?: Array; + + /** The internal type of error, not accessible externally */ + type?: string | null; + + /** Title of the error */ + title?: string | null; + + /** Detail of the error */ + detail?: string | null; + } + export interface ErrorFormProperties { + + /** The internal type of error, not accessible externally */ + type: FormControl, + + /** Title of the error */ + title: FormControl, + + /** Detail of the error */ + detail: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + type: new FormControl(undefined), + title: new FormControl(undefined), + detail: new FormControl(undefined), + }); + + } + + export interface ResourceValidationErrorsElement { + + /** The field name of the erroneous field */ + resourceName?: string | null; + + /** Explaination of the resource validation error */ + localisedMessage?: string | null; + + /** Internal type of the resource error message */ + type?: string | null; + + /** Title of the resource validation error */ + title?: string | null; + + /** Detail of the resource validation error */ + detail?: string | null; + } + export interface ResourceValidationErrorsElementFormProperties { + + /** The field name of the erroneous field */ + resourceName: FormControl, + + /** Explaination of the resource validation error */ + localisedMessage: FormControl, + + /** Internal type of the resource error message */ + type: FormControl, + + /** Title of the resource validation error */ + title: FormControl, + + /** Detail of the resource validation error */ + detail: FormControl, + } + export function CreateResourceValidationErrorsElementFormGroup() { + return new FormGroup({ + resourceName: new FormControl(undefined), + localisedMessage: new FormControl(undefined), + type: new FormControl(undefined), + title: new FormControl(undefined), + detail: new FormControl(undefined), + }); + + } + + export interface FieldValidationErrorsElement { + + /** The field name of the erroneous field */ + fieldName?: string | null; + + /** The provided value */ + valueProvided?: string | null; + + /** Explaination of the field validation error */ + localisedMessage?: string | null; + + /** Internal type of the field validation error message */ + type?: string | null; + + /** Title of the field validation error */ + title?: string | null; + + /** Detail of the field validation error */ + detail?: string | null; + } + export interface FieldValidationErrorsElementFormProperties { + + /** The field name of the erroneous field */ + fieldName: FormControl, + + /** The provided value */ + valueProvided: FormControl, + + /** Explaination of the field validation error */ + localisedMessage: FormControl, + + /** Internal type of the field validation error message */ + type: FormControl, + + /** Title of the field validation error */ + title: FormControl, + + /** Detail of the field validation error */ + detail: FormControl, + } + export function CreateFieldValidationErrorsElementFormGroup() { + return new FormGroup({ + fieldName: new FormControl(undefined), + valueProvided: new FormControl(undefined), + localisedMessage: new FormControl(undefined), + type: new FormControl(undefined), + title: new FormControl(undefined), + detail: new FormControl(undefined), + }); + + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches fixed asset + * By passing in the appropriate options, you can search for available fixed asset in the system + * Get Assets + * @param {AssetStatusQueryParam} status Required when retrieving a collection of assets. See Asset Status Codes + * @param {number} page Results are paged. This specifies which page of the results to return. The default page is 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} pageSize The number of records returned per page. By default the number of records returned is 10. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {GetAssetsOrderBy} orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + * @param {GetAssetsSortDirection} sortDirection ASC or DESC + * @param {GetAssetsFilterBy} filterBy A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. + * @return {Assets} search results matching criteria + */ + GetAssets(status: AssetStatusQueryParam, page: number | null | undefined, pageSize: number | null | undefined, orderBy: GetAssetsOrderBy | null | undefined, sortDirection: GetAssetsSortDirection | null | undefined, filterBy: GetAssetsFilterBy | null | undefined): Observable { + return this.http.get(this.baseUri + 'Assets?status=' + status + '&page=' + page + '&pageSize=' + pageSize + '&orderBy=' + orderBy + '&sortDirection=' + sortDirection + '&filterBy=' + filterBy, {}); + } + + /** + * adds a fixed asset + * Adds an asset to the system + * Post Assets + * @param {Asset} requestBody Fixed asset you are creating + * @return {Asset} return single object - create new asset + */ + CreateAsset(requestBody: Asset): Observable { + return this.http.post(this.baseUri + 'Assets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieves fixed asset by id + * By passing in the appropriate asset id, you can search for + * a specific fixed asset in the system + * Get Assets/{id} + * @param {string} id fixed asset id for single object + * @return {Asset} search results matching criteria + */ + GetAssetById(id: string): Observable { + return this.http.get(this.baseUri + 'Assets/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * searches fixed asset types + * By passing in the appropriate options, you can search for available fixed asset types in the system + * Get AssetTypes + * @return {Array} search results matching criteria + */ + GetAssetTypes(): Observable> { + return this.http.get>(this.baseUri + 'AssetTypes', {}); + } + + /** + * adds a fixed asset type + * Adds an fixed asset type to the system + * Post AssetTypes + * @param {AssetType} requestBody Asset type to add + * @return {AssetType} results single object - created fixed type + */ + CreateAssetType(requestBody: AssetType): Observable { + return this.http.post(this.baseUri + 'AssetTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches fixed asset settings + * By passing in the appropriate options, you can search for available fixed asset types in the system + * Get Settings + * @return {Setting} search results matching criteria + */ + GetAssetSettings(): Observable { + return this.http.get(this.baseUri + 'Settings', {}); + } + } + + export enum GetAssetsOrderBy { AssetType = 0, AssetName = 1, AssetNumber = 2, PurchaseDate = 3, PurchasePrice = 4, DisposalDate = 5, DisposalPrice = 6 } + + export enum GetAssetsSortDirection { asc = 0, desc = 1 } + + export enum GetAssetsFilterBy { AssetName = 0, AssetNumber = 1, Description = 2, AssetTypeName = 3 } + +} + diff --git a/Tests/SwagTsTests/NG2FormGroupResults/xero_bankfeeds.txt b/Tests/SwagTsTests/NG2FormGroupResults/xero_bankfeeds.ts similarity index 97% rename from Tests/SwagTsTests/NG2FormGroupResults/xero_bankfeeds.txt rename to Tests/SwagTsTests/NG2FormGroupResults/xero_bankfeeds.ts index fc490d3f..e7e46dbd 100644 --- a/Tests/SwagTsTests/NG2FormGroupResults/xero_bankfeeds.txt +++ b/Tests/SwagTsTests/NG2FormGroupResults/xero_bankfeeds.ts @@ -1,612 +1,612 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; - -function CreateDateOnlyFormControl(){ - const fc = new FormControl(undefined); - fc.valueChanges.subscribe(v=>{ - if (v && v instanceof Date){ - fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); - } - }); - - return fc; -} - -export namespace MyNS { - export interface FeedConnections { - pagination?: Pagination; - items?: Array; - } - export interface FeedConnectionsFormProperties { - } - export function CreateFeedConnectionsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Pagination { - - /** - * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - page?: number | null; - - /** - * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageSize?: number | null; - - /** - * Number of pages available - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageCount?: number | null; - - /** - * Number of items returned - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemCount?: number | null; - } - export interface PaginationFormProperties { - - /** - * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - page: FormControl, - - /** - * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageSize: FormControl, - - /** - * Number of pages available - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageCount: FormControl, - - /** - * Number of items returned - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemCount: FormControl, - } - export function CreatePaginationFormGroup() { - return new FormGroup({ - page: new FormControl(undefined), - pageSize: new FormControl(undefined), - pageCount: new FormControl(undefined), - itemCount: new FormControl(undefined), - }); - - } - - export interface FeedConnection { - - /** GUID used to identify the Account. */ - id?: string | null; - - /** - * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. - * Maximum: 50 - */ - accountToken?: string | null; - - /** - * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. - * Maximum: 40 - */ - accountNumber?: string | null; - - /** - * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. - * Maximum: 30 - */ - accountName?: string | null; - - /** Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. */ - accountId?: string | null; - - /** High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. */ - accountType?: FeedConnectionAccountType | null; - - /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ - currency?: FeedConnectionCurrency | null; - - /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ - country?: FeedConnectionCountry | null; - - /** the current status of the feed connection */ - status?: FeedConnectionStatus | null; - - /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ - error?: Error; - } - export interface FeedConnectionFormProperties { - - /** GUID used to identify the Account. */ - id: FormControl, - - /** - * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. - * Maximum: 50 - */ - accountToken: FormControl, - - /** - * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. - * Maximum: 40 - */ - accountNumber: FormControl, - - /** - * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. - * Maximum: 30 - */ - accountName: FormControl, - - /** Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. */ - accountId: FormControl, - - /** High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. */ - accountType: FormControl, - - /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ - currency: FormControl, - - /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ - country: FormControl, - - /** the current status of the feed connection */ - status: FormControl, - } - export function CreateFeedConnectionFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - accountToken: new FormControl(undefined), - accountNumber: new FormControl(undefined), - accountName: new FormControl(undefined), - accountId: new FormControl(undefined), - accountType: new FormControl(undefined), - currency: new FormControl(undefined), - country: new FormControl(undefined), - status: new FormControl(undefined), - }); - - } - - export enum FeedConnectionAccountType { BANK = 0, CREDITCARD = 1 } - - export enum FeedConnectionCurrency { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - export enum FeedConnectionCountry { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - export enum FeedConnectionStatus { PENDING = 0, REJECTED = 1 } - - - /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ - export interface Error { - - /** - * Human readable high level error description. - * Maximum: 255 - */ - title?: string | null; - - /** - * The numeric HTTP Status Code, e.g. 404 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - status?: number | null; - - /** - * Human readable detailed error description. - * Maximum: 255 - */ - detail?: string | null; - - /** Identifies the type of error. */ - type?: ErrorType | null; - } - - /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ - export interface ErrorFormProperties { - - /** - * Human readable high level error description. - * Maximum: 255 - */ - title: FormControl, - - /** - * The numeric HTTP Status Code, e.g. 404 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - status: FormControl, - - /** - * Human readable detailed error description. - * Maximum: 255 - */ - detail: FormControl, - - /** Identifies the type of error. */ - type: FormControl, - } - export function CreateErrorFormGroup() { - return new FormGroup({ - title: new FormControl(undefined), - status: new FormControl(undefined), - detail: new FormControl(undefined), - type: new FormControl(undefined), - }); - - } - - export enum ErrorType { 'invalid-request' = 0, 'invalid-application' = 1, 'invalid-feed-connection' = 2, 'duplicate-statement' = 3, 'invalid-end-balance' = 4, 'invalid-start-and-end-date' = 5, 'invalid-start-date' = 6, 'internal-error' = 7, 'feed-already-connected-in-current-organisation' = 8 } - - export interface Statements { - pagination?: Pagination; - items?: Array; - } - export interface StatementsFormProperties { - } - export function CreateStatementsFormGroup() { - return new FormGroup({ - }); - - } - - export interface Statement { - - /** GUID used to identify the Statement. */ - id?: string | null; - - /** The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. */ - feedConnectionId?: string | null; - - /** Current status of statements */ - status?: StatementStatus | null; - - /** - * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - startDate?: Date | null; - - /** - * Closing balance date ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - endDate?: Date | null; - - /** The starting balance of the statement */ - startBalance?: StartBalance; - - /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ - endBalance?: EndBalance; - statementLines?: Array; - errors?: Array; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - statementLineCount?: number | null; - } - export interface StatementFormProperties { - - /** GUID used to identify the Statement. */ - id: FormControl, - - /** The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. */ - feedConnectionId: FormControl, - - /** Current status of statements */ - status: FormControl, - - /** - * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - startDate: FormControl, - - /** - * Closing balance date ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - endDate: FormControl, - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - statementLineCount: FormControl, - } - export function CreateStatementFormGroup() { - return new FormGroup({ - id: new FormControl(undefined), - feedConnectionId: new FormControl(undefined), - status: new FormControl(undefined), - startDate: new FormControl(undefined), - endDate: new FormControl(undefined), - statementLineCount: new FormControl(undefined), - }); - - } - - export enum StatementStatus { PENDING = 0, REJECTED = 1, DELIVERED = 2 } - - - /** The starting balance of the statement */ - export interface StartBalance { - - /** - * decimal(19,4) unsigned Opening/closing balance amount. - * Type: double - */ - amount?: number | null; - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; - } - - /** The starting balance of the statement */ - export interface StartBalanceFormProperties { - - /** - * decimal(19,4) unsigned Opening/closing balance amount. - * Type: double - */ - amount: FormControl, - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator: FormControl, - } - export function CreateStartBalanceFormGroup() { - return new FormGroup({ - amount: new FormControl(undefined), - creditDebitIndicator: new FormControl(undefined), - }); - - } - - export enum StartBalanceCreditDebitIndicator { CREDIT = 0, DEBIT = 1 } - - - /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ - export interface EndBalance { - - /** Type: double */ - amount?: number | null; - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; - } - - /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ - export interface EndBalanceFormProperties { - - /** Type: double */ - amount: FormControl, - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator: FormControl, - } - export function CreateEndBalanceFormGroup() { - return new FormGroup({ - amount: new FormControl(undefined), - creditDebitIndicator: new FormControl(undefined), - }); - - } - - - /** the lines details for a statement */ - export interface StatementLine { - - /** - * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - postedDate?: Date | null; - - /** - * Transaction description - * Maximum: 2000 - */ - description?: string | null; - - /** - * Transaction amount - * Type: double - */ - amount?: number | null; - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; - - /** Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. */ - transactionId?: string | null; - - /** - * Typically the merchant or payee name - * Maximum: 255 - */ - payeeName?: string | null; - - /** - * Optional field to enhance the Description - * Maximum: 255 - */ - reference?: string | null; - - /** - * The cheque/check number - * Maximum: 20 - */ - chequeNumber?: string | null; - } - - /** the lines details for a statement */ - export interface StatementLineFormProperties { - - /** - * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - postedDate: FormControl, - - /** - * Transaction description - * Maximum: 2000 - */ - description: FormControl, - - /** - * Transaction amount - * Type: double - */ - amount: FormControl, - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator: FormControl, - - /** Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. */ - transactionId: FormControl, - - /** - * Typically the merchant or payee name - * Maximum: 255 - */ - payeeName: FormControl, - - /** - * Optional field to enhance the Description - * Maximum: 255 - */ - reference: FormControl, - - /** - * The cheque/check number - * Maximum: 20 - */ - chequeNumber: FormControl, - } - export function CreateStatementLineFormGroup() { - return new FormGroup({ - postedDate: new FormControl(undefined), - description: new FormControl(undefined), - amount: new FormControl(undefined), - creditDebitIndicator: new FormControl(undefined), - transactionId: new FormControl(undefined), - payeeName: new FormControl(undefined), - reference: new FormControl(undefined), - chequeNumber: new FormControl(undefined), - }); - - } - - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - export enum CreditDebitIndicator { CREDIT = 0, DEBIT = 1 } - - - /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ - export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - - /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ - export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches feed connections - * By passing in the appropriate options, you can search for available feed connections in the system. - * Get FeedConnections - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} - */ - GetFeedConnections(page: number | null | undefined, pageSize: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'FeedConnections?page=' + page + '&pageSize=' + pageSize, { observe: 'response', responseType: 'text' }); - } - - /** - * create one or more new feed connection - * By passing in the FeedConnections array object in the body, you can create one or more new feed connections - * Post FeedConnections - * @param {FeedConnections} requestBody Feed Connection(s) array object in the body - * @return {void} - */ - CreateFeedConnections(requestBody: FeedConnections): Observable> { - return this.http.post(this.baseUri + 'FeedConnections', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrive single feed connection based on unique id provided - * By passing in a FeedConnection Id options, you can search for matching feed connections - * Get FeedConnections/{id} - * @param {string} id Unique identifier for retrieving single object - * @return {FeedConnection} success returns a FeedConnection object matching the id in response - */ - GetFeedConnection(id: string): Observable { - return this.http.get(this.baseUri + 'FeedConnections/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * Delete an exsiting feed connection - * By passing in FeedConnections array object in the body, you can delete a feed connection. - * Post FeedConnections/DeleteRequests - * @param {FeedConnections} requestBody Feed Connections array object in the body - * @return {void} - */ - DeleteFeedConnections(requestBody: FeedConnections): Observable> { - return this.http.post(this.baseUri + 'FeedConnections/DeleteRequests', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrive all statements based on unique search criteria - * By passing in parameters, you can search for matching statements - * Get Statements - * @param {number} page unique id for single object - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Statements} success returns Statements array of objects response - */ - GetStatements(page: number | null | undefined, pageSize: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Statements?page=' + page + '&pageSize=' + pageSize, {}); - } - - /** - * Post Statements - * @param {Statements} requestBody Statements array of objects in the body - * @return {void} - */ - CreateStatements(requestBody: Statements): Observable> { - return this.http.post(this.baseUri + 'Statements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrive single statement based on unique id provided - * By passing in a statement id, you can search for matching statements - * Get Statements/{statementId} - * @param {string} statementId statement id for single object - * @return {Statement} search results matching id for single statement - */ - GetStatement(statementId: string): Observable { - return this.http.get(this.baseUri + 'Statements/' + (statementId == null ? '' : encodeURIComponent(statementId)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; + +function CreateDateOnlyFormControl(){ + const fc = new FormControl(undefined); + fc.valueChanges.subscribe(v=>{ + if (v && v instanceof Date){ + fc.setValue(v.toLocaleDateString("sv").substring(0, 10)); + } + }); + + return fc; +} + +export namespace MyNS { + export interface FeedConnections { + pagination?: Pagination; + items?: Array; + } + export interface FeedConnectionsFormProperties { + } + export function CreateFeedConnectionsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Pagination { + + /** + * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + page?: number | null; + + /** + * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageSize?: number | null; + + /** + * Number of pages available + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageCount?: number | null; + + /** + * Number of items returned + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemCount?: number | null; + } + export interface PaginationFormProperties { + + /** + * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + page: FormControl, + + /** + * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageSize: FormControl, + + /** + * Number of pages available + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageCount: FormControl, + + /** + * Number of items returned + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemCount: FormControl, + } + export function CreatePaginationFormGroup() { + return new FormGroup({ + page: new FormControl(undefined), + pageSize: new FormControl(undefined), + pageCount: new FormControl(undefined), + itemCount: new FormControl(undefined), + }); + + } + + export interface FeedConnection { + + /** GUID used to identify the Account. */ + id?: string | null; + + /** + * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. + * Maximum: 50 + */ + accountToken?: string | null; + + /** + * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. + * Maximum: 40 + */ + accountNumber?: string | null; + + /** + * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. + * Maximum: 30 + */ + accountName?: string | null; + + /** Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. */ + accountId?: string | null; + + /** High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. */ + accountType?: FeedConnectionAccountType | null; + + /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ + currency?: FeedConnectionCurrency | null; + + /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ + country?: FeedConnectionCountry | null; + + /** the current status of the feed connection */ + status?: FeedConnectionStatus | null; + + /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ + error?: Error; + } + export interface FeedConnectionFormProperties { + + /** GUID used to identify the Account. */ + id: FormControl, + + /** + * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. + * Maximum: 50 + */ + accountToken: FormControl, + + /** + * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. + * Maximum: 40 + */ + accountNumber: FormControl, + + /** + * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. + * Maximum: 30 + */ + accountName: FormControl, + + /** Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. */ + accountId: FormControl, + + /** High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. */ + accountType: FormControl, + + /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ + currency: FormControl, + + /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ + country: FormControl, + + /** the current status of the feed connection */ + status: FormControl, + } + export function CreateFeedConnectionFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + accountToken: new FormControl(undefined), + accountNumber: new FormControl(undefined), + accountName: new FormControl(undefined), + accountId: new FormControl(undefined), + accountType: new FormControl(undefined), + currency: new FormControl(undefined), + country: new FormControl(undefined), + status: new FormControl(undefined), + }); + + } + + export enum FeedConnectionAccountType { BANK = 0, CREDITCARD = 1 } + + export enum FeedConnectionCurrency { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + export enum FeedConnectionCountry { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + export enum FeedConnectionStatus { PENDING = 0, REJECTED = 1 } + + + /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ + export interface Error { + + /** + * Human readable high level error description. + * Maximum: 255 + */ + title?: string | null; + + /** + * The numeric HTTP Status Code, e.g. 404 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + status?: number | null; + + /** + * Human readable detailed error description. + * Maximum: 255 + */ + detail?: string | null; + + /** Identifies the type of error. */ + type?: ErrorType | null; + } + + /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ + export interface ErrorFormProperties { + + /** + * Human readable high level error description. + * Maximum: 255 + */ + title: FormControl, + + /** + * The numeric HTTP Status Code, e.g. 404 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + status: FormControl, + + /** + * Human readable detailed error description. + * Maximum: 255 + */ + detail: FormControl, + + /** Identifies the type of error. */ + type: FormControl, + } + export function CreateErrorFormGroup() { + return new FormGroup({ + title: new FormControl(undefined), + status: new FormControl(undefined), + detail: new FormControl(undefined), + type: new FormControl(undefined), + }); + + } + + export enum ErrorType { 'invalid-request' = 0, 'invalid-application' = 1, 'invalid-feed-connection' = 2, 'duplicate-statement' = 3, 'invalid-end-balance' = 4, 'invalid-start-and-end-date' = 5, 'invalid-start-date' = 6, 'internal-error' = 7, 'feed-already-connected-in-current-organisation' = 8 } + + export interface Statements { + pagination?: Pagination; + items?: Array; + } + export interface StatementsFormProperties { + } + export function CreateStatementsFormGroup() { + return new FormGroup({ + }); + + } + + export interface Statement { + + /** GUID used to identify the Statement. */ + id?: string | null; + + /** The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. */ + feedConnectionId?: string | null; + + /** Current status of statements */ + status?: StatementStatus | null; + + /** + * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + startDate?: Date | null; + + /** + * Closing balance date ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + endDate?: Date | null; + + /** The starting balance of the statement */ + startBalance?: StartBalance; + + /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ + endBalance?: EndBalance; + statementLines?: Array; + errors?: Array; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + statementLineCount?: number | null; + } + export interface StatementFormProperties { + + /** GUID used to identify the Statement. */ + id: FormControl, + + /** The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. */ + feedConnectionId: FormControl, + + /** Current status of statements */ + status: FormControl, + + /** + * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + startDate: FormControl, + + /** + * Closing balance date ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + endDate: FormControl, + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + statementLineCount: FormControl, + } + export function CreateStatementFormGroup() { + return new FormGroup({ + id: new FormControl(undefined), + feedConnectionId: new FormControl(undefined), + status: new FormControl(undefined), + startDate: CreateDateOnlyFormControl(), + endDate: CreateDateOnlyFormControl(), + statementLineCount: new FormControl(undefined), + }); + + } + + export enum StatementStatus { PENDING = 0, REJECTED = 1, DELIVERED = 2 } + + + /** The starting balance of the statement */ + export interface StartBalance { + + /** + * decimal(19,4) unsigned Opening/closing balance amount. + * Type: double + */ + amount?: number | null; + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; + } + + /** The starting balance of the statement */ + export interface StartBalanceFormProperties { + + /** + * decimal(19,4) unsigned Opening/closing balance amount. + * Type: double + */ + amount: FormControl, + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator: FormControl, + } + export function CreateStartBalanceFormGroup() { + return new FormGroup({ + amount: new FormControl(undefined), + creditDebitIndicator: new FormControl(undefined), + }); + + } + + export enum StartBalanceCreditDebitIndicator { CREDIT = 0, DEBIT = 1 } + + + /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ + export interface EndBalance { + + /** Type: double */ + amount?: number | null; + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; + } + + /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ + export interface EndBalanceFormProperties { + + /** Type: double */ + amount: FormControl, + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator: FormControl, + } + export function CreateEndBalanceFormGroup() { + return new FormGroup({ + amount: new FormControl(undefined), + creditDebitIndicator: new FormControl(undefined), + }); + + } + + + /** the lines details for a statement */ + export interface StatementLine { + + /** + * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + postedDate?: Date | null; + + /** + * Transaction description + * Maximum: 2000 + */ + description?: string | null; + + /** + * Transaction amount + * Type: double + */ + amount?: number | null; + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; + + /** Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. */ + transactionId?: string | null; + + /** + * Typically the merchant or payee name + * Maximum: 255 + */ + payeeName?: string | null; + + /** + * Optional field to enhance the Description + * Maximum: 255 + */ + reference?: string | null; + + /** + * The cheque/check number + * Maximum: 20 + */ + chequeNumber?: string | null; + } + + /** the lines details for a statement */ + export interface StatementLineFormProperties { + + /** + * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + postedDate: FormControl, + + /** + * Transaction description + * Maximum: 2000 + */ + description: FormControl, + + /** + * Transaction amount + * Type: double + */ + amount: FormControl, + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator: FormControl, + + /** Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. */ + transactionId: FormControl, + + /** + * Typically the merchant or payee name + * Maximum: 255 + */ + payeeName: FormControl, + + /** + * Optional field to enhance the Description + * Maximum: 255 + */ + reference: FormControl, + + /** + * The cheque/check number + * Maximum: 20 + */ + chequeNumber: FormControl, + } + export function CreateStatementLineFormGroup() { + return new FormGroup({ + postedDate: CreateDateOnlyFormControl(), + description: new FormControl(undefined), + amount: new FormControl(undefined), + creditDebitIndicator: new FormControl(undefined), + transactionId: new FormControl(undefined), + payeeName: new FormControl(undefined), + reference: new FormControl(undefined), + chequeNumber: new FormControl(undefined), + }); + + } + + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + export enum CreditDebitIndicator { CREDIT = 0, DEBIT = 1 } + + + /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ + export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + + /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ + export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches feed connections + * By passing in the appropriate options, you can search for available feed connections in the system. + * Get FeedConnections + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} + */ + GetFeedConnections(page: number | null | undefined, pageSize: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'FeedConnections?page=' + page + '&pageSize=' + pageSize, { observe: 'response', responseType: 'text' }); + } + + /** + * create one or more new feed connection + * By passing in the FeedConnections array object in the body, you can create one or more new feed connections + * Post FeedConnections + * @param {FeedConnections} requestBody Feed Connection(s) array object in the body + * @return {void} + */ + CreateFeedConnections(requestBody: FeedConnections): Observable> { + return this.http.post(this.baseUri + 'FeedConnections', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrive single feed connection based on unique id provided + * By passing in a FeedConnection Id options, you can search for matching feed connections + * Get FeedConnections/{id} + * @param {string} id Unique identifier for retrieving single object + * @return {FeedConnection} success returns a FeedConnection object matching the id in response + */ + GetFeedConnection(id: string): Observable { + return this.http.get(this.baseUri + 'FeedConnections/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * Delete an exsiting feed connection + * By passing in FeedConnections array object in the body, you can delete a feed connection. + * Post FeedConnections/DeleteRequests + * @param {FeedConnections} requestBody Feed Connections array object in the body + * @return {void} + */ + DeleteFeedConnections(requestBody: FeedConnections): Observable> { + return this.http.post(this.baseUri + 'FeedConnections/DeleteRequests', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrive all statements based on unique search criteria + * By passing in parameters, you can search for matching statements + * Get Statements + * @param {number} page unique id for single object + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Statements} success returns Statements array of objects response + */ + GetStatements(page: number | null | undefined, pageSize: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Statements?page=' + page + '&pageSize=' + pageSize, {}); + } + + /** + * Post Statements + * @param {Statements} requestBody Statements array of objects in the body + * @return {void} + */ + CreateStatements(requestBody: Statements): Observable> { + return this.http.post(this.baseUri + 'Statements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrive single statement based on unique id provided + * By passing in a statement id, you can search for matching statements + * Get Statements/{statementId} + * @param {string} statementId statement id for single object + * @return {Statement} search results matching id for single statement + */ + GetStatement(statementId: string): Observable { + return this.http.get(this.baseUri + 'Statements/' + (statementId == null ? '' : encodeURIComponent(statementId)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/AirOne.txt b/Tests/SwagTsTests/NG2Results/AirOne.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/AirOne.txt rename to Tests/SwagTsTests/NG2Results/AirOne.ts index 9cd67591..f7781726 100644 --- a/Tests/SwagTsTests/NG2Results/AirOne.txt +++ b/Tests/SwagTsTests/NG2Results/AirOne.ts @@ -1,605 +1,605 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ProviderIdentifierType { - - /** Vaccination provider number such as Medicare provider number or AIR provider number. */ - providerNumber: string; - hpioNumber?: string | null; - hpiiNumber?: string | null; - } - - export interface AccessType { - code: string; - name?: string | null; - hasAccess: boolean; - } - - export interface AirAccessListRequestType { - informationProvider: ProviderIdentifierType; - } - - export interface AirAccessListResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - accessList?: Array; - errors?: Array; - } - - export interface ErrorMessageType { - - /** Error code */ - code: string; - - /** Error field name */ - field?: string | null; - - /** Error message details */ - message?: string | null; - } - - export interface MedicareCardType { - - /** Individual's Medicare card number */ - medicareCardNumber: string; - - /** Medicare Individual Reference Number */ - medicareIRN?: string | null; - } - - export interface PersonalDetailsType { - - /** Individual's date of birth in format DDMMYYYY */ - dateOfBirth: string; - - /** Individual' First Name */ - firstName?: string | null; - - /** Individual' Last Name */ - lastName: string; - - /** Individual's gender */ - gender?: string | null; - } - - export interface SearchAddressType { - postCode: string; - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postCode: string; - } - - export interface IndividualType { - personalDetails?: PersonalDetailsType; - medicareCard?: MedicareCardType; - address?: SearchAddressType; - ihiNumber?: string | null; - } - - export interface ResponseIndividualType { - personalDetails?: PersonalDetailsType; - medicareCard?: MedicareCardType; - address?: AddressType; - } - - export interface IndividualDetailsType { - individualIdentifier?: string | null; - individual?: ResponseIndividualType; - - /** Individual's catchup date in format DDMMYYYY */ - catchupDate?: string | null; - endDateCode?: string | null; - indigenousStatus?: boolean | null; - additionalVaccineIndicator?: boolean | null; - medContraindicationIndicator?: boolean | null; - naturalImmunityIndicator?: boolean | null; - vaccineTrialIndicator?: boolean | null; - actionRequiredIndicator?: boolean | null; - } - - export interface IdentifyIndividualRequestType { - individual: IndividualType; - informationProvider: ProviderIdentifierType; - } - - export interface IndividualDetailsResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - individualDetails?: IndividualDetailsType; - errors?: Array; - } - - export interface AdditionalVaccineIndicatorRequestType { - individualIdentifier: string; - acknowledgement: boolean; - informationProvider: ProviderIdentifierType; - } - - export interface AdditionalVaccineIndicatorResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - - export interface DueVaccineType { - disease?: string | null; - vaccineDose?: string | null; - - /** Due date in format DDMMYYYY */ - dueDate?: string | null; - } - - export interface EncounterHistoryType { - - /** Claim id of the encounter */ - claimId: string; - - /** Claim sequence number of the encounter */ - claimSeqNum: number; - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: number; - episodes?: Array; - editable?: boolean | null; - - /** Date submitted in format DDMMYYYY */ - dateOfService?: string | null; - - /** Date submitted in format DDMMYYYY */ - dateSubmitted?: string | null; - schoolId?: string | null; - } - - export interface EpisodeResponseType { - id: number; - vaccineCode: string; - vaccineDose?: string | null; - vaccineBatch?: string | null; - vaccineSerialNumber?: string | null; - actionRequiredIndicator: boolean; - editable: boolean; - information?: InformationType; - } - - export interface ImmunisationDetailsResponseType { - dueList?: Array; - encounters?: Array; - } - - export interface AirHistoryRequestType { - individualIdentifier: string; - informationProvider: ProviderIdentifierType; - } - - export interface ImmunisationHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - immunisationDetails?: ImmunisationDetailsResponseType; - errors?: Array; - } - - export interface InformationType { - status: string; - code?: string | null; - text?: string | null; - messageCode?: string | null; - messageText?: string | null; - } - - export interface ImmunisationHistoryStatementType { - mimeType: ImmunisationHistoryStatementTypeMimeType; - - /** File name of the PDF immunisation history statement */ - fileName: string; - - /** Base64-encoded content of PDF immunisation history statement */ - fileContent: string; - } - - export enum ImmunisationHistoryStatementTypeMimeType { 'application/pdf' = 0 } - - export interface ImmunisationHistoryStatementResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - immunisationHistoryStatement?: ImmunisationHistoryStatementType; - errors?: Array; - } - - export interface IndigenousStatusRequestType { - individualIdentifier: string; - indigenousStatus: boolean; - informationProvider: ProviderIdentifierType; - } - - export interface IndigenousStatusResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - - export interface MedicalContraindiationResponseType { - vaccineCode: string; - typeCode: MedicalContraindiationResponseTypeTypeCode; - - /** Start date in format DDMMYYYY */ - startDate: string; - - /** End date in format DDMMYYYY */ - endDate?: string | null; - reason: MedicalContraindiationResponseTypeReason; - - /** AnaphylaxisDate date in format DDMMYYYY */ - anaphylaxisDate?: string | null; - } - - export enum MedicalContraindiationResponseTypeTypeCode { P = 0, T = 1 } - - export enum MedicalContraindiationResponseTypeReason { M = 0, S = 1, P = 2, I = 3, A = 4 } - - export interface MedicalContraindicationHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - medContraindicationList?: Array; - errors?: Array; - } - - export interface MedicalContraindiationRequestType { - vaccineCode: string; - typeCode: MedicalContraindiationResponseTypeTypeCode; - - /** End date in format DDMMYYYY */ - endDate?: string | null; - reason: MedicalContraindiationResponseTypeReason; - - /** Previous anaphylaxis date in format DDMMYYYY */ - anaphylaxisDate?: string | null; - } - - export interface AddMedicalContraindicationRequestType { - individualIdentifier: string; - contraindication: MedicalContraindiationRequestType; - informationProvider: ProviderIdentifierType; - } - - export interface AddMedicalContraindicationResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - - export interface NaturalImmunityResponseType { - disease: string; - - /** Notification date in format DDMMYYYY */ - notificationDate: string; - - /** Lab test date in format DDMMYYYY */ - labTestDate?: string | null; - - /** Diagnosis date in format DDMMYYYY */ - diagnosisDate?: string | null; - } - - export interface NaturalImmunityHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - naturalImmunityList?: Array; - errors?: Array; - } - - export interface NaturalImmunityRequestType { - disease: string; - - /** Lab test date in format DDMMYYYY - it is required if diagnosisDate is not provided */ - labTestDate?: string | null; - - /** Diagnosis date in format DDMMYYYY - it is required if labTestDate is not provided */ - diagnosisDate?: string | null; - } - - export interface AddNaturalImmunityRequestType { - individualIdentifier: string; - immunity: NaturalImmunityRequestType; - informationProvider: ProviderIdentifierType; - } - - export interface AddNaturalImmunityResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - errors?: Array; - } - - export interface VaccineTrialType { - antigenCode?: string | null; - dose?: string | null; - - /** Start date in format DDMMYYYY */ - startDate?: string | null; - - /** End date in format DDMMYYYY */ - endDate?: string | null; - } - - export interface VaccineTrialHistoryResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - vaccineTrialList?: Array; - errors?: Array; - } - - export interface IndividualIdentifierType { - personalDetails?: PersonalDetailsType; - medicareCard?: MedicareCardType; - address?: AddressType; - ihiNumber?: string | null; - atsiIndicator?: IndividualIdentifierTypeAtsiIndicator | null; - acceptAndConfirm?: string | null; - } - - export enum IndividualIdentifierTypeAtsiIndicator { Y = 0, N = 1 } - - export interface CatchupDateRequestType { - individual: IndividualIdentifierType; - informationProvider: ProviderIdentifierType; - } - - export interface CatchupDateResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - - /** Immunisation schedule catchup date in format ddMMyyyy */ - catchupDate?: string | null; - errors?: Array; - } - - export interface EpisodeType { - id: number; - vaccineCode: string; - vaccineDose?: string | null; - vaccineBatch?: string | null; - vaccineSerialNumber?: string | null; - } - - export interface EncounterType { - id: number; - claimSequenceNumber?: string | null; - episodes: Array; - immunisationProvider?: ProviderIdentifierType; - schoolId?: string | null; - administeredOverseas?: boolean | null; - acceptAndConfirm?: string | null; - - /** The date on which the Individual received the immunisation in format ddMMyyy */ - dateOfService: string; - } - - export interface EncounterResponseType { - id: number; - claimSequenceNumber: string; - episodes: Array; - information?: InformationType; - - /** Claim id of the encounter */ - claimId?: string | null; - - /** Claim sequence number of the encounter */ - claimSeqNum?: number | null; - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: number; - schoolId?: string | null; - - /** Date of service in format DDMMYYYY */ - dateOfService: string; - } - - export interface ClaimDetailsResponseType { - claimId?: string | null; - encounters?: Array; - } - - export interface AddEncounterRequestType { - individual: IndividualIdentifierType; - encounters: Array; - informationProvider: ProviderIdentifierType; - claimId?: string | null; - } - - export interface AddEncounterResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - claimDetails?: ClaimDetailsResponseType; - errors?: Array; - } - - export interface EncounterRequestType { - - /** Claim id of the encounter */ - claimId: string; - - /** Claim sequence number of the encounter */ - claimSeqNum: number; - - /** Immunisation encounter sequence number of the encounter */ - immEncSeqNum: number; - episodes: Array; - schoolId?: string | null; - - /** Date of service in format DDMMYYYY */ - dateOfService: string; - } - - export interface UpdateEncounterRequestType { - individualIdentifier: string; - encounter: EncounterRequestType; - informationProvider: ProviderIdentifierType; - } - - export interface UpdateEncounterResponseType { - statusCode: string; - codeType?: string | null; - message?: string | null; - encounter?: EncounterResponseType; - errors?: Array; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Get authorisation access list - * Post v1/authorisation/access/list - * @return {AirAccessListResponseType} 200 OK - */ - AirAuthorisationAccessList1EigwPost(requestBody: AirAccessListRequestType): Observable { - return this.http.post(this.baseUri + 'v1/authorisation/access/list', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Identify Individual details request - * Post v1/individual/details - * @return {IndividualDetailsResponseType} 200 OK - */ - AirImmunisationIndividualDetails1EigwPost(requestBody: IdentifyIndividualRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Add additional vaccine indicator request - * Post v1/individual/additional-vaccine-indicator/add - * @return {AdditionalVaccineIndicatorResponseType} 200 OK - */ - AirImmunisationAdditionalVaccineIndicatorAdd1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/add', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Remove additional vaccine indicator request - * Post v1/individual/additional-vaccine-indicator/remove - * @return {AdditionalVaccineIndicatorResponseType} 200 OK - */ - AirImmunisationAdditionalVaccineIndicatorRemove1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/remove', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get immunisation details request - * Post v1/individual/immunisation-history/details - * @return {ImmunisationHistoryResponseType} 200 OK - */ - AirImmunisationHistoryDetails1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/immunisation-history/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Vaccine Trial History - * Post v1/individual/immunisation-history/statement - * @return {ImmunisationHistoryStatementResponseType} 200 OK - */ - AirImmunisationHistoryStatement1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/immunisation-history/statement', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update Indigenous Status request - * Post v1/individual/indigenous-status/update - * @return {IndigenousStatusResponseType} 200 OK - */ - AirImmunisationIndigenousStatusUpdate1EigwPost(requestBody: IndigenousStatusRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/indigenous-status/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Medical Contraindication History - * Post v1/individual/medical-contraindication/history - * @return {MedicalContraindicationHistoryResponseType} 200 OK - */ - AirImmunisationMedContraindicationHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Record Medical Contraindication request - * Post v1/individual/medical-contraindication/record - * @return {AddMedicalContraindicationResponseType} 200 OK - */ - AirImmunisationMedContraindicationRecord1EigwPost(requestBody: AddMedicalContraindicationRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Natural Immunity History - * Post v1/individual/natural-immunity/history - * @return {NaturalImmunityHistoryResponseType} 200 OK - */ - AirImmunisationNaturalImmunityHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/natural-immunity/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Record Natural Immunity request - * Post v1/individual/natural-immunity/record - * @return {AddNaturalImmunityResponseType} 200 OK - */ - AirImmunisationNaturalImmunityRecord1EigwPost(requestBody: AddNaturalImmunityRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/natural-immunity/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Get Vaccine Trial History - * Post v1/individual/vaccine-trial/history - * @return {VaccineTrialHistoryResponseType} 200 OK - */ - AirImmunisationVaccineTrialHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { - return this.http.post(this.baseUri + 'v1/individual/vaccine-trial/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Post v1.1/schedule/catchup - * @return {CatchupDateResponseType} 200 OK - */ - AirImmunisationScheduleCatchup110EigwPost(requestBody: CatchupDateRequestType): Observable { - return this.http.post(this.baseUri + 'v1.1/schedule/catchup', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Record Encounter request - * Post v1.1/encounters/record - * @return {AddEncounterResponseType} 200 OK - */ - AirImmunisationEncounterRecord110EigwPost(requestBody: AddEncounterRequestType): Observable { - return this.http.post(this.baseUri + 'v1.1/encounters/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Update Encounter request - * Post v1/encounter/update - * @return {UpdateEncounterResponseType} 200 OK - */ - AirImmunisationEncounterUpdate1EigwPost(requestBody: UpdateEncounterRequestType): Observable { - return this.http.post(this.baseUri + 'v1/encounter/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ProviderIdentifierType { + + /** Vaccination provider number such as Medicare provider number or AIR provider number. */ + providerNumber: string; + hpioNumber?: string | null; + hpiiNumber?: string | null; + } + + export interface AccessType { + code: string; + name?: string | null; + hasAccess: boolean; + } + + export interface AirAccessListRequestType { + informationProvider: ProviderIdentifierType; + } + + export interface AirAccessListResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + accessList?: Array; + errors?: Array; + } + + export interface ErrorMessageType { + + /** Error code */ + code: string; + + /** Error field name */ + field?: string | null; + + /** Error message details */ + message?: string | null; + } + + export interface MedicareCardType { + + /** Individual's Medicare card number */ + medicareCardNumber: string; + + /** Medicare Individual Reference Number */ + medicareIRN?: string | null; + } + + export interface PersonalDetailsType { + + /** Individual's date of birth in format DDMMYYYY */ + dateOfBirth: string; + + /** Individual' First Name */ + firstName?: string | null; + + /** Individual' Last Name */ + lastName: string; + + /** Individual's gender */ + gender?: string | null; + } + + export interface SearchAddressType { + postCode: string; + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postCode: string; + } + + export interface IndividualType { + personalDetails?: PersonalDetailsType; + medicareCard?: MedicareCardType; + address?: SearchAddressType; + ihiNumber?: string | null; + } + + export interface ResponseIndividualType { + personalDetails?: PersonalDetailsType; + medicareCard?: MedicareCardType; + address?: AddressType; + } + + export interface IndividualDetailsType { + individualIdentifier?: string | null; + individual?: ResponseIndividualType; + + /** Individual's catchup date in format DDMMYYYY */ + catchupDate?: string | null; + endDateCode?: string | null; + indigenousStatus?: boolean | null; + additionalVaccineIndicator?: boolean | null; + medContraindicationIndicator?: boolean | null; + naturalImmunityIndicator?: boolean | null; + vaccineTrialIndicator?: boolean | null; + actionRequiredIndicator?: boolean | null; + } + + export interface IdentifyIndividualRequestType { + individual: IndividualType; + informationProvider: ProviderIdentifierType; + } + + export interface IndividualDetailsResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + individualDetails?: IndividualDetailsType; + errors?: Array; + } + + export interface AdditionalVaccineIndicatorRequestType { + individualIdentifier: string; + acknowledgement: boolean; + informationProvider: ProviderIdentifierType; + } + + export interface AdditionalVaccineIndicatorResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + + export interface DueVaccineType { + disease?: string | null; + vaccineDose?: string | null; + + /** Due date in format DDMMYYYY */ + dueDate?: string | null; + } + + export interface EncounterHistoryType { + + /** Claim id of the encounter */ + claimId: string; + + /** Claim sequence number of the encounter */ + claimSeqNum: number; + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: number; + episodes?: Array; + editable?: boolean | null; + + /** Date submitted in format DDMMYYYY */ + dateOfService?: string | null; + + /** Date submitted in format DDMMYYYY */ + dateSubmitted?: string | null; + schoolId?: string | null; + } + + export interface EpisodeResponseType { + id: number; + vaccineCode: string; + vaccineDose?: string | null; + vaccineBatch?: string | null; + vaccineSerialNumber?: string | null; + actionRequiredIndicator: boolean; + editable: boolean; + information?: InformationType; + } + + export interface ImmunisationDetailsResponseType { + dueList?: Array; + encounters?: Array; + } + + export interface AirHistoryRequestType { + individualIdentifier: string; + informationProvider: ProviderIdentifierType; + } + + export interface ImmunisationHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + immunisationDetails?: ImmunisationDetailsResponseType; + errors?: Array; + } + + export interface InformationType { + status: string; + code?: string | null; + text?: string | null; + messageCode?: string | null; + messageText?: string | null; + } + + export interface ImmunisationHistoryStatementType { + mimeType: ImmunisationHistoryStatementTypeMimeType; + + /** File name of the PDF immunisation history statement */ + fileName: string; + + /** Base64-encoded content of PDF immunisation history statement */ + fileContent: string; + } + + export enum ImmunisationHistoryStatementTypeMimeType { 'application/pdf' = 0 } + + export interface ImmunisationHistoryStatementResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + immunisationHistoryStatement?: ImmunisationHistoryStatementType; + errors?: Array; + } + + export interface IndigenousStatusRequestType { + individualIdentifier: string; + indigenousStatus: boolean; + informationProvider: ProviderIdentifierType; + } + + export interface IndigenousStatusResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + + export interface MedicalContraindiationResponseType { + vaccineCode: string; + typeCode: MedicalContraindiationResponseTypeTypeCode; + + /** Start date in format DDMMYYYY */ + startDate: string; + + /** End date in format DDMMYYYY */ + endDate?: string | null; + reason: MedicalContraindiationResponseTypeReason; + + /** AnaphylaxisDate date in format DDMMYYYY */ + anaphylaxisDate?: string | null; + } + + export enum MedicalContraindiationResponseTypeTypeCode { P = 0, T = 1 } + + export enum MedicalContraindiationResponseTypeReason { M = 0, S = 1, P = 2, I = 3, A = 4 } + + export interface MedicalContraindicationHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + medContraindicationList?: Array; + errors?: Array; + } + + export interface MedicalContraindiationRequestType { + vaccineCode: string; + typeCode: MedicalContraindiationResponseTypeTypeCode; + + /** End date in format DDMMYYYY */ + endDate?: string | null; + reason: MedicalContraindiationResponseTypeReason; + + /** Previous anaphylaxis date in format DDMMYYYY */ + anaphylaxisDate?: string | null; + } + + export interface AddMedicalContraindicationRequestType { + individualIdentifier: string; + contraindication: MedicalContraindiationRequestType; + informationProvider: ProviderIdentifierType; + } + + export interface AddMedicalContraindicationResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + + export interface NaturalImmunityResponseType { + disease: string; + + /** Notification date in format DDMMYYYY */ + notificationDate: string; + + /** Lab test date in format DDMMYYYY */ + labTestDate?: string | null; + + /** Diagnosis date in format DDMMYYYY */ + diagnosisDate?: string | null; + } + + export interface NaturalImmunityHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + naturalImmunityList?: Array; + errors?: Array; + } + + export interface NaturalImmunityRequestType { + disease: string; + + /** Lab test date in format DDMMYYYY - it is required if diagnosisDate is not provided */ + labTestDate?: string | null; + + /** Diagnosis date in format DDMMYYYY - it is required if labTestDate is not provided */ + diagnosisDate?: string | null; + } + + export interface AddNaturalImmunityRequestType { + individualIdentifier: string; + immunity: NaturalImmunityRequestType; + informationProvider: ProviderIdentifierType; + } + + export interface AddNaturalImmunityResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + errors?: Array; + } + + export interface VaccineTrialType { + antigenCode?: string | null; + dose?: string | null; + + /** Start date in format DDMMYYYY */ + startDate?: string | null; + + /** End date in format DDMMYYYY */ + endDate?: string | null; + } + + export interface VaccineTrialHistoryResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + vaccineTrialList?: Array; + errors?: Array; + } + + export interface IndividualIdentifierType { + personalDetails?: PersonalDetailsType; + medicareCard?: MedicareCardType; + address?: AddressType; + ihiNumber?: string | null; + atsiIndicator?: IndividualIdentifierTypeAtsiIndicator | null; + acceptAndConfirm?: string | null; + } + + export enum IndividualIdentifierTypeAtsiIndicator { Y = 0, N = 1 } + + export interface CatchupDateRequestType { + individual: IndividualIdentifierType; + informationProvider: ProviderIdentifierType; + } + + export interface CatchupDateResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + + /** Immunisation schedule catchup date in format ddMMyyyy */ + catchupDate?: string | null; + errors?: Array; + } + + export interface EpisodeType { + id: number; + vaccineCode: string; + vaccineDose?: string | null; + vaccineBatch?: string | null; + vaccineSerialNumber?: string | null; + } + + export interface EncounterType { + id: number; + claimSequenceNumber?: string | null; + episodes: Array; + immunisationProvider?: ProviderIdentifierType; + schoolId?: string | null; + administeredOverseas?: boolean | null; + acceptAndConfirm?: string | null; + + /** The date on which the Individual received the immunisation in format ddMMyyy */ + dateOfService: string; + } + + export interface EncounterResponseType { + id: number; + claimSequenceNumber: string; + episodes: Array; + information?: InformationType; + + /** Claim id of the encounter */ + claimId?: string | null; + + /** Claim sequence number of the encounter */ + claimSeqNum?: number | null; + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: number; + schoolId?: string | null; + + /** Date of service in format DDMMYYYY */ + dateOfService: string; + } + + export interface ClaimDetailsResponseType { + claimId?: string | null; + encounters?: Array; + } + + export interface AddEncounterRequestType { + individual: IndividualIdentifierType; + encounters: Array; + informationProvider: ProviderIdentifierType; + claimId?: string | null; + } + + export interface AddEncounterResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + claimDetails?: ClaimDetailsResponseType; + errors?: Array; + } + + export interface EncounterRequestType { + + /** Claim id of the encounter */ + claimId: string; + + /** Claim sequence number of the encounter */ + claimSeqNum: number; + + /** Immunisation encounter sequence number of the encounter */ + immEncSeqNum: number; + episodes: Array; + schoolId?: string | null; + + /** Date of service in format DDMMYYYY */ + dateOfService: string; + } + + export interface UpdateEncounterRequestType { + individualIdentifier: string; + encounter: EncounterRequestType; + informationProvider: ProviderIdentifierType; + } + + export interface UpdateEncounterResponseType { + statusCode: string; + codeType?: string | null; + message?: string | null; + encounter?: EncounterResponseType; + errors?: Array; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Get authorisation access list + * Post v1/authorisation/access/list + * @return {AirAccessListResponseType} 200 OK + */ + AirAuthorisationAccessList1EigwPost(requestBody: AirAccessListRequestType): Observable { + return this.http.post(this.baseUri + 'v1/authorisation/access/list', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Identify Individual details request + * Post v1/individual/details + * @return {IndividualDetailsResponseType} 200 OK + */ + AirImmunisationIndividualDetails1EigwPost(requestBody: IdentifyIndividualRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Add additional vaccine indicator request + * Post v1/individual/additional-vaccine-indicator/add + * @return {AdditionalVaccineIndicatorResponseType} 200 OK + */ + AirImmunisationAdditionalVaccineIndicatorAdd1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/add', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Remove additional vaccine indicator request + * Post v1/individual/additional-vaccine-indicator/remove + * @return {AdditionalVaccineIndicatorResponseType} 200 OK + */ + AirImmunisationAdditionalVaccineIndicatorRemove1EigwPost(requestBody: AdditionalVaccineIndicatorRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/additional-vaccine-indicator/remove', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get immunisation details request + * Post v1/individual/immunisation-history/details + * @return {ImmunisationHistoryResponseType} 200 OK + */ + AirImmunisationHistoryDetails1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/immunisation-history/details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Vaccine Trial History + * Post v1/individual/immunisation-history/statement + * @return {ImmunisationHistoryStatementResponseType} 200 OK + */ + AirImmunisationHistoryStatement1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/immunisation-history/statement', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update Indigenous Status request + * Post v1/individual/indigenous-status/update + * @return {IndigenousStatusResponseType} 200 OK + */ + AirImmunisationIndigenousStatusUpdate1EigwPost(requestBody: IndigenousStatusRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/indigenous-status/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Medical Contraindication History + * Post v1/individual/medical-contraindication/history + * @return {MedicalContraindicationHistoryResponseType} 200 OK + */ + AirImmunisationMedContraindicationHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Record Medical Contraindication request + * Post v1/individual/medical-contraindication/record + * @return {AddMedicalContraindicationResponseType} 200 OK + */ + AirImmunisationMedContraindicationRecord1EigwPost(requestBody: AddMedicalContraindicationRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/medical-contraindication/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Natural Immunity History + * Post v1/individual/natural-immunity/history + * @return {NaturalImmunityHistoryResponseType} 200 OK + */ + AirImmunisationNaturalImmunityHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/natural-immunity/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Record Natural Immunity request + * Post v1/individual/natural-immunity/record + * @return {AddNaturalImmunityResponseType} 200 OK + */ + AirImmunisationNaturalImmunityRecord1EigwPost(requestBody: AddNaturalImmunityRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/natural-immunity/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Get Vaccine Trial History + * Post v1/individual/vaccine-trial/history + * @return {VaccineTrialHistoryResponseType} 200 OK + */ + AirImmunisationVaccineTrialHistory1EigwPost(requestBody: AirHistoryRequestType): Observable { + return this.http.post(this.baseUri + 'v1/individual/vaccine-trial/history', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Post v1.1/schedule/catchup + * @return {CatchupDateResponseType} 200 OK + */ + AirImmunisationScheduleCatchup110EigwPost(requestBody: CatchupDateRequestType): Observable { + return this.http.post(this.baseUri + 'v1.1/schedule/catchup', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Record Encounter request + * Post v1.1/encounters/record + * @return {AddEncounterResponseType} 200 OK + */ + AirImmunisationEncounterRecord110EigwPost(requestBody: AddEncounterRequestType): Observable { + return this.http.post(this.baseUri + 'v1.1/encounters/record', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Update Encounter request + * Post v1/encounter/update + * @return {UpdateEncounterResponseType} 200 OK + */ + AirImmunisationEncounterUpdate1EigwPost(requestBody: UpdateEncounterRequestType): Observable { + return this.http.post(this.baseUri + 'v1/encounter/update', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/Pet.txt b/Tests/SwagTsTests/NG2Results/Pet.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/Pet.txt rename to Tests/SwagTsTests/NG2Results/Pet.ts index e6503f75..e90187a3 100644 --- a/Tests/SwagTsTests/NG2Results/Pet.txt +++ b/Tests/SwagTsTests/NG2Results/Pet.ts @@ -1,391 +1,391 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetByTags.txt b/Tests/SwagTsTests/NG2Results/PetByTags.ts similarity index 95% rename from Tests/SwagTsTests/NG2Results/PetByTags.txt rename to Tests/SwagTsTests/NG2Results/PetByTags.ts index ef2bb07f..31ff796d 100644 --- a/Tests/SwagTsTests/NG2Results/PetByTags.txt +++ b/Tests/SwagTsTests/NG2Results/PetByTags.ts @@ -1,207 +1,207 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetDelete.txt b/Tests/SwagTsTests/NG2Results/PetDelete.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/PetDelete.txt rename to Tests/SwagTsTests/NG2Results/PetDelete.ts index 9b683dc5..75a77ffc 100644 --- a/Tests/SwagTsTests/NG2Results/PetDelete.txt +++ b/Tests/SwagTsTests/NG2Results/PetDelete.ts @@ -1,23 +1,23 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetFindByStatus.txt b/Tests/SwagTsTests/NG2Results/PetFindByStatus.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/PetFindByStatus.txt rename to Tests/SwagTsTests/NG2Results/PetFindByStatus.ts index 5cbba530..f1f09f2d 100644 --- a/Tests/SwagTsTests/NG2Results/PetFindByStatus.txt +++ b/Tests/SwagTsTests/NG2Results/PetFindByStatus.ts @@ -1,125 +1,125 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus2 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus2(status: PetStatus): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus2?status=' + status, {}); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus3 - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus3(status: PetStatus): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus3?status=' + status, {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus2 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus2(status: PetStatus): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus2?status=' + status, {}); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus3 + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus3(status: PetStatus): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus3?status=' + status, {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetGodClass.txt b/Tests/SwagTsTests/NG2Results/PetGodClass.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/PetGodClass.txt rename to Tests/SwagTsTests/NG2Results/PetGodClass.ts index e9e62df9..f1eed574 100644 --- a/Tests/SwagTsTests/NG2Results/PetGodClass.txt +++ b/Tests/SwagTsTests/NG2Results/PetGodClass.ts @@ -1,338 +1,338 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - @Injectable() - export class Misc { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPost(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - PetPut(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - Pet_petIdGet(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - Pet_petIdDelete(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - PetFindByStatusGetByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - PetFindByTagsGetByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - StoreInventoryGet(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - StoreOrderPost(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - StoreOrder_orderIdGet(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - StoreOrder_orderIdDelete(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - UserPost(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - User_usernameGet(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - User_usernamePut(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - User_usernameDelete(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithArrayPost(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - UserCreateWithListPost(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - UserLoginGetByUsernameAndPassword(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - UserLogoutGet(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + @Injectable() + export class Misc { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPost(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + PetPut(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + Pet_petIdGet(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + Pet_petIdDelete(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + PetFindByStatusGetByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + PetFindByTagsGetByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + StoreInventoryGet(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + StoreOrderPost(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + StoreOrder_orderIdGet(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + StoreOrder_orderIdDelete(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + UserPost(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + User_usernameGet(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + User_usernamePut(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + User_usernameDelete(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithArrayPost(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + UserCreateWithListPost(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + UserLoginGetByUsernameAndPassword(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + UserLogoutGet(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetPathAsContainer.txt b/Tests/SwagTsTests/NG2Results/PetPathAsContainer.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/PetPathAsContainer.txt rename to Tests/SwagTsTests/NG2Results/PetPathAsContainer.ts index 153c5c20..cf271279 100644 --- a/Tests/SwagTsTests/NG2Results/PetPathAsContainer.txt +++ b/Tests/SwagTsTests/NG2Results/PetPathAsContainer.ts @@ -1,416 +1,416 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ApiResponse { - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** The measured skill for hunting */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** Category name */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** The size of the pack the dog is from */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** Average amount of honey produced per day in ounces */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** The name given to a pet */ - name: string; - - /** The list of URL to a cute photos featuring pet */ - photoUrls: Array; - friend?: Pet; - - /** Tags attached to the pet */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** Tag name */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - id?: string | null; - pet?: Pet; - - /** User supplied username */ - username?: string | null; - - /** User first name */ - firstName?: string | null; - - /** User last name */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** User status */ - userStatus?: number | null; - } - - @Injectable() - export class PetClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Post(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - Put(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class Pet_petIdClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * @return {Pet} successful operation - */ - GetByPetId(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * @return {void} - */ - DeleteByPetId(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class Pet_petIdUploadImageClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - } - - @Injectable() - export class PetFindByStatusClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - GetByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - } - - @Injectable() - export class PetFindByTagsClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - GetByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - } - - @Injectable() - export class StoreInventoryClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - Get(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - } - - @Injectable() - export class StoreOrderClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - Post(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - - @Injectable() - export class StoreOrder_orderIdClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * @return {Order} successful operation - */ - GetByOrderId(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * @return {void} - */ - DeleteByOrderId(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - Post(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class User_usernameClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetByUsername(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - PutByUsername(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteByUsername(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserCreateWithArrayClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserCreateWithListClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - Post(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - - @Injectable() - export class UserLoginClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - GetByUsernameAndPassword(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - } - - @Injectable() - export class UserLogoutClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - Get(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ApiResponse { + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** The measured skill for hunting */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** Category name */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** The size of the pack the dog is from */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** Average amount of honey produced per day in ounces */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** The name given to a pet */ + name: string; + + /** The list of URL to a cute photos featuring pet */ + photoUrls: Array; + friend?: Pet; + + /** Tags attached to the pet */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** Tag name */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + id?: string | null; + pet?: Pet; + + /** User supplied username */ + username?: string | null; + + /** User first name */ + firstName?: string | null; + + /** User last name */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** User password, MUST contain a mix of upper and lower case letters, as well as digits */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** User status */ + userStatus?: number | null; + } + + @Injectable() + export class PetClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Post(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + Put(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class Pet_petIdClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * @return {Pet} successful operation + */ + GetByPetId(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * @return {void} + */ + DeleteByPetId(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class Pet_petIdUploadImageClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + } + + @Injectable() + export class PetFindByStatusClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + GetByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + } + + @Injectable() + export class PetFindByTagsClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + GetByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + } + + @Injectable() + export class StoreInventoryClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + Get(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + } + + @Injectable() + export class StoreOrderClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + Post(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + + @Injectable() + export class StoreOrder_orderIdClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * @return {Order} successful operation + */ + GetByOrderId(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * @return {void} + */ + DeleteByOrderId(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + Post(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class User_usernameClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetByUsername(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + PutByUsername(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteByUsername(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserCreateWithArrayClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserCreateWithListClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + Post(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + + @Injectable() + export class UserLoginClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + GetByUsernameAndPassword(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + } + + @Injectable() + export class UserLogoutClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + Get(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetReturnNumber.txt b/Tests/SwagTsTests/NG2Results/PetReturnNumber.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/PetReturnNumber.txt rename to Tests/SwagTsTests/NG2Results/PetReturnNumber.ts index 38488718..3322e8cf 100644 --- a/Tests/SwagTsTests/NG2Results/PetReturnNumber.txt +++ b/Tests/SwagTsTests/NG2Results/PetReturnNumber.ts @@ -1,391 +1,391 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for loginKKK - * @param {string} password The password for login in clear textPPP - * @return {string} Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for loginKKK + * @param {string} password The password for login in clear textPPP + * @return {string} Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), {}); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetStore.txt b/Tests/SwagTsTests/NG2Results/PetStore.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/PetStore.txt rename to Tests/SwagTsTests/NG2Results/PetStore.ts index 4146e192..4b5e2fd2 100644 --- a/Tests/SwagTsTests/NG2Results/PetStore.txt +++ b/Tests/SwagTsTests/NG2Results/PetStore.ts @@ -1,304 +1,304 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Order { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - petId?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - quantity?: number | null; - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - complete?: boolean | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Customer { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - address?: Array
; - } - - export interface Address { - street?: string | null; - city?: string | null; - state?: string | null; - zip?: string | null; - } - - export interface Category { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - username?: string | null; - firstName?: string | null; - lastName?: string | null; - email?: string | null; - password?: string | null; - phone?: string | null; - - /** - * User Status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - export interface Tag { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - name?: string | null; - } - - export interface Pet { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - - /** Required */ - name: string; - category?: Category; - - /** Required */ - photoUrls: Array; - tags?: Array; - - /** pet status in the store */ - status?: PetStatus | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Update an existing pet - * Update an existing pet by Id - * Put pet - * @param {Pet} requestBody Update an existent pet in the store - * @return {Pet} Successful operation - */ - UpdatePet(requestBody: Pet): Observable { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Add a new pet to the store - * Add a new pet to the store - * Post pet - * @param {Pet} requestBody Create a new pet in the store - * @return {Pet} Successful operation - */ - AddPet(requestBody: Pet): Observable { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {PetStatus} status Status values that need to be considered for filter - * @return {Array} successful operation - */ - FindPetsByStatus(status: PetStatus | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Updates a pet in the store with form data - * Post pet/{petId} - * @param {string} petId ID of pet that needs to be updated - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @param {string} name Name of pet that needs to be updated - * @param {string} status Status of pet that needs to be updated - * @return {void} - */ - UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Deletes a pet - * delete a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Place a new order in the store - * Post store/order - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. - * Get store/order/{orderId} - * @param {string} orderId ID of order that needs to be fetched - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + orderId, { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Creates list of users with given input array - * Post user/createWithList - * @return {User} Successful operation - */ - CreateUsersWithListInput(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string | null | undefined, password: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Update user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Update an existent user in the store - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Order { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + petId?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + quantity?: number | null; + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + complete?: boolean | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Customer { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + address?: Array
; + } + + export interface Address { + street?: string | null; + city?: string | null; + state?: string | null; + zip?: string | null; + } + + export interface Category { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + username?: string | null; + firstName?: string | null; + lastName?: string | null; + email?: string | null; + password?: string | null; + phone?: string | null; + + /** + * User Status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + export interface Tag { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + name?: string | null; + } + + export interface Pet { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + + /** Required */ + name: string; + category?: Category; + + /** Required */ + photoUrls: Array; + tags?: Array; + + /** pet status in the store */ + status?: PetStatus | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Update an existing pet + * Update an existing pet by Id + * Put pet + * @param {Pet} requestBody Update an existent pet in the store + * @return {Pet} Successful operation + */ + UpdatePet(requestBody: Pet): Observable { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Add a new pet to the store + * Add a new pet to the store + * Post pet + * @param {Pet} requestBody Create a new pet in the store + * @return {Pet} Successful operation + */ + AddPet(requestBody: Pet): Observable { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {PetStatus} status Status values that need to be considered for filter + * @return {Array} successful operation + */ + FindPetsByStatus(status: PetStatus | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?status=' + status, {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Updates a pet in the store with form data + * Post pet/{petId} + * @param {string} petId ID of pet that needs to be updated + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @param {string} name Name of pet that needs to be updated + * @param {string} status Status of pet that needs to be updated + * @return {void} + */ + UpdatePetWithForm(petId: string, name: string | null | undefined, status: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'pet/' + petId + '?name=' + (name == null ? '' : encodeURIComponent(name)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Deletes a pet + * delete a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Place a new order in the store + * Post store/order + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. + * Get store/order/{orderId} + * @param {string} orderId ID of order that needs to be fetched + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + orderId, { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Creates list of users with given input array + * Post user/createWithList + * @return {User} Successful operation + */ + CreateUsersWithListInput(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string | null | undefined, password: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Update user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Update an existent user in the store + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/PetStoreExpanded.txt b/Tests/SwagTsTests/NG2Results/PetStoreExpanded.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/PetStoreExpanded.txt rename to Tests/SwagTsTests/NG2Results/PetStoreExpanded.ts index d877b0f6..193180da 100644 --- a/Tests/SwagTsTests/NG2Results/PetStoreExpanded.txt +++ b/Tests/SwagTsTests/NG2Results/PetStoreExpanded.ts @@ -1,69 +1,69 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Pet extends NewPet { - id: string; - } - - export interface NewPet { - name: string; - tag?: string | null; - } - - export interface Error { - code: number; - message: string; - } - - @Injectable() - export class Misc { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Returns all pets from the system that the user has access to - * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. - * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. - * Get pets - * @param {Array} tags tags to filter by - * @param {number} limit maximum number of results to return - * @return {Array} pet response - */ - FindPets(tags: Array | null | undefined, limit: number | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}); - } - - /** - * Creates a new pet in the store. Duplicates are allowed - * Post pets - * @param {NewPet} requestBody Pet to add to the store - * @return {Pet} pet response - */ - AddPet(requestBody: NewPet): Observable { - return this.http.post(this.baseUri + 'pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Returns a user based on a single ID, if the user does not have access to the pet - * Get pets/{id} - * @param {string} id ID of pet to fetch - * @return {Pet} pet response - */ - FindPetById(id: string): Observable { - return this.http.get(this.baseUri + 'pets/' + id, {}); - } - - /** - * deletes a single pet based on the ID supplied - * Delete pets/{id} - * @param {string} id ID of pet to delete - * @return {void} - */ - DeletePet(id: string): Observable> { - return this.http.delete(this.baseUri + 'pets/' + id, { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Pet extends NewPet { + id: string; + } + + export interface NewPet { + name: string; + tag?: string | null; + } + + export interface Error { + code: number; + message: string; + } + + @Injectable() + export class Misc { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Returns all pets from the system that the user has access to + * Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia. + * Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien. + * Get pets + * @param {Array} tags tags to filter by + * @param {number} limit maximum number of results to return + * @return {Array} pet response + */ + FindPets(tags: Array | null | undefined, limit: number | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'pets?' + tags?.map(z => `tags=${encodeURIComponent(z)}`).join('&') + '&limit=' + limit, {}); + } + + /** + * Creates a new pet in the store. Duplicates are allowed + * Post pets + * @param {NewPet} requestBody Pet to add to the store + * @return {Pet} pet response + */ + AddPet(requestBody: NewPet): Observable { + return this.http.post(this.baseUri + 'pets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Returns a user based on a single ID, if the user does not have access to the pet + * Get pets/{id} + * @param {string} id ID of pet to fetch + * @return {Pet} pet response + */ + FindPetById(id: string): Observable { + return this.http.get(this.baseUri + 'pets/' + id, {}); + } + + /** + * deletes a single pet based on the ID supplied + * Delete pets/{id} + * @param {string} id ID of pet to delete + * @return {void} + */ + DeletePet(id: string): Observable> { + return this.http.delete(this.baseUri + 'pets/' + id, { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/Pet_EnumToString.txt b/Tests/SwagTsTests/NG2Results/Pet_EnumToString.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/Pet_EnumToString.txt rename to Tests/SwagTsTests/NG2Results/Pet_EnumToString.ts index 7b4e2b21..fdc5aa67 100644 --- a/Tests/SwagTsTests/NG2Results/Pet_EnumToString.txt +++ b/Tests/SwagTsTests/NG2Results/Pet_EnumToString.ts @@ -1,391 +1,391 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 'clueless', lazy = 'lazy', adventurous = 'adventurous', aggressive = 'aggressive' } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 'placed', approved = 'approved', delivered = 'delivered' } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 'available', pending = 'pending', sold = 'sold' } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - AddPet(requestBody: Pet): Observable> { - return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @param {Pet} requestBody Pet object that needs to be added to the store - * @return {void} - */ - UpdatePet(requestBody: Pet): Observable> { - return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1 Maximum: 5 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithArrayInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @param {Array} requestBody List of user object - * @return {void} - */ - CreateUsersWithListInput(requestBody: Array): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 'clueless', lazy = 'lazy', adventurous = 'adventurous', aggressive = 'aggressive' } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 'placed', approved = 'approved', delivered = 'delivered' } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 'available', pending = 'pending', sold = 'sold' } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + AddPet(requestBody: Pet): Observable> { + return this.http.post(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @param {Pet} requestBody Pet object that needs to be added to the store + * @return {void} + */ + UpdatePet(requestBody: Pet): Observable> { + return this.http.put(this.baseUri + 'pet', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1 Maximum: 5 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithArrayInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @param {Array} requestBody List of user object + * @return {void} + */ + CreateUsersWithListInput(requestBody: Array): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/Uspto.txt b/Tests/SwagTsTests/NG2Results/Uspto.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/Uspto.txt rename to Tests/SwagTsTests/NG2Results/Uspto.ts index b95aae6f..b64b5dc7 100644 --- a/Tests/SwagTsTests/NG2Results/Uspto.txt +++ b/Tests/SwagTsTests/NG2Results/Uspto.ts @@ -1,59 +1,59 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface DataSetList { - total?: number | null; - DataSetListApis?: Array; - } - - export interface DataSetListApis { - - /** To be used as a dataset parameter value */ - apiKey?: string | null; - - /** To be used as a version parameter value */ - apiVersionNumber?: string | null; - - /** The URL describing the dataset's fields */ - apiUrl?: string | null; - - /** A URL to the API console for each API */ - apiDocumentationUrl?: string | null; - } - - @Injectable() - export class MetadataClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * List available data sets - * Get - * @return {DataSetList} Returns a list of data sets - */ - ListDataSets(): Observable { - return this.http.get(this.baseUri + '', {}); - } - - /** - * Provides the general information about the API and the list of fields that can be used to query the dataset. - * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. - * Get {dataset}/{version}/fields - * @param {string} dataset Name of the dataset. - * @param {string} version Version of the dataset. - * @return {string} The dataset API for the given version is found and it is accessible to consume. - */ - ListSearchableFields(dataset: string, version: string): Observable { - return this.http.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { responseType: 'text' }); - } - } - - @Injectable() - export class SearchClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface DataSetList { + total?: number | null; + DataSetListApis?: Array; + } + + export interface DataSetListApis { + + /** To be used as a dataset parameter value */ + apiKey?: string | null; + + /** To be used as a version parameter value */ + apiVersionNumber?: string | null; + + /** The URL describing the dataset's fields */ + apiUrl?: string | null; + + /** A URL to the API console for each API */ + apiDocumentationUrl?: string | null; + } + + @Injectable() + export class MetadataClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * List available data sets + * Get + * @return {DataSetList} Returns a list of data sets + */ + ListDataSets(): Observable { + return this.http.get(this.baseUri + '', {}); + } + + /** + * Provides the general information about the API and the list of fields that can be used to query the dataset. + * This GET API returns the list of all the searchable field names that are in the oa_citations. Please see the 'fields' attribute which returns an array of field names. Each field or a combination of fields can be searched using the syntax options shown below. + * Get {dataset}/{version}/fields + * @param {string} dataset Name of the dataset. + * @param {string} version Version of the dataset. + * @return {string} The dataset API for the given version is found and it is accessible to consume. + */ + ListSearchableFields(dataset: string, version: string): Observable { + return this.http.get(this.baseUri + (dataset == null ? '' : encodeURIComponent(dataset)) + '/' + (version == null ? '' : encodeURIComponent(version)) + '/fields', { responseType: 'text' }); + } + } + + @Injectable() + export class SearchClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/ValuesPaths.txt b/Tests/SwagTsTests/NG2Results/ValuesPaths.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/ValuesPaths.txt rename to Tests/SwagTsTests/NG2Results/ValuesPaths.ts index 8ea25aed..0c04a73e 100644 --- a/Tests/SwagTsTests/NG2Results/ValuesPaths.txt +++ b/Tests/SwagTsTests/NG2Results/ValuesPaths.ts @@ -1,55 +1,55 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Get api/Values - * @return {Array} Success - */ - ValuesGet(): Observable> { - return this.http.get>(this.baseUri + 'api/Values', {}); - } - - /** - * Post api/Values - * @return {string} Success - */ - ValuesPost(requestBody: string): Observable { - return this.http.post(this.baseUri + 'api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * Get api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {string} Success - */ - ValuesGetById(id: number): Observable { - return this.http.get(this.baseUri + 'api/Values/' + id, { responseType: 'text' }); - } - - /** - * Put api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesPutById(id: number, requestBody: string): Observable> { - return this.http.put(this.baseUri + 'api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete api/Values/{id} - * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Success - */ - ValuesDeleteById(id: number): Observable> { - return this.http.delete(this.baseUri + 'api/Values/' + id, { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Get api/Values + * @return {Array} Success + */ + ValuesGet(): Observable> { + return this.http.get>(this.baseUri + 'api/Values', {}); + } + + /** + * Post api/Values + * @return {string} Success + */ + ValuesPost(requestBody: string): Observable { + return this.http.post(this.baseUri + 'api/Values', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * Get api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {string} Success + */ + ValuesGetById(id: number): Observable { + return this.http.get(this.baseUri + 'api/Values/' + id, { responseType: 'text' }); + } + + /** + * Put api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesPutById(id: number, requestBody: string): Observable> { + return this.http.put(this.baseUri + 'api/Values/' + id, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete api/Values/{id} + * @param {number} id Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Success + */ + ValuesDeleteById(id: number): Observable> { + return this.http.delete(this.baseUri + 'api/Values/' + id, { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/googleBooksOpenApi.txt b/Tests/SwagTsTests/NG2Results/googleBooksOpenApi.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/googleBooksOpenApi.txt rename to Tests/SwagTsTests/NG2Results/googleBooksOpenApi.ts index 805dd8b1..ed4bb80e 100644 --- a/Tests/SwagTsTests/NG2Results/googleBooksOpenApi.txt +++ b/Tests/SwagTsTests/NG2Results/googleBooksOpenApi.ts @@ -1,2251 +1,2251 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Annotation { - - /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ - afterSelectedText?: string | null; - - /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ - beforeSelectedText?: string | null; - - /** Selection ranges sent from the client. */ - clientVersionRanges?: AnnotationClientVersionRanges; - - /** Timestamp for the created time of this annotation. */ - created?: Date | null; - - /** Selection ranges for the most recent content version. */ - currentVersionRanges?: AnnotationCurrentVersionRanges; - - /** User-created data for this annotation. */ - data?: string | null; - - /** Indicates that this annotation is deleted. */ - deleted?: boolean | null; - - /** The highlight style for this annotation. */ - highlightStyle?: string | null; - - /** Id of this annotation, in the form of a GUID. */ - id?: string | null; - - /** Resource type. */ - kind?: string | null; - - /** The layer this annotation is for. */ - layerId?: string | null; - layerSummary?: AnnotationLayerSummary; - - /** Pages that this annotation spans. */ - pageIds?: Array; - - /** Excerpt from the volume. */ - selectedText?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Timestamp for the last time this annotation was modified. */ - updated?: Date | null; - - /** The volume that this annotation belongs to. */ - volumeId?: string | null; - } - - export interface AnnotationClientVersionRanges { - cfiRange?: BooksAnnotationsRange; - - /** Content version the client sent in. */ - contentVersion?: string | null; - gbImageRange?: BooksAnnotationsRange; - gbTextRange?: BooksAnnotationsRange; - imageCfiRange?: BooksAnnotationsRange; - } - - export interface BooksAnnotationsRange { - - /** The offset from the ending position. */ - endOffset?: string | null; - - /** The ending position for the range. */ - endPosition?: string | null; - - /** The offset from the starting position. */ - startOffset?: string | null; - - /** The starting position for the range. */ - startPosition?: string | null; - } - - export interface AnnotationCurrentVersionRanges { - cfiRange?: BooksAnnotationsRange; - - /** Content version applicable to ranges below. */ - contentVersion?: string | null; - gbImageRange?: BooksAnnotationsRange; - gbTextRange?: BooksAnnotationsRange; - imageCfiRange?: BooksAnnotationsRange; - } - - export interface AnnotationLayerSummary { - - /** - * Maximum allowed characters on this layer, especially for the "copy" layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - allowedCharacterCount?: number | null; - - /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ - limitType?: string | null; - - /** - * Remaining allowed characters on this layer, especially for the "copy" layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - remainingCharacterCount?: number | null; - } - - export interface Annotationdata { - - /** The type of annotation this data is for. */ - annotationType?: string | null; - data?: any; - - /** Base64 encoded data for this annotation data. */ - encoded_data?: string | null; - - /** Unique id for this annotation data. */ - id?: string | null; - - /** Resource Type */ - kind?: string | null; - - /** The Layer id for this data. * */ - layerId?: string | null; - - /** URL for this resource. * */ - selfLink?: string | null; - - /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - - /** The volume id for this data. * */ - volumeId?: string | null; - } - - export interface Annotations { - - /** A list of annotations. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken?: string | null; - - /** - * Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - - export interface AnnotationsSummary { - kind?: string | null; - AnnotationsSummaryLayers?: Array; - } - - export interface AnnotationsSummaryLayers { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - allowedCharacterCount?: number | null; - layerId?: string | null; - limitType?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - remainingCharacterCount?: number | null; - updated?: Date | null; - } - - export interface Annotationsdata { - - /** A list of Annotation Data. */ - items?: Array; - - /** Resource type */ - kind?: string | null; - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken?: string | null; - - /** - * The total number of volume annotations found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - - export interface BooksCloudloadingResource { - author?: string | null; - processingState?: string | null; - title?: string | null; - volumeId?: string | null; - } - - export interface BooksSubscriptionReleaseInfo { - - /** Amount in micros of the specified currency code. */ - amountInMicros?: string | null; - - /** Currency code of the amount. */ - currencyCode?: string | null; - - /** The release number of this issue/volume/book. */ - releaseNumber?: string | null; - - /** The release date. */ - releaseTimestampUs?: string | null; - } - - export interface BooksVolumesRecommendedRateResponse { - consistency_token?: string | null; - } - - export interface Bookshelf { - - /** Whether this bookshelf is PUBLIC or PRIVATE. */ - access?: string | null; - - /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ - created?: Date | null; - - /** Description of this bookshelf. */ - description?: string | null; - - /** - * Id of this bookshelf, only unique by user. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - id?: number | null; - - /** Resource type for bookshelf metadata. */ - kind?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Title of this bookshelf. */ - title?: string | null; - - /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ - updated?: Date | null; - - /** - * Number of volumes in this bookshelf. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - volumeCount?: number | null; - - /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ - volumesLastUpdated?: Date | null; - } - - export interface Bookshelves { - - /** A list of bookshelves. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - } - - export interface Category { - - /** A list of onboarding categories. */ - CategoryItems?: Array; - - /** Resource type. */ - kind?: string | null; - } - - export interface CategoryItems { - badgeUrl?: string | null; - categoryId?: string | null; - name?: string | null; - } - - export interface ConcurrentAccessRestriction { - - /** Whether access is granted for this (user, device, volume). */ - deviceAllowed?: boolean | null; - - /** Resource type. */ - kind?: string | null; - - /** - * The maximum number of concurrent access licenses for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxConcurrentDevices?: number | null; - - /** Error/warning message. */ - message?: string | null; - - /** Client nonce for verification. Download access and client-validation only. */ - nonce?: string | null; - - /** Error/warning reason code. */ - reasonCode?: string | null; - - /** Whether this volume has any concurrent access restrictions. */ - restricted?: boolean | null; - - /** Response signature. */ - signature?: string | null; - - /** Client app identifier for verification. Download access and client-validation only. */ - source?: string | null; - - /** - * Time in seconds for license auto-expiration. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - timeWindowSeconds?: number | null; - - /** Identifies the volume for which this entry applies. */ - volumeId?: string | null; - } - - export interface Dictlayerdata { - common?: DictlayerdataCommon; - dict?: DictlayerdataDict; - kind?: string | null; - } - - export interface DictlayerdataCommon { - - /** The display title and localized canonical name to use when searching for this entity on Google search. */ - title?: string | null; - } - - export interface DictlayerdataDict { - - /** The source, url and attribution for this dictionary data. */ - source?: DictlayerdataDictSource; - DictlayerdataDictWords?: Array; - } - - export interface DictlayerdataDictSource { - attribution?: string | null; - url?: string | null; - } - - export interface DictlayerdataDictWords { - DictlayerdataDictWordsDerivatives?: Array; - DictlayerdataDictWordsExamples?: Array; - DictlayerdataDictWordsSenses?: Array; - - /** The words with different meanings but not related words, e.g. "go" (game) and "go" (verb). */ - source?: DictlayerdataDictWordsSource; - } - - export interface DictlayerdataDictWordsDerivatives { - source?: DictlayerdataDictWordsDerivativesSource; - text?: string | null; - } - - export interface DictlayerdataDictWordsDerivativesSource { - attribution?: string | null; - url?: string | null; - } - - export interface DictlayerdataDictWordsExamples { - source?: DictlayerdataDictWordsExamplesSource; - text?: string | null; - } - - export interface DictlayerdataDictWordsExamplesSource { - attribution?: string | null; - url?: string | null; - } - - export interface DictlayerdataDictWordsSenses { - DictlayerdataDictWordsSensesConjugations?: Array; - DictlayerdataDictWordsSensesDefinitions?: Array; - partOfSpeech?: string | null; - pronunciation?: string | null; - pronunciationUrl?: string | null; - source?: DictlayerdataDictWordsSensesSource; - syllabification?: string | null; - DictlayerdataDictWordsSensesSynonyms?: Array; - } - - export interface DictlayerdataDictWordsSensesConjugations { - type?: string | null; - value?: string | null; - } - - export interface DictlayerdataDictWordsSensesDefinitions { - definition?: string | null; - DictlayerdataDictWordsSensesDefinitionsExamples?: Array; - } - - export interface DictlayerdataDictWordsSensesDefinitionsExamples { - source?: DictlayerdataDictWordsSensesDefinitionsExamplesSource; - text?: string | null; - } - - export interface DictlayerdataDictWordsSensesDefinitionsExamplesSource { - attribution?: string | null; - url?: string | null; - } - - export interface DictlayerdataDictWordsSensesSource { - attribution?: string | null; - url?: string | null; - } - - export interface DictlayerdataDictWordsSensesSynonyms { - source?: DictlayerdataDictWordsSensesSynonymsSource; - text?: string | null; - } - - export interface DictlayerdataDictWordsSensesSynonymsSource { - attribution?: string | null; - url?: string | null; - } - - export interface DictlayerdataDictWordsSource { - attribution?: string | null; - url?: string | null; - } - - export interface Discoveryclusters { - DiscoveryclustersClusters?: Array; - - /** Resorce type. */ - kind?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - totalClusters?: number | null; - } - - export interface DiscoveryclustersClusters { - banner_with_content_container?: DiscoveryclustersClustersBanner_with_content_container; - subTitle?: string | null; - title?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - totalVolumes?: number | null; - uid?: string | null; - volumes?: Array; - } - - export interface DiscoveryclustersClustersBanner_with_content_container { - fillColorArgb?: string | null; - imageUrl?: string | null; - maskColorArgb?: string | null; - moreButtonText?: string | null; - moreButtonUrl?: string | null; - textColorArgb?: string | null; - } - - export interface Volume { - - /** Any information about a volume related to reading or obtaining that volume text. This information can depend on country (books may be public domain in one country but not in another, e.g.). */ - accessInfo?: VolumeAccessInfo; - - /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ - etag?: string | null; - - /** Unique identifier for a volume. (In LITE projection.) */ - id?: string | null; - - /** Resource type for a volume. (In LITE projection.) */ - kind?: string | null; - - /** What layers exist in this volume and high level information about them. */ - layerInfo?: VolumeLayerInfo; - - /** Recommendation related information for this volume. */ - recommendedInfo?: VolumeRecommendedInfo; - - /** Any information about a volume related to the eBookstore and/or purchaseability. This information can depend on the country where the request originates from (i.e. books may not be for sale in certain countries). */ - saleInfo?: VolumeSaleInfo; - - /** Search result information related to this volume. */ - searchInfo?: VolumeSearchInfo; - - /** URL to this resource. (In LITE projection.) */ - selfLink?: string | null; - - /** User specific information related to this volume. (e.g. page this user last read or whether they purchased this book) */ - userInfo?: VolumeUserInfo; - - /** General volume information. */ - volumeInfo?: VolumeVolumeInfo; - } - - export interface VolumeAccessInfo { - - /** Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE projection.) */ - accessViewStatus?: string | null; - - /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ - country?: string | null; - downloadAccess?: DownloadAccessRestriction; - - /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ - driveImportedContentLink?: string | null; - - /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ - embeddable?: boolean | null; - - /** Information about epub content. (In LITE projection.) */ - epub?: VolumeAccessInfoEpub; - - /** Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the content, if the client supports it. */ - explicitOfflineLicenseManagement?: boolean | null; - - /** Information about pdf content. (In LITE projection.) */ - pdf?: VolumeAccessInfoPdf; - - /** Whether or not this book is public domain in the country listed above. */ - publicDomain?: boolean | null; - - /** Whether quote sharing is allowed for this volume. */ - quoteSharingAllowed?: boolean | null; - - /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ - textToSpeechPermission?: string | null; - - /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ - viewOrderUrl?: string | null; - - /** The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as non-eBooks. Public domain books will always have a value of ALL_PAGES. */ - viewability?: string | null; - - /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ - webReaderLink?: string | null; - } - - export interface DownloadAccessRestriction { - - /** If restricted, whether access is granted for this (user, device, volume). */ - deviceAllowed?: boolean | null; - - /** - * If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - downloadsAcquired?: number | null; - - /** If deviceAllowed, whether access was just acquired with this request. */ - justAcquired?: boolean | null; - - /** Resource type. */ - kind?: string | null; - - /** - * If restricted, the maximum number of content download licenses for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxDownloadDevices?: number | null; - - /** Error/warning message. */ - message?: string | null; - - /** Client nonce for verification. Download access and client-validation only. */ - nonce?: string | null; - - /** Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS */ - reasonCode?: string | null; - - /** Whether this volume has any download access restrictions. */ - restricted?: boolean | null; - - /** Response signature. */ - signature?: string | null; - - /** Client app identifier for verification. Download access and client-validation only. */ - source?: string | null; - - /** Identifies the volume for which this entry applies. */ - volumeId?: string | null; - } - - export interface VolumeAccessInfoEpub { - - /** URL to retrieve ACS token for epub download. (In LITE projection.) */ - acsTokenLink?: string | null; - - /** URL to download epub. (In LITE projection.) */ - downloadLink?: string | null; - - /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ - isAvailable?: boolean | null; - } - - export interface VolumeAccessInfoPdf { - - /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ - acsTokenLink?: string | null; - - /** URL to download pdf. (In LITE projection.) */ - downloadLink?: string | null; - - /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ - isAvailable?: boolean | null; - } - - export interface VolumeLayerInfo { - - /** A layer should appear here if and only if the layer exists for this book. */ - VolumeLayerInfoLayers?: Array; - } - - export interface VolumeLayerInfoLayers { - - /** The layer id of this layer (e.g. "geo"). */ - layerId?: string | null; - - /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ - volumeAnnotationsVersion?: string | null; - } - - export interface VolumeRecommendedInfo { - - /** A text explaining why this volume is recommended. */ - explanation?: string | null; - } - - export interface VolumeSaleInfo { - - /** URL to purchase this volume on the Google Books site. (In LITE projection) */ - buyLink?: string | null; - - /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ - country?: string | null; - - /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ - isEbook?: boolean | null; - - /** Suggested retail price. (In LITE projection.) */ - listPrice?: VolumeSaleInfoListPrice; - - /** Offers available for this volume (sales and rentals). */ - VolumeSaleInfoOffers?: Array; - - /** The date on which this book is available for sale. */ - onSaleDate?: Date | null; - - /** The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In LITE projection.) */ - retailPrice?: VolumeSaleInfoRetailPrice; - - /** Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. */ - saleability?: string | null; - } - - export interface VolumeSaleInfoListPrice { - - /** - * Amount in the currency listed below. (In LITE projection.) - * Type: double - */ - amount?: number | null; - - /** An ISO 4217, three-letter currency code. (In LITE projection.) */ - currencyCode?: string | null; - } - - export interface VolumeSaleInfoOffers { - - /** - * The finsky offer type (e.g., PURCHASE=0 RENTAL=3) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - finskyOfferType?: number | null; - - /** Indicates whether the offer is giftable. */ - giftable?: boolean | null; - - /** Offer list (=undiscounted) price in Micros. */ - listPrice?: VolumeSaleInfoOffersListPrice; - - /** The rental duration (for rental offers only). */ - rentalDuration?: VolumeSaleInfoOffersRentalDuration; - - /** Offer retail (=discounted) price in Micros */ - retailPrice?: VolumeSaleInfoOffersRetailPrice; - } - - export interface VolumeSaleInfoOffersListPrice { - - /** Type: double */ - amountInMicros?: number | null; - currencyCode?: string | null; - } - - export interface VolumeSaleInfoOffersRentalDuration { - - /** Type: double */ - count?: number | null; - unit?: string | null; - } - - export interface VolumeSaleInfoOffersRetailPrice { - - /** Type: double */ - amountInMicros?: number | null; - currencyCode?: string | null; - } - - export interface VolumeSaleInfoRetailPrice { - - /** - * Amount in the currency listed below. (In LITE projection.) - * Type: double - */ - amount?: number | null; - - /** An ISO 4217, three-letter currency code. (In LITE projection.) */ - currencyCode?: string | null; - } - - export interface VolumeSearchInfo { - - /** A text snippet containing the search query. */ - textSnippet?: string | null; - } - - export interface VolumeUserInfo { - - /** Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family sharing, etc. */ - acquiredTime?: Date | null; - - /** - * How this volume was acquired. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - acquisitionType?: number | null; - - /** Copy/Paste accounting information. */ - copy?: VolumeUserInfoCopy; - - /** - * Whether this volume is purchased, sample, pd download etc. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - entitlementType?: number | null; - - /** Information on the ability to share with the family. */ - familySharing?: VolumeUserInfoFamilySharing; - - /** Whether or not the user shared this volume with the family. */ - isFamilySharedFromUser?: boolean | null; - - /** Whether or not the user received this volume through family sharing. */ - isFamilySharedToUser?: boolean | null; - - /** Deprecated: Replaced by familySharing. */ - isFamilySharingAllowed?: boolean | null; - - /** Deprecated: Replaced by familySharing. */ - isFamilySharingDisabledByFop?: boolean | null; - - /** Whether or not this volume is currently in "my books." */ - isInMyBooks?: boolean | null; - - /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ - isPreordered?: boolean | null; - - /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ - isPurchased?: boolean | null; - - /** Whether or not this volume was user uploaded. */ - isUploaded?: boolean | null; - readingPosition?: ReadingPosition; - - /** Period during this book is/was a valid rental. */ - rentalPeriod?: VolumeUserInfoRentalPeriod; - - /** Whether this book is an active or an expired rental. */ - rentalState?: string | null; - review?: Review; - - /** Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - userUploadedVolumeInfo?: VolumeUserInfoUserUploadedVolumeInfo; - } - - export interface VolumeUserInfoCopy { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - allowedCharacterCount?: number | null; - limitType?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - remainingCharacterCount?: number | null; - updated?: Date | null; - } - - export interface VolumeUserInfoFamilySharing { - - /** The role of the user in the family. */ - familyRole?: string | null; - - /** Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value is true, the user can initiate a family sharing action. */ - isSharingAllowed?: boolean | null; - - /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ - isSharingDisabledByFop?: boolean | null; - } - - export interface ReadingPosition { - - /** Position in an EPUB as a CFI. */ - epubCfiPosition?: string | null; - - /** Position in a volume for image-based content. */ - gbImagePosition?: string | null; - - /** Position in a volume for text-based content. */ - gbTextPosition?: string | null; - - /** Resource type for a reading position. */ - kind?: string | null; - - /** Position in a PDF file. */ - pdfPosition?: string | null; - - /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ - updated?: Date | null; - - /** Volume id associated with this reading position. */ - volumeId?: string | null; - } - - export interface VolumeUserInfoRentalPeriod { - endUtcSec?: string | null; - startUtcSec?: string | null; - } - - export interface Review { - - /** Author of this review. */ - author?: ReviewAuthor; - - /** Review text. */ - content?: string | null; - - /** Date of this review. */ - date?: string | null; - - /** URL for the full review text, for reviews gathered from the web. */ - fullTextUrl?: string | null; - - /** Resource type for a review. */ - kind?: string | null; - - /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ - rating?: string | null; - - /** Information regarding the source of this review, when the review is not from a Google Books user. */ - source?: ReviewSource; - - /** Title for this review. */ - title?: string | null; - - /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ - type?: string | null; - - /** Volume that this review is for. */ - volumeId?: string | null; - } - - export interface ReviewAuthor { - - /** Name of this person. */ - displayName?: string | null; - } - - export interface ReviewSource { - - /** Name of the source. */ - description?: string | null; - - /** Extra text about the source of the review. */ - extraDescription?: string | null; - - /** URL of the source of the review. */ - url?: string | null; - } - - export interface VolumeUserInfoUserUploadedVolumeInfo { - processingState?: string | null; - } - - export interface VolumeVolumeInfo { - - /** Whether anonymous logging should be allowed. */ - allowAnonLogging?: boolean | null; - - /** The names of the authors and/or editors for this volume. (In LITE projection) */ - authors?: Array; - - /** - * The mean review rating for this volume. (min = 1.0, max = 5.0) - * Type: double - */ - averageRating?: number | null; - - /** Canonical URL for a volume. (In LITE projection.) */ - canonicalVolumeLink?: string | null; - - /** A list of subject categories, such as "Fiction", "Suspense", etc. */ - categories?: Array; - - /** Whether the volume has comics content. */ - comicsContent?: boolean | null; - - /** An identifier for the version of the volume content (text & images). (In LITE projection) */ - contentVersion?: string | null; - - /** A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE projection.) */ - description?: string | null; - - /** Physical dimensions of this volume. */ - dimensions?: VolumeVolumeInfoDimensions; - - /** A list of image links for all the sizes that are available. (In LITE projection.) */ - imageLinks?: VolumeVolumeInfoImageLinks; - - /** Industry standard identifiers for this volume. */ - VolumeVolumeInfoIndustryIdentifiers?: Array; - - /** URL to view information about this volume on the Google Books site. (In LITE projection) */ - infoLink?: string | null; - - /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ - language?: string | null; - - /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ - mainCategory?: string | null; - maturityRating?: string | null; - - /** - * Total number of pages as per publisher metadata. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageCount?: number | null; - - /** A top-level summary of the panelization info in this volume. */ - panelizationSummary?: VolumeVolumeInfoPanelizationSummary; - - /** URL to preview this volume on the Google Books site. */ - previewLink?: string | null; - - /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ - printType?: string | null; - - /** - * Total number of printed pages in generated pdf representation. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - printedPageCount?: number | null; - - /** Date of publication. (In LITE projection.) */ - publishedDate?: string | null; - - /** Publisher of this volume. (In LITE projection.) */ - publisher?: string | null; - - /** - * The number of review ratings for this volume. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ratingsCount?: number | null; - - /** The reading modes available for this volume. */ - readingModes?: any; - - /** - * Total number of sample pages as per publisher metadata. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - samplePageCount?: number | null; - seriesInfo?: Volumeseriesinfo; - - /** Volume subtitle. (In LITE projection.) */ - subtitle?: string | null; - - /** Volume title. (In LITE projection.) */ - title?: string | null; - } - - export interface VolumeVolumeInfoDimensions { - - /** Height or length of this volume (in cm). */ - height?: string | null; - - /** Thickness of this volume (in cm). */ - thickness?: string | null; - - /** Width of this volume (in cm). */ - width?: string | null; - } - - export interface VolumeVolumeInfoImageLinks { - - /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ - extraLarge?: string | null; - - /** Image link for large size (width of ~800 pixels). (In LITE projection) */ - large?: string | null; - - /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ - medium?: string | null; - - /** Image link for small size (width of ~300 pixels). (In LITE projection) */ - small?: string | null; - - /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ - smallThumbnail?: string | null; - - /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ - thumbnail?: string | null; - } - - export interface VolumeVolumeInfoIndustryIdentifiers { - - /** Industry specific volume identifier. */ - identifier?: string | null; - - /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ - type?: string | null; - } - - export interface VolumeVolumeInfoPanelizationSummary { - containsEpubBubbles?: boolean | null; - containsImageBubbles?: boolean | null; - epubBubbleVersion?: string | null; - imageBubbleVersion?: string | null; - } - - export interface Volumeseriesinfo { - - /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ - bookDisplayNumber?: string | null; - - /** Resource type. */ - kind?: string | null; - - /** Short book title in the context of the series. */ - shortSeriesBookTitle?: string | null; - VolumeseriesinfoVolumeSeries?: Array; - } - - export interface VolumeseriesinfoVolumeSeries { - - /** List of issues. Applicable only for Collection Edition and Omnibus. */ - VolumeseriesinfoVolumeSeriesIssue?: Array; - - /** - * The book order number in the series. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - orderNumber?: number | null; - - /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ - seriesBookType?: string | null; - - /** The series id. */ - seriesId?: string | null; - } - - export interface VolumeseriesinfoVolumeSeriesIssue { - issueDisplayNumber?: string | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - issueOrderNumber?: number | null; - } - - export interface DownloadAccesses { - - /** A list of download access responses. */ - downloadAccessList?: Array; - - /** Resource type. */ - kind?: string | null; - } - - export interface FamilyInfo { - - /** Resource type. */ - kind?: string | null; - - /** Family membership info of the user that made the request. */ - membership?: FamilyInfoMembership; - } - - export interface FamilyInfoMembership { - - /** Restrictions on user buying and acquiring content. */ - acquirePermission?: string | null; - - /** The age group of the user. */ - ageGroup?: string | null; - - /** The maximum allowed maturity rating for the user. */ - allowedMaturityRating?: string | null; - isInFamily?: boolean | null; - - /** The role of the user in the family. */ - role?: string | null; - } - - export interface Geolayerdata { - common?: GeolayerdataCommon; - geo?: GeolayerdataGeo; - kind?: string | null; - } - - export interface GeolayerdataCommon { - - /** The language of the information url and description. */ - lang?: string | null; - - /** The URL for the preview image information. */ - previewImageUrl?: string | null; - - /** The description for this location. */ - snippet?: string | null; - - /** The URL for information for this location. Ex: wikipedia link. */ - snippetUrl?: string | null; - - /** The display title and localized canonical name to use when searching for this entity on Google search. */ - title?: string | null; - } - - export interface GeolayerdataGeo { - - /** The boundary of the location as a set of loops containing pairs of latitude, longitude coordinates. */ - boundary?: Array; - - /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ - cachePolicy?: string | null; - - /** The country code of the location. */ - countryCode?: string | null; - - /** - * The latitude of the location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude of the location. - * Type: double - */ - longitude?: number | null; - - /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ - mapType?: string | null; - - /** The viewport for showing this location. This is a latitude, longitude rectangle. */ - viewport?: GeolayerdataGeoViewport; - - /** - * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - zoom?: number | null; - } - - export interface GeolayerdataGeoViewport { - hi?: GeolayerdataGeoViewportHi; - lo?: GeolayerdataGeoViewportLo; - } - - export interface GeolayerdataGeoViewportHi { - - /** Type: double */ - latitude?: number | null; - - /** Type: double */ - longitude?: number | null; - } - - export interface GeolayerdataGeoViewportLo { - - /** Type: double */ - latitude?: number | null; - - /** Type: double */ - longitude?: number | null; - } - - export interface Layersummaries { - - /** A list of layer summary items. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - - /** - * The total number of layer summaries found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - - export interface Layersummary { - - /** - * The number of annotations for this layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - annotationCount?: number | null; - - /** The list of annotation types contained for this layer. */ - annotationTypes?: Array; - - /** Link to get data for this annotation. */ - annotationsDataLink?: string | null; - - /** The link to get the annotations for this layer. */ - annotationsLink?: string | null; - - /** The content version this resource is for. */ - contentVersion?: string | null; - - /** - * The number of data items for this layer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - dataCount?: number | null; - - /** Unique id of this layer summary. */ - id?: string | null; - - /** Resource Type */ - kind?: string | null; - - /** The layer id for this summary. */ - layerId?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - - /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ - volumeAnnotationsVersion?: string | null; - - /** The volume id this resource is for. */ - volumeId?: string | null; - } - - export interface Metadata { - - /** A list of offline dictionary metadata. */ - MetadataItems?: Array; - - /** Resource type. */ - kind?: string | null; - } - - export interface MetadataItems { - download_url?: string | null; - encrypted_key?: string | null; - language?: string | null; - size?: string | null; - version?: string | null; - } - - export interface Notification { - body?: string | null; - - /** The list of crm experiment ids. */ - crmExperimentIds?: Array; - doc_id?: string | null; - doc_type?: string | null; - dont_show_notification?: boolean | null; - iconUrl?: string | null; - is_document_mature?: boolean | null; - - /** Resource type. */ - kind?: string | null; - notificationGroup?: string | null; - notification_type?: string | null; - pcampaign_id?: string | null; - reason?: string | null; - show_notification_settings_action?: boolean | null; - targetUrl?: string | null; - timeToExpireMs?: string | null; - title?: string | null; - } - - export interface Offers { - - /** A list of offers. */ - OffersItems?: Array; - - /** Resource type. */ - kind?: string | null; - } - - export interface OffersItems { - artUrl?: string | null; - gservicesKey?: string | null; - id?: string | null; - OffersItemsItems?: Array; - } - - export interface OffersItemsItems { - author?: string | null; - canonicalVolumeLink?: string | null; - coverUrl?: string | null; - description?: string | null; - title?: string | null; - volumeId?: string | null; - } - - export interface RequestAccess { - concurrentAccess?: ConcurrentAccessRestriction; - downloadAccess?: DownloadAccessRestriction; - - /** Resource type. */ - kind?: string | null; - } - - export interface Series { - - /** Resource type. */ - kind?: string | null; - SeriesSeries?: Array; - } - - export interface SeriesSeries { - bannerImageUrl?: string | null; - eligibleForSubscription?: boolean | null; - imageUrl?: string | null; - isComplete?: boolean | null; - seriesFormatType?: string | null; - seriesId?: string | null; - seriesSubscriptionReleaseInfo?: SeriesSeriesSeriesSubscriptionReleaseInfo; - seriesType?: string | null; - subscriptionId?: string | null; - title?: string | null; - } - - export interface SeriesSeriesSeriesSubscriptionReleaseInfo { - - /** Cancellation date of the series subscription (or when it ends). */ - cancellationTimestampUs?: string | null; - currentReleaseInfo?: BooksSubscriptionReleaseInfo; - nextReleaseInfo?: BooksSubscriptionReleaseInfo; - - /** series subscription type. */ - seriesSubscriptionType?: string | null; - } - - export interface Seriesmembership { - - /** Resorce type. */ - kind?: string | null; - member?: Array; - nextPageToken?: string | null; - } - - export interface Usersettings { - - /** Resource type. */ - kind?: string | null; - - /** User settings in sub-objects, each for different purposes. */ - notesExport?: UsersettingsNotesExport; - notification?: UsersettingsNotification; - } - - export interface UsersettingsNotesExport { - folderName?: string | null; - isEnabled?: boolean | null; - } - - export interface UsersettingsNotification { - matchMyInterests?: UsersettingsNotificationMatchMyInterests; - moreFromAuthors?: UsersettingsNotificationMoreFromAuthors; - moreFromSeries?: UsersettingsNotificationMoreFromSeries; - priceDrop?: UsersettingsNotificationPriceDrop; - rewardExpirations?: UsersettingsNotificationRewardExpirations; - } - - export interface UsersettingsNotificationMatchMyInterests { - opted_state?: string | null; - } - - export interface UsersettingsNotificationMoreFromAuthors { - opted_state?: string | null; - } - - export interface UsersettingsNotificationMoreFromSeries { - opted_state?: string | null; - } - - export interface UsersettingsNotificationPriceDrop { - opted_state?: string | null; - } - - export interface UsersettingsNotificationRewardExpirations { - opted_state?: string | null; - } - - export interface Volume2 { - - /** A list of volumes. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - nextPageToken?: string | null; - } - - export interface Volumeannotation { - - /** The annotation data id for this volume annotation. */ - annotationDataId?: string | null; - - /** Link to get data for this annotation. */ - annotationDataLink?: string | null; - - /** The type of annotation this is. */ - annotationType?: string | null; - - /** The content ranges to identify the selected text. */ - contentRanges?: VolumeannotationContentRanges; - - /** Data for this annotation. */ - data?: string | null; - - /** Indicates that this annotation is deleted. */ - deleted?: boolean | null; - - /** Unique id of this volume annotation. */ - id?: string | null; - - /** Resource Type */ - kind?: string | null; - - /** The Layer this annotation is for. */ - layerId?: string | null; - - /** Pages the annotation spans. */ - pageIds?: Array; - - /** Excerpt from the volume. */ - selectedText?: string | null; - - /** URL to this resource. */ - selfLink?: string | null; - - /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ - updated?: Date | null; - - /** The Volume this annotation is for. */ - volumeId?: string | null; - } - - export interface VolumeannotationContentRanges { - cfiRange?: BooksAnnotationsRange; - - /** Content version applicable to ranges below. */ - contentVersion?: string | null; - gbImageRange?: BooksAnnotationsRange; - gbTextRange?: BooksAnnotationsRange; - } - - export interface Volumeannotations { - - /** A list of volume annotations. */ - items?: Array; - - /** Resource type */ - kind?: string | null; - - /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ - nextPageToken?: string | null; - - /** - * The total number of volume annotations found. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - - /** The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the annotation data, just the information in this response (e.g. the location of annotations in the book). */ - version?: string | null; - } - - export interface Volumes { - - /** A list of volumes. */ - items?: Array; - - /** Resource type. */ - kind?: string | null; - - /** - * Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - totalItems?: number | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Post cloudloading/addBook - * @param {string} drive_document_id A drive document id. The upload_client_token must not be set. - * @param {string} mime_type The document MIME type. It can be set only if the drive_document_id is set. - * @param {string} name The document name. It can be set only if the drive_document_id is set. - * @return {void} Successful response - */ - Books_cloudloading_addBook(drive_document_id: string | null | undefined, mime_type: string | null | undefined, name: string | null | undefined, upload_client_token: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'cloudloading/addBook?drive_document_id=' + (drive_document_id == null ? '' : encodeURIComponent(drive_document_id)) + '&mime_type=' + (mime_type == null ? '' : encodeURIComponent(mime_type)) + '&name=' + (name == null ? '' : encodeURIComponent(name)) + '&upload_client_token=' + (upload_client_token == null ? '' : encodeURIComponent(upload_client_token)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Remove the book and its contents - * Post cloudloading/deleteBook - * @param {string} volumeId The id of the book to be removed. - * @return {void} Successful response - */ - Books_cloudloading_deleteBook(volumeId: string): Observable> { - return this.http.post(this.baseUri + 'cloudloading/deleteBook?volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Post cloudloading/updateBook - * @return {void} Successful response - */ - Books_cloudloading_updateBook(requestBody: BooksCloudloadingResource): Observable> { - return this.http.post(this.baseUri + 'cloudloading/updateBook', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Returns a list of offline dictionary metadata available - * Get dictionary/listOfflineMetadata - * @param {string} cpksver The device/version ID from which to request the data. - * @return {void} Successful response - */ - Books_dictionary_listOfflineMetadata(cpksver: string): Observable> { - return this.http.get(this.baseUri + 'dictionary/listOfflineMetadata?cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets information regarding the family that the user is part of. - * Get familysharing/getFamilyInfo - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_familysharing_getFamilyInfo(source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'familysharing/getFamilyInfo?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Initiates sharing of the content with the user's family. Empty response indicates success. - * Post familysharing/share - * @param {string} docId The docid to share. - * @param {string} source String to identify the originator of this request. - * @param {string} volumeId The volume to share. - * @return {void} Successful response - */ - Books_familysharing_share(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'familysharing/share?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Initiates revoking content that has already been shared with the user's family. Empty response indicates success. - * Post familysharing/unshare - * @param {string} docId The docid to unshare. - * @param {string} source String to identify the originator of this request. - * @param {string} volumeId The volume to unshare. - * @return {void} Successful response - */ - Books_familysharing_unshare(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'familysharing/unshare?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the current settings for the user. - * Get myconfig/getUserSettings - * @return {void} Successful response - */ - Books_myconfig_getUserSettings(): Observable> { - return this.http.get(this.baseUri + 'myconfig/getUserSettings', { observe: 'response', responseType: 'text' }); - } - - /** - * Release downloaded content access restriction. - * Post myconfig/releaseDownloadAccess - * @param {Array} volumeIds The volume(s) to release restrictions for. - * @param {string} cpksver The device/version ID from which to release the restriction. - * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_myconfig_releaseDownloadAccess(volumeIds: Array, cpksver: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'myconfig/releaseDownloadAccess?' + volumeIds.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&') + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Request concurrent and download access restrictions. - * Post myconfig/requestAccess - * @param {string} source String to identify the originator of this request. - * @param {string} volumeId The volume to request concurrent/download restrictions for. - * @param {string} nonce The client nonce value. - * @param {string} cpksver The device/version ID from which to request the restrictions. - * @param {Books_myconfig_requestAccessLicenseTypes} licenseTypes The type of access license to request. If not specified, the default is BOTH. - * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @return {void} Successful response - */ - Books_myconfig_requestAccess(source: string, volumeId: string, nonce: string, cpksver: string, licenseTypes: Books_myconfig_requestAccessLicenseTypes | null | undefined, locale: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'myconfig/requestAccess?source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&licenseTypes=' + licenseTypes + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Request downloaded content access for specified volumes on the My eBooks shelf. - * Post myconfig/syncVolumeLicenses - * @param {string} source String to identify the originator of this request. - * @param {string} nonce The client nonce value. - * @param {string} cpksver The device/version ID from which to release the restriction. - * @param {Array} features List of features supported by the client, i.e., 'RENTALS' - * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. - * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {Array} volumeIds The volume(s) to request download restrictions for. - * @return {void} Successful response - */ - Books_myconfig_syncVolumeLicenses(source: string, nonce: string, cpksver: string, features: Array | null | undefined, includeNonComicsSeries: boolean | null | undefined, locale: string | null | undefined, showPreorders: boolean | null | undefined, volumeIds: Array | null | undefined): Observable> { - return this.http.post(this.baseUri + 'myconfig/syncVolumeLicenses?source=' + (source == null ? '' : encodeURIComponent(source)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&' + features?.map(z => `features=${encodeURIComponent(z)}`).join('&') + '&includeNonComicsSeries=' + includeNonComicsSeries + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&showPreorders=' + showPreorders + '&' + volumeIds?.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&'), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value. - * Post myconfig/updateUserSettings - * @return {void} Successful response - */ - Books_myconfig_updateUserSettings(requestBody: Usersettings): Observable> { - return this.http.post(this.baseUri + 'myconfig/updateUserSettings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves a list of annotations, possibly filtered. - * Get mylibrary/annotations - * @param {string} contentVersion The content version for the requested volume. - * @param {string} layerId The layer ID to limit annotation by. - * @param {Array} layerIds The layer ID(s) to limit annotation by. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 40 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {string} volumeId The volume to restrict annotations to. - * @return {void} Successful response - */ - Books_mylibrary_annotations_list(contentVersion: string | null | undefined, layerId: string | null | undefined, layerIds: Array | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/annotations?contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&layerId=' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&' + layerIds?.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Inserts a new annotation. - * Post mylibrary/annotations - * @param {string} annotationId The ID for the annotation to insert. - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {boolean} showOnlySummaryInResponse Requests that only the summary of the specified layer be provided in the response. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_annotations_insert(annotationId: string | null | undefined, country: string | null | undefined, showOnlySummaryInResponse: boolean | null | undefined, source: string | null | undefined, requestBody: Annotation): Observable> { - return this.http.post(this.baseUri + 'mylibrary/annotations?annotationId=' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&showOnlySummaryInResponse=' + showOnlySummaryInResponse + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Gets the summary of specified layers. - * Post mylibrary/annotations/summary - * @param {Array} layerIds Array of layer IDs to get the summary for. - * @param {string} volumeId Volume id to get the summary for. - * @return {void} Successful response - */ - Books_mylibrary_annotations_summary(layerIds: Array, volumeId: string): Observable> { - return this.http.post(this.baseUri + 'mylibrary/annotations/summary?' + layerIds.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Deletes an annotation. - * Delete mylibrary/annotations/{annotationId} - * @param {string} annotationId The ID for the annotation to delete. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_annotations_delete(annotationId: string, source: string | null | undefined): Observable> { - return this.http.delete(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Updates an existing annotation. - * Put mylibrary/annotations/{annotationId} - * @param {string} annotationId The ID for the annotation to update. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_annotations_update(annotationId: string, source: string | null | undefined, requestBody: Annotation): Observable> { - return this.http.put(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves a list of bookshelves belonging to the authenticated user. - * Get mylibrary/bookshelves - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_list(source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/bookshelves?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves metadata for a specific bookshelf belonging to the authenticated user. - * Get mylibrary/bookshelves/{shelf} - * @param {string} shelf ID of bookshelf to retrieve. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_get(shelf: string, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Adds a volume to a bookshelf. - * Post mylibrary/bookshelves/{shelf}/addVolume - * @param {string} shelf ID of bookshelf to which to add a volume. - * @param {string} volumeId ID of volume to add. - * @param {Books_mylibrary_bookshelves_addVolumeReason} reason The reason for which the book is added to the library. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_addVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_addVolumeReason | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/addVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Clears all volumes from a bookshelf. - * Post mylibrary/bookshelves/{shelf}/clearVolumes - * @param {string} shelf ID of bookshelf from which to remove a volume. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_clearVolumes(shelf: string, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/clearVolumes&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Moves a volume within a bookshelf. - * Post mylibrary/bookshelves/{shelf}/moveVolume - * @param {string} shelf ID of bookshelf with the volume. - * @param {string} volumeId ID of volume to move. - * @param {number} volumePosition Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_moveVolume(shelf: string, volumeId: string, volumePosition: number, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/moveVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&volumePosition=' + volumePosition + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Removes a volume from a bookshelf. - * Post mylibrary/bookshelves/{shelf}/removeVolume - * @param {string} shelf ID of bookshelf from which to remove a volume. - * @param {string} volumeId ID of volume to remove. - * @param {Books_mylibrary_bookshelves_removeVolumeReason} reason The reason for which the book is removed from the library. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_removeVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_removeVolumeReason | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/removeVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Gets volume information for volumes on a bookshelf. - * Get mylibrary/bookshelves/{shelf}/volumes - * @param {string} shelf The bookshelf ID or name retrieve volumes for. - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 - * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. - * @param {string} q Full-text search query string in this bookshelf. - * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first element to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_mylibrary_bookshelves_volumes_list(shelf: string, country: string | null | undefined, maxResults: number | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, q: string | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&country=' + (country == null ? '' : encodeURIComponent(country)) + '&maxResults=' + maxResults + '&projection=' + projection + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves my reading position information for a volume. - * Get mylibrary/readingpositions/{volumeId} - * @param {string} volumeId ID of volume for which to retrieve a reading position. - * @param {string} contentVersion Volume content version for which this reading position is requested. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_readingpositions_get(volumeId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Sets my reading position information for a volume. - * Post mylibrary/readingpositions/{volumeId}/setPosition - * @param {string} volumeId ID of volume for which to update the reading position. - * @param {string} timestamp RFC 3339 UTC format timestamp associated with this reading position. - * @param {string} position Position string for the new volume reading position. - * @param {Books_mylibrary_readingpositions_setPositionAction} action Action that caused this reading position to be set. - * @param {string} contentVersion Volume content version for which this reading position applies. - * @param {string} deviceCookie Random persistent device cookie optional on set position. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_mylibrary_readingpositions_setPosition(volumeId: string, timestamp: string, position: string, action: Books_mylibrary_readingpositions_setPositionAction | null | undefined, contentVersion: string | null | undefined, deviceCookie: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/setPosition×tamp=' + (timestamp == null ? '' : encodeURIComponent(timestamp)) + '&position=' + (position == null ? '' : encodeURIComponent(position)) + '&action=' + action + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&deviceCookie=' + (deviceCookie == null ? '' : encodeURIComponent(deviceCookie)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Returns notification details for a given notification id. - * Get notification/get - * @param {string} notification_id String to identify the notification. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_notification_get(notification_id: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'notification/get?notification_id=' + (notification_id == null ? '' : encodeURIComponent(notification_id)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * List categories for onboarding experience. - * Get onboarding/listCategories - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. - * @return {void} Successful response - */ - Books_onboarding_listCategories(locale: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'onboarding/listCategories?locale=' + (locale == null ? '' : encodeURIComponent(locale)), { observe: 'response', responseType: 'text' }); - } - - /** - * List available volumes under categories for onboarding experience. - * Get onboarding/listCategoryVolumes - * @param {Array} categoryId List of category ids requested. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. - * @param {number} pageSize Number of maximum results per page to be included in the response. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} pageToken The value of the nextToken from the previous page. - * @return {void} Successful response - */ - Books_onboarding_listCategoryVolumes(categoryId: Array | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, pageSize: number | null | undefined, pageToken: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'onboarding/listCategoryVolumes?' + categoryId?.map(z => `categoryId=${encodeURIComponent(z)}`).join('&') + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&pageSize=' + pageSize + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)), { observe: 'response', responseType: 'text' }); - } - - /** - * Returns a stream of personalized book clusters - * Get personalizedstream/get - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_personalizedstream_get(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'personalizedstream/get?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Post promooffer/accept - * @param {string} androidId device android_id - * @param {string} device device device - * @param {string} manufacturer device manufacturer - * @param {string} model device model - * @param {string} product device product - * @param {string} serial device serial - * @param {string} volumeId Volume id to exercise the offer - * @return {void} Successful response - */ - Books_promooffer_accept(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined, volumeId: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'promooffer/accept?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Post promooffer/dismiss - * @param {string} androidId device android_id - * @param {string} device device device - * @param {string} manufacturer device manufacturer - * @param {string} model device model - * @param {string} offerId Offer to dimiss - * @param {string} product device product - * @param {string} serial device serial - * @return {void} Successful response - */ - Books_promooffer_dismiss(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'promooffer/dismiss?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Returns a list of promo offers available to the user - * Get promooffer/get - * @param {string} androidId device android_id - * @param {string} device device device - * @param {string} manufacturer device manufacturer - * @param {string} model device model - * @param {string} product device product - * @param {string} serial device serial - * @return {void} Successful response - */ - Books_promooffer_get(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'promooffer/get?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), { observe: 'response', responseType: 'text' }); - } - - /** - * Returns Series metadata for the given series ids. - * Get series/get - * @param {Array} series_id String that identifies the series - * @return {void} Successful response - */ - Books_series_get(series_id: Array): Observable> { - return this.http.get(this.baseUri + 'series/get?' + series_id.map(z => `series_id=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); - } - - /** - * Returns Series membership data given the series id. - * Get series/membership/get - * @param {string} series_id String that identifies the series - * @param {number} page_size Number of maximum results per page to be included in the response. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} page_token The value of the nextToken from the previous page. - * @return {void} Successful response - */ - Books_series_membership_get(series_id: string, page_size: number | null | undefined, page_token: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'series/membership/get?series_id=' + (series_id == null ? '' : encodeURIComponent(series_id)) + '&page_size=' + page_size + '&page_token=' + (page_token == null ? '' : encodeURIComponent(page_token)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves a list of public bookshelves for the specified user. - * Get users/{userId}/bookshelves - * @param {string} userId ID of user for whom to retrieve bookshelves. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_bookshelves_list(userId: string, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves metadata for a specific bookshelf for the specified user. - * Get users/{userId}/bookshelves/{shelf} - * @param {string} userId ID of user for whom to retrieve bookshelves. - * @param {string} shelf ID of bookshelf to retrieve. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_bookshelves_get(userId: string, shelf: string, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieves volumes in a specific bookshelf for the specified user. - * Get users/{userId}/bookshelves/{shelf}/volumes - * @param {string} userId ID of user for whom to retrieve bookshelf volumes. - * @param {string} shelf ID of bookshelf to retrieve volumes. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 - * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first element to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_bookshelves_volumes_list(userId: string, shelf: string, maxResults: number | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&maxResults=' + maxResults + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Performs a book search. - * Get volumes - * @param {string} q Full-text search query string. - * @param {Books_volumes_listDownload} download Restrict to volumes by download availability. - * @param {Books_volumes_listFilter} filter Filter search results. - * @param {string} langRestrict Restrict results to books with this language code. - * @param {Books_volumes_listLibraryRestrict} libraryRestrict Restrict search to this user's library. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {number} maxResults Maximum number of results to return. - * Minimum: 0 Maximum: 40 - * @param {Books_volumes_listOrderBy} orderBy Sort search results. - * @param {string} partner Restrict and brand results for partner ID. - * @param {Books_volumes_listPrintType} printType Restrict to books or magazines. - * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. - * @param {boolean} showPreorders Set to true to show books available for preorder. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first result to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_volumes_list(q: string, download: Books_volumes_listDownload | null | undefined, filter: Books_volumes_listFilter | null | undefined, langRestrict: string | null | undefined, libraryRestrict: Books_volumes_listLibraryRestrict | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, maxResults: number | null | undefined, orderBy: Books_volumes_listOrderBy | null | undefined, partner: string | null | undefined, printType: Books_volumes_listPrintType | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes?q=' + (q == null ? '' : encodeURIComponent(q)) + '&download=' + download + '&filter=' + filter + '&langRestrict=' + (langRestrict == null ? '' : encodeURIComponent(langRestrict)) + '&libraryRestrict=' + libraryRestrict + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&maxResults=' + maxResults + '&orderBy=' + orderBy + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&printType=' + printType + '&projection=' + projection + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of books in My Library. - * Get volumes/mybooks - * @param {Array} acquireMethod How the book was acquired - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. - * @param {number} maxResults Maximum number of results to return. - * Minimum: 0 Maximum: 100 - * @param {Array} processingState The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first result to return (starts at 0) - * Minimum: 0 - * @return {void} Successful response - */ - Books_volumes_mybooks_list(acquireMethod: Array | null | undefined, country: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/mybooks?' + acquireMethod?.map(z => `acquireMethod=${encodeURIComponent(z)}`).join('&') + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of recommended books for the current user. - * Get volumes/recommended - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_recommended_list(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/recommended?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Rate a recommended book for the current user. - * Post volumes/recommended/rate - * @param {Books_volumes_recommended_rateRating} rating Rating to be given to the volume. - * @param {string} volumeId ID of the source volume. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_recommended_rate(rating: Books_volumes_recommended_rateRating, volumeId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.post(this.baseUri + 'volumes/recommended/rate?rating=' + rating + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of books uploaded by the current user. - * Get volumes/useruploaded - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {number} maxResults Maximum number of results to return. - * Minimum: 0 Maximum: 40 - * @param {Array} processingState The processing state of the user uploaded volumes to be returned. - * @param {string} source String to identify the originator of this request. - * @param {number} startIndex Index of the first result to return (starts at 0) - * Minimum: 0 - * @param {Array} volumeId The ids of the volumes to be returned. If not specified all that match the processingState are returned. - * @return {void} Successful response - */ - Books_volumes_useruploaded_list(locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined, volumeId: Array | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/useruploaded?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex + '&' + volumeId?.map(z => `volumeId=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets volume information for a single volume. - * Get volumes/{volumeId} - * @param {string} volumeId ID of volume to retrieve. - * @param {string} country ISO-3166-1 code to override the IP-based location. - * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. - * @param {string} partner Brand results for partner ID. - * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_get(volumeId: string, country: string | null | undefined, includeNonComicsSeries: boolean | null | undefined, partner: string | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, source: string | null | undefined, user_library_consistent_read: boolean | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&includeNonComicsSeries=' + includeNonComicsSeries + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&projection=' + projection + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&user_library_consistent_read=' + user_library_consistent_read, { observe: 'response', responseType: 'text' }); - } - - /** - * Return a list of associated books. - * Get volumes/{volumeId}/associated - * @param {string} volumeId ID of the source volume. - * @param {Books_volumes_associated_listAssociation} association Association type. - * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_volumes_associated_list(volumeId: string, association: Books_volumes_associated_listAssociation | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/associated&association=' + association + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the volume annotations for a volume and layer. - * Get volumes/{volumeId}/layers/{layerId} - * @param {string} volumeId The volume to retrieve annotations for. - * @param {string} layerId The ID for the layer to get the annotations. - * @param {string} contentVersion The content version for the requested volume. - * @param {string} endOffset The end offset to end retrieving data from. - * @param {string} endPosition The end position to end retrieving data from. - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 200 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. - * @param {string} source String to identify the originator of this request. - * @param {string} startOffset The start offset to start retrieving data from. - * @param {string} startPosition The start position to start retrieving data from. - * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {string} volumeAnnotationsVersion The version of the volume annotations that you are requesting. - * @return {void} Successful response - */ - Books_layers_volumeAnnotations_list(volumeId: string, layerId: string, contentVersion: string, endOffset: string | null | undefined, endPosition: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, startOffset: string | null | undefined, startPosition: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeAnnotationsVersion: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&endOffset=' + (endOffset == null ? '' : encodeURIComponent(endOffset)) + '&endPosition=' + (endPosition == null ? '' : encodeURIComponent(endPosition)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startOffset=' + (startOffset == null ? '' : encodeURIComponent(startOffset)) + '&startPosition=' + (startPosition == null ? '' : encodeURIComponent(startPosition)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeAnnotationsVersion=' + (volumeAnnotationsVersion == null ? '' : encodeURIComponent(volumeAnnotationsVersion)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the volume annotation. - * Get volumes/{volumeId}/layers/{layerId}/annotations/{annotationId} - * @param {string} volumeId The volume to retrieve annotations for. - * @param {string} layerId The ID for the layer to get the annotations. - * @param {string} annotationId The ID of the volume annotation to retrieve. - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_layers_volumeAnnotations_get(volumeId: string, layerId: string, annotationId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the annotation data for a volume and layer. - * Get volumes/{volumeId}/layers/{layerId}/data - * @param {string} volumeId The volume to retrieve annotation data for. - * @param {string} layerId The ID for the layer to get the annotation data. - * @param {string} contentVersion The content version for the requested volume. - * @param {Array} annotationDataId The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. - * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 200 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {number} scale The requested scale for the image. - * Minimum: 0 - * @param {string} source String to identify the originator of this request. - * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Successful response - */ - Books_layers_annotationData_list(volumeId: string, layerId: string, contentVersion: string, annotationDataId: Array | null | undefined, h: number | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, w: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&' + annotationDataId?.map(z => `annotationDataId=${encodeURIComponent(z)}`).join('&') + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&w=' + w, { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the annotation data. - * Get volumes/{volumeId}/layers/{layerId}/data/{annotationDataId} - * @param {string} volumeId The volume to retrieve annotations for. - * @param {string} layerId The ID for the layer to get the annotations. - * @param {string} annotationDataId The ID of the annotation data to retrieve. - * @param {string} contentVersion The content version for the volume you are trying to retrieve. - * @param {boolean} allowWebDefinitions For the dictionary layer. Whether or not to allow web definitions. - * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {number} scale The requested scale for the image. - * Minimum: 0 - * @param {string} source String to identify the originator of this request. - * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} Successful response - */ - Books_layers_annotationData_get(volumeId: string, layerId: string, annotationDataId: string, contentVersion: string, allowWebDefinitions: boolean | null | undefined, h: number | null | undefined, locale: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, w: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data/' + (annotationDataId == null ? '' : encodeURIComponent(annotationDataId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&allowWebDefinitions=' + allowWebDefinitions + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&w=' + w, { observe: 'response', responseType: 'text' }); - } - - /** - * List the layer summaries for a volume. - * Get volumes/{volumeId}/layersummary - * @param {string} volumeId The volume to retrieve layers for. - * @param {string} contentVersion The content version for the requested volume. - * @param {number} maxResults Maximum number of results to return - * Minimum: 0 Maximum: 200 - * @param {string} pageToken The value of the nextToken from the previous page. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_layers_list(volumeId: string, contentVersion: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - - /** - * Gets the layer summary for a volume. - * Get volumes/{volumeId}/layersummary/{summaryId} - * @param {string} volumeId The volume to retrieve layers for. - * @param {string} summaryId The ID for the layer to get the summary for. - * @param {string} contentVersion The content version for the requested volume. - * @param {string} source String to identify the originator of this request. - * @return {void} Successful response - */ - Books_layers_get(volumeId: string, summaryId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary/' + (summaryId == null ? '' : encodeURIComponent(summaryId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); - } - } - - export enum Books_myconfig_requestAccessLicenseTypes { BOTH = 0, CONCURRENT = 1, DOWNLOAD = 2 } - - export enum Books_mylibrary_bookshelves_addVolumeReason { IOS_PREX = 0, IOS_SEARCH = 1, ONBOARDING = 2 } - - export enum Books_mylibrary_bookshelves_removeVolumeReason { ONBOARDING = 0 } - - export enum Books_mylibrary_bookshelves_volumes_listProjection { full = 0, lite = 1 } - - export enum Books_mylibrary_readingpositions_setPositionAction { bookmark = 0, chapter = 1, 'next-page' = 2, 'prev-page' = 3, scroll = 4, search = 5 } - - export enum Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating { mature = 0, 'not-mature' = 1 } - - export enum Books_volumes_listDownload { epub = 0 } - - export enum Books_volumes_listFilter { ebooks = 0, 'free-ebooks' = 1, full = 2, 'paid-ebooks' = 3, partial = 4 } - - export enum Books_volumes_listLibraryRestrict { 'my-library' = 0, 'no-restrict' = 1 } - - export enum Books_volumes_listOrderBy { newest = 0, relevance = 1 } - - export enum Books_volumes_listPrintType { all = 0, books = 1, magazines = 2 } - - export enum Books_volumes_recommended_rateRating { HAVE_IT = 0, NOT_INTERESTED = 1 } - - export enum Books_volumes_associated_listAssociation { 'end-of-sample' = 0, 'end-of-volume' = 1, 'related-for-play' = 2 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Annotation { + + /** Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + afterSelectedText?: string | null; + + /** Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty. */ + beforeSelectedText?: string | null; + + /** Selection ranges sent from the client. */ + clientVersionRanges?: AnnotationClientVersionRanges; + + /** Timestamp for the created time of this annotation. */ + created?: Date | null; + + /** Selection ranges for the most recent content version. */ + currentVersionRanges?: AnnotationCurrentVersionRanges; + + /** User-created data for this annotation. */ + data?: string | null; + + /** Indicates that this annotation is deleted. */ + deleted?: boolean | null; + + /** The highlight style for this annotation. */ + highlightStyle?: string | null; + + /** Id of this annotation, in the form of a GUID. */ + id?: string | null; + + /** Resource type. */ + kind?: string | null; + + /** The layer this annotation is for. */ + layerId?: string | null; + layerSummary?: AnnotationLayerSummary; + + /** Pages that this annotation spans. */ + pageIds?: Array; + + /** Excerpt from the volume. */ + selectedText?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Timestamp for the last time this annotation was modified. */ + updated?: Date | null; + + /** The volume that this annotation belongs to. */ + volumeId?: string | null; + } + + export interface AnnotationClientVersionRanges { + cfiRange?: BooksAnnotationsRange; + + /** Content version the client sent in. */ + contentVersion?: string | null; + gbImageRange?: BooksAnnotationsRange; + gbTextRange?: BooksAnnotationsRange; + imageCfiRange?: BooksAnnotationsRange; + } + + export interface BooksAnnotationsRange { + + /** The offset from the ending position. */ + endOffset?: string | null; + + /** The ending position for the range. */ + endPosition?: string | null; + + /** The offset from the starting position. */ + startOffset?: string | null; + + /** The starting position for the range. */ + startPosition?: string | null; + } + + export interface AnnotationCurrentVersionRanges { + cfiRange?: BooksAnnotationsRange; + + /** Content version applicable to ranges below. */ + contentVersion?: string | null; + gbImageRange?: BooksAnnotationsRange; + gbTextRange?: BooksAnnotationsRange; + imageCfiRange?: BooksAnnotationsRange; + } + + export interface AnnotationLayerSummary { + + /** + * Maximum allowed characters on this layer, especially for the "copy" layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + allowedCharacterCount?: number | null; + + /** Type of limitation on this layer. "limited" or "unlimited" for the "copy" layer. */ + limitType?: string | null; + + /** + * Remaining allowed characters on this layer, especially for the "copy" layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + remainingCharacterCount?: number | null; + } + + export interface Annotationdata { + + /** The type of annotation this data is for. */ + annotationType?: string | null; + data?: any; + + /** Base64 encoded data for this annotation data. */ + encoded_data?: string | null; + + /** Unique id for this annotation data. */ + id?: string | null; + + /** Resource Type */ + kind?: string | null; + + /** The Layer id for this data. * */ + layerId?: string | null; + + /** URL for this resource. * */ + selfLink?: string | null; + + /** Timestamp for the last time this data was updated. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + + /** The volume id for this data. * */ + volumeId?: string | null; + } + + export interface Annotations { + + /** A list of annotations. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string | null; + + /** + * Total number of annotations found. This may be greater than the number of notes returned in this response if results have been paginated. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + + export interface AnnotationsSummary { + kind?: string | null; + AnnotationsSummaryLayers?: Array; + } + + export interface AnnotationsSummaryLayers { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + allowedCharacterCount?: number | null; + layerId?: string | null; + limitType?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + remainingCharacterCount?: number | null; + updated?: Date | null; + } + + export interface Annotationsdata { + + /** A list of Annotation Data. */ + items?: Array; + + /** Resource type */ + kind?: string | null; + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string | null; + + /** + * The total number of volume annotations found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + + export interface BooksCloudloadingResource { + author?: string | null; + processingState?: string | null; + title?: string | null; + volumeId?: string | null; + } + + export interface BooksSubscriptionReleaseInfo { + + /** Amount in micros of the specified currency code. */ + amountInMicros?: string | null; + + /** Currency code of the amount. */ + currencyCode?: string | null; + + /** The release number of this issue/volume/book. */ + releaseNumber?: string | null; + + /** The release date. */ + releaseTimestampUs?: string | null; + } + + export interface BooksVolumesRecommendedRateResponse { + consistency_token?: string | null; + } + + export interface Bookshelf { + + /** Whether this bookshelf is PUBLIC or PRIVATE. */ + access?: string | null; + + /** Created time for this bookshelf (formatted UTC timestamp with millisecond resolution). */ + created?: Date | null; + + /** Description of this bookshelf. */ + description?: string | null; + + /** + * Id of this bookshelf, only unique by user. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + id?: number | null; + + /** Resource type for bookshelf metadata. */ + kind?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Title of this bookshelf. */ + title?: string | null; + + /** Last modified time of this bookshelf (formatted UTC timestamp with millisecond resolution). */ + updated?: Date | null; + + /** + * Number of volumes in this bookshelf. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + volumeCount?: number | null; + + /** Last time a volume was added or removed from this bookshelf (formatted UTC timestamp with millisecond resolution). */ + volumesLastUpdated?: Date | null; + } + + export interface Bookshelves { + + /** A list of bookshelves. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + } + + export interface Category { + + /** A list of onboarding categories. */ + CategoryItems?: Array; + + /** Resource type. */ + kind?: string | null; + } + + export interface CategoryItems { + badgeUrl?: string | null; + categoryId?: string | null; + name?: string | null; + } + + export interface ConcurrentAccessRestriction { + + /** Whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean | null; + + /** Resource type. */ + kind?: string | null; + + /** + * The maximum number of concurrent access licenses for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxConcurrentDevices?: number | null; + + /** Error/warning message. */ + message?: string | null; + + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string | null; + + /** Error/warning reason code. */ + reasonCode?: string | null; + + /** Whether this volume has any concurrent access restrictions. */ + restricted?: boolean | null; + + /** Response signature. */ + signature?: string | null; + + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string | null; + + /** + * Time in seconds for license auto-expiration. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + timeWindowSeconds?: number | null; + + /** Identifies the volume for which this entry applies. */ + volumeId?: string | null; + } + + export interface Dictlayerdata { + common?: DictlayerdataCommon; + dict?: DictlayerdataDict; + kind?: string | null; + } + + export interface DictlayerdataCommon { + + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string | null; + } + + export interface DictlayerdataDict { + + /** The source, url and attribution for this dictionary data. */ + source?: DictlayerdataDictSource; + DictlayerdataDictWords?: Array; + } + + export interface DictlayerdataDictSource { + attribution?: string | null; + url?: string | null; + } + + export interface DictlayerdataDictWords { + DictlayerdataDictWordsDerivatives?: Array; + DictlayerdataDictWordsExamples?: Array; + DictlayerdataDictWordsSenses?: Array; + + /** The words with different meanings but not related words, e.g. "go" (game) and "go" (verb). */ + source?: DictlayerdataDictWordsSource; + } + + export interface DictlayerdataDictWordsDerivatives { + source?: DictlayerdataDictWordsDerivativesSource; + text?: string | null; + } + + export interface DictlayerdataDictWordsDerivativesSource { + attribution?: string | null; + url?: string | null; + } + + export interface DictlayerdataDictWordsExamples { + source?: DictlayerdataDictWordsExamplesSource; + text?: string | null; + } + + export interface DictlayerdataDictWordsExamplesSource { + attribution?: string | null; + url?: string | null; + } + + export interface DictlayerdataDictWordsSenses { + DictlayerdataDictWordsSensesConjugations?: Array; + DictlayerdataDictWordsSensesDefinitions?: Array; + partOfSpeech?: string | null; + pronunciation?: string | null; + pronunciationUrl?: string | null; + source?: DictlayerdataDictWordsSensesSource; + syllabification?: string | null; + DictlayerdataDictWordsSensesSynonyms?: Array; + } + + export interface DictlayerdataDictWordsSensesConjugations { + type?: string | null; + value?: string | null; + } + + export interface DictlayerdataDictWordsSensesDefinitions { + definition?: string | null; + DictlayerdataDictWordsSensesDefinitionsExamples?: Array; + } + + export interface DictlayerdataDictWordsSensesDefinitionsExamples { + source?: DictlayerdataDictWordsSensesDefinitionsExamplesSource; + text?: string | null; + } + + export interface DictlayerdataDictWordsSensesDefinitionsExamplesSource { + attribution?: string | null; + url?: string | null; + } + + export interface DictlayerdataDictWordsSensesSource { + attribution?: string | null; + url?: string | null; + } + + export interface DictlayerdataDictWordsSensesSynonyms { + source?: DictlayerdataDictWordsSensesSynonymsSource; + text?: string | null; + } + + export interface DictlayerdataDictWordsSensesSynonymsSource { + attribution?: string | null; + url?: string | null; + } + + export interface DictlayerdataDictWordsSource { + attribution?: string | null; + url?: string | null; + } + + export interface Discoveryclusters { + DiscoveryclustersClusters?: Array; + + /** Resorce type. */ + kind?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + totalClusters?: number | null; + } + + export interface DiscoveryclustersClusters { + banner_with_content_container?: DiscoveryclustersClustersBanner_with_content_container; + subTitle?: string | null; + title?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + totalVolumes?: number | null; + uid?: string | null; + volumes?: Array; + } + + export interface DiscoveryclustersClustersBanner_with_content_container { + fillColorArgb?: string | null; + imageUrl?: string | null; + maskColorArgb?: string | null; + moreButtonText?: string | null; + moreButtonUrl?: string | null; + textColorArgb?: string | null; + } + + export interface Volume { + + /** Any information about a volume related to reading or obtaining that volume text. This information can depend on country (books may be public domain in one country but not in another, e.g.). */ + accessInfo?: VolumeAccessInfo; + + /** Opaque identifier for a specific version of a volume resource. (In LITE projection) */ + etag?: string | null; + + /** Unique identifier for a volume. (In LITE projection.) */ + id?: string | null; + + /** Resource type for a volume. (In LITE projection.) */ + kind?: string | null; + + /** What layers exist in this volume and high level information about them. */ + layerInfo?: VolumeLayerInfo; + + /** Recommendation related information for this volume. */ + recommendedInfo?: VolumeRecommendedInfo; + + /** Any information about a volume related to the eBookstore and/or purchaseability. This information can depend on the country where the request originates from (i.e. books may not be for sale in certain countries). */ + saleInfo?: VolumeSaleInfo; + + /** Search result information related to this volume. */ + searchInfo?: VolumeSearchInfo; + + /** URL to this resource. (In LITE projection.) */ + selfLink?: string | null; + + /** User specific information related to this volume. (e.g. page this user last read or whether they purchased this book) */ + userInfo?: VolumeUserInfo; + + /** General volume information. */ + volumeInfo?: VolumeVolumeInfo; + } + + export interface VolumeAccessInfo { + + /** Combines the access and viewability of this volume into a single status field for this user. Values can be FULL_PURCHASED, FULL_PUBLIC_DOMAIN, SAMPLE or NONE. (In LITE projection.) */ + accessViewStatus?: string | null; + + /** The two-letter ISO_3166-1 country code for which this access information is valid. (In LITE projection.) */ + country?: string | null; + downloadAccess?: DownloadAccessRestriction; + + /** URL to the Google Drive viewer if this volume is uploaded by the user by selecting the file from Google Drive. */ + driveImportedContentLink?: string | null; + + /** Whether this volume can be embedded in a viewport using the Embedded Viewer API. */ + embeddable?: boolean | null; + + /** Information about epub content. (In LITE projection.) */ + epub?: VolumeAccessInfoEpub; + + /** Whether this volume requires that the client explicitly request offline download license rather than have it done automatically when loading the content, if the client supports it. */ + explicitOfflineLicenseManagement?: boolean | null; + + /** Information about pdf content. (In LITE projection.) */ + pdf?: VolumeAccessInfoPdf; + + /** Whether or not this book is public domain in the country listed above. */ + publicDomain?: boolean | null; + + /** Whether quote sharing is allowed for this volume. */ + quoteSharingAllowed?: boolean | null; + + /** Whether text-to-speech is permitted for this volume. Values can be ALLOWED, ALLOWED_FOR_ACCESSIBILITY, or NOT_ALLOWED. */ + textToSpeechPermission?: string | null; + + /** For ordered but not yet processed orders, we give a URL that can be used to go to the appropriate Google Wallet page. */ + viewOrderUrl?: string | null; + + /** The read access of a volume. Possible values are PARTIAL, ALL_PAGES, NO_PAGES or UNKNOWN. This value depends on the country listed above. A value of PARTIAL means that the publisher has allowed some portion of the volume to be viewed publicly, without purchase. This can apply to eBooks as well as non-eBooks. Public domain books will always have a value of ALL_PAGES. */ + viewability?: string | null; + + /** URL to read this volume on the Google Books site. Link will not allow users to read non-viewable volumes. */ + webReaderLink?: string | null; + } + + export interface DownloadAccessRestriction { + + /** If restricted, whether access is granted for this (user, device, volume). */ + deviceAllowed?: boolean | null; + + /** + * If restricted, the number of content download licenses already acquired (including the requesting client, if licensed). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + downloadsAcquired?: number | null; + + /** If deviceAllowed, whether access was just acquired with this request. */ + justAcquired?: boolean | null; + + /** Resource type. */ + kind?: string | null; + + /** + * If restricted, the maximum number of content download licenses for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxDownloadDevices?: number | null; + + /** Error/warning message. */ + message?: string | null; + + /** Client nonce for verification. Download access and client-validation only. */ + nonce?: string | null; + + /** Error/warning reason code. Additional codes may be added in the future. 0 OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 WARNING_USED_LAST_ACCESS */ + reasonCode?: string | null; + + /** Whether this volume has any download access restrictions. */ + restricted?: boolean | null; + + /** Response signature. */ + signature?: string | null; + + /** Client app identifier for verification. Download access and client-validation only. */ + source?: string | null; + + /** Identifies the volume for which this entry applies. */ + volumeId?: string | null; + } + + export interface VolumeAccessInfoEpub { + + /** URL to retrieve ACS token for epub download. (In LITE projection.) */ + acsTokenLink?: string | null; + + /** URL to download epub. (In LITE projection.) */ + downloadLink?: string | null; + + /** Is a flowing text epub available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean | null; + } + + export interface VolumeAccessInfoPdf { + + /** URL to retrieve ACS token for pdf download. (In LITE projection.) */ + acsTokenLink?: string | null; + + /** URL to download pdf. (In LITE projection.) */ + downloadLink?: string | null; + + /** Is a scanned image pdf available either as public domain or for purchase. (In LITE projection.) */ + isAvailable?: boolean | null; + } + + export interface VolumeLayerInfo { + + /** A layer should appear here if and only if the layer exists for this book. */ + VolumeLayerInfoLayers?: Array; + } + + export interface VolumeLayerInfoLayers { + + /** The layer id of this layer (e.g. "geo"). */ + layerId?: string | null; + + /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ + volumeAnnotationsVersion?: string | null; + } + + export interface VolumeRecommendedInfo { + + /** A text explaining why this volume is recommended. */ + explanation?: string | null; + } + + export interface VolumeSaleInfo { + + /** URL to purchase this volume on the Google Books site. (In LITE projection) */ + buyLink?: string | null; + + /** The two-letter ISO_3166-1 country code for which this sale information is valid. (In LITE projection.) */ + country?: string | null; + + /** Whether or not this volume is an eBook (can be added to the My eBooks shelf). */ + isEbook?: boolean | null; + + /** Suggested retail price. (In LITE projection.) */ + listPrice?: VolumeSaleInfoListPrice; + + /** Offers available for this volume (sales and rentals). */ + VolumeSaleInfoOffers?: Array; + + /** The date on which this book is available for sale. */ + onSaleDate?: Date | null; + + /** The actual selling price of the book. This is the same as the suggested retail or list price unless there are offers or discounts on this volume. (In LITE projection.) */ + retailPrice?: VolumeSaleInfoRetailPrice; + + /** Whether or not this book is available for sale or offered for free in the Google eBookstore for the country listed above. Possible values are FOR_SALE, FOR_RENTAL_ONLY, FOR_SALE_AND_RENTAL, FREE, NOT_FOR_SALE, or FOR_PREORDER. */ + saleability?: string | null; + } + + export interface VolumeSaleInfoListPrice { + + /** + * Amount in the currency listed below. (In LITE projection.) + * Type: double + */ + amount?: number | null; + + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string | null; + } + + export interface VolumeSaleInfoOffers { + + /** + * The finsky offer type (e.g., PURCHASE=0 RENTAL=3) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + finskyOfferType?: number | null; + + /** Indicates whether the offer is giftable. */ + giftable?: boolean | null; + + /** Offer list (=undiscounted) price in Micros. */ + listPrice?: VolumeSaleInfoOffersListPrice; + + /** The rental duration (for rental offers only). */ + rentalDuration?: VolumeSaleInfoOffersRentalDuration; + + /** Offer retail (=discounted) price in Micros */ + retailPrice?: VolumeSaleInfoOffersRetailPrice; + } + + export interface VolumeSaleInfoOffersListPrice { + + /** Type: double */ + amountInMicros?: number | null; + currencyCode?: string | null; + } + + export interface VolumeSaleInfoOffersRentalDuration { + + /** Type: double */ + count?: number | null; + unit?: string | null; + } + + export interface VolumeSaleInfoOffersRetailPrice { + + /** Type: double */ + amountInMicros?: number | null; + currencyCode?: string | null; + } + + export interface VolumeSaleInfoRetailPrice { + + /** + * Amount in the currency listed below. (In LITE projection.) + * Type: double + */ + amount?: number | null; + + /** An ISO 4217, three-letter currency code. (In LITE projection.) */ + currencyCode?: string | null; + } + + export interface VolumeSearchInfo { + + /** A text snippet containing the search query. */ + textSnippet?: string | null; + } + + export interface VolumeUserInfo { + + /** Timestamp when this volume was acquired by the user. (RFC 3339 UTC date-time format) Acquiring includes purchase, user upload, receiving family sharing, etc. */ + acquiredTime?: Date | null; + + /** + * How this volume was acquired. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + acquisitionType?: number | null; + + /** Copy/Paste accounting information. */ + copy?: VolumeUserInfoCopy; + + /** + * Whether this volume is purchased, sample, pd download etc. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + entitlementType?: number | null; + + /** Information on the ability to share with the family. */ + familySharing?: VolumeUserInfoFamilySharing; + + /** Whether or not the user shared this volume with the family. */ + isFamilySharedFromUser?: boolean | null; + + /** Whether or not the user received this volume through family sharing. */ + isFamilySharedToUser?: boolean | null; + + /** Deprecated: Replaced by familySharing. */ + isFamilySharingAllowed?: boolean | null; + + /** Deprecated: Replaced by familySharing. */ + isFamilySharingDisabledByFop?: boolean | null; + + /** Whether or not this volume is currently in "my books." */ + isInMyBooks?: boolean | null; + + /** Whether or not this volume was pre-ordered by the authenticated user making the request. (In LITE projection.) */ + isPreordered?: boolean | null; + + /** Whether or not this volume was purchased by the authenticated user making the request. (In LITE projection.) */ + isPurchased?: boolean | null; + + /** Whether or not this volume was user uploaded. */ + isUploaded?: boolean | null; + readingPosition?: ReadingPosition; + + /** Period during this book is/was a valid rental. */ + rentalPeriod?: VolumeUserInfoRentalPeriod; + + /** Whether this book is an active or an expired rental. */ + rentalState?: string | null; + review?: Review; + + /** Timestamp when this volume was last modified by a user action, such as a reading position update, volume purchase or writing a review. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + userUploadedVolumeInfo?: VolumeUserInfoUserUploadedVolumeInfo; + } + + export interface VolumeUserInfoCopy { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + allowedCharacterCount?: number | null; + limitType?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + remainingCharacterCount?: number | null; + updated?: Date | null; + } + + export interface VolumeUserInfoFamilySharing { + + /** The role of the user in the family. */ + familyRole?: string | null; + + /** Whether or not this volume can be shared with the family by the user. This includes sharing eligibility of both the volume and the user. If the value is true, the user can initiate a family sharing action. */ + isSharingAllowed?: boolean | null; + + /** Whether or not sharing this volume is temporarily disabled due to issues with the Family Wallet. */ + isSharingDisabledByFop?: boolean | null; + } + + export interface ReadingPosition { + + /** Position in an EPUB as a CFI. */ + epubCfiPosition?: string | null; + + /** Position in a volume for image-based content. */ + gbImagePosition?: string | null; + + /** Position in a volume for text-based content. */ + gbTextPosition?: string | null; + + /** Resource type for a reading position. */ + kind?: string | null; + + /** Position in a PDF file. */ + pdfPosition?: string | null; + + /** Timestamp when this reading position was last updated (formatted UTC timestamp with millisecond resolution). */ + updated?: Date | null; + + /** Volume id associated with this reading position. */ + volumeId?: string | null; + } + + export interface VolumeUserInfoRentalPeriod { + endUtcSec?: string | null; + startUtcSec?: string | null; + } + + export interface Review { + + /** Author of this review. */ + author?: ReviewAuthor; + + /** Review text. */ + content?: string | null; + + /** Date of this review. */ + date?: string | null; + + /** URL for the full review text, for reviews gathered from the web. */ + fullTextUrl?: string | null; + + /** Resource type for a review. */ + kind?: string | null; + + /** Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, FIVE or NOT_RATED. */ + rating?: string | null; + + /** Information regarding the source of this review, when the review is not from a Google Books user. */ + source?: ReviewSource; + + /** Title for this review. */ + title?: string | null; + + /** Source type for this review. Possible values are EDITORIAL, WEB_USER or GOOGLE_USER. */ + type?: string | null; + + /** Volume that this review is for. */ + volumeId?: string | null; + } + + export interface ReviewAuthor { + + /** Name of this person. */ + displayName?: string | null; + } + + export interface ReviewSource { + + /** Name of the source. */ + description?: string | null; + + /** Extra text about the source of the review. */ + extraDescription?: string | null; + + /** URL of the source of the review. */ + url?: string | null; + } + + export interface VolumeUserInfoUserUploadedVolumeInfo { + processingState?: string | null; + } + + export interface VolumeVolumeInfo { + + /** Whether anonymous logging should be allowed. */ + allowAnonLogging?: boolean | null; + + /** The names of the authors and/or editors for this volume. (In LITE projection) */ + authors?: Array; + + /** + * The mean review rating for this volume. (min = 1.0, max = 5.0) + * Type: double + */ + averageRating?: number | null; + + /** Canonical URL for a volume. (In LITE projection.) */ + canonicalVolumeLink?: string | null; + + /** A list of subject categories, such as "Fiction", "Suspense", etc. */ + categories?: Array; + + /** Whether the volume has comics content. */ + comicsContent?: boolean | null; + + /** An identifier for the version of the volume content (text & images). (In LITE projection) */ + contentVersion?: string | null; + + /** A synopsis of the volume. The text of the description is formatted in HTML and includes simple formatting elements, such as b, i, and br tags. (In LITE projection.) */ + description?: string | null; + + /** Physical dimensions of this volume. */ + dimensions?: VolumeVolumeInfoDimensions; + + /** A list of image links for all the sizes that are available. (In LITE projection.) */ + imageLinks?: VolumeVolumeInfoImageLinks; + + /** Industry standard identifiers for this volume. */ + VolumeVolumeInfoIndustryIdentifiers?: Array; + + /** URL to view information about this volume on the Google Books site. (In LITE projection) */ + infoLink?: string | null; + + /** Best language for this volume (based on content). It is the two-letter ISO 639-1 code such as 'fr', 'en', etc. */ + language?: string | null; + + /** The main category to which this volume belongs. It will be the category from the categories list returned below that has the highest weight. */ + mainCategory?: string | null; + maturityRating?: string | null; + + /** + * Total number of pages as per publisher metadata. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageCount?: number | null; + + /** A top-level summary of the panelization info in this volume. */ + panelizationSummary?: VolumeVolumeInfoPanelizationSummary; + + /** URL to preview this volume on the Google Books site. */ + previewLink?: string | null; + + /** Type of publication of this volume. Possible values are BOOK or MAGAZINE. */ + printType?: string | null; + + /** + * Total number of printed pages in generated pdf representation. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + printedPageCount?: number | null; + + /** Date of publication. (In LITE projection.) */ + publishedDate?: string | null; + + /** Publisher of this volume. (In LITE projection.) */ + publisher?: string | null; + + /** + * The number of review ratings for this volume. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ratingsCount?: number | null; + + /** The reading modes available for this volume. */ + readingModes?: any; + + /** + * Total number of sample pages as per publisher metadata. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + samplePageCount?: number | null; + seriesInfo?: Volumeseriesinfo; + + /** Volume subtitle. (In LITE projection.) */ + subtitle?: string | null; + + /** Volume title. (In LITE projection.) */ + title?: string | null; + } + + export interface VolumeVolumeInfoDimensions { + + /** Height or length of this volume (in cm). */ + height?: string | null; + + /** Thickness of this volume (in cm). */ + thickness?: string | null; + + /** Width of this volume (in cm). */ + width?: string | null; + } + + export interface VolumeVolumeInfoImageLinks { + + /** Image link for extra large size (width of ~1280 pixels). (In LITE projection) */ + extraLarge?: string | null; + + /** Image link for large size (width of ~800 pixels). (In LITE projection) */ + large?: string | null; + + /** Image link for medium size (width of ~575 pixels). (In LITE projection) */ + medium?: string | null; + + /** Image link for small size (width of ~300 pixels). (In LITE projection) */ + small?: string | null; + + /** Image link for small thumbnail size (width of ~80 pixels). (In LITE projection) */ + smallThumbnail?: string | null; + + /** Image link for thumbnail size (width of ~128 pixels). (In LITE projection) */ + thumbnail?: string | null; + } + + export interface VolumeVolumeInfoIndustryIdentifiers { + + /** Industry specific volume identifier. */ + identifier?: string | null; + + /** Identifier type. Possible values are ISBN_10, ISBN_13, ISSN and OTHER. */ + type?: string | null; + } + + export interface VolumeVolumeInfoPanelizationSummary { + containsEpubBubbles?: boolean | null; + containsImageBubbles?: boolean | null; + epubBubbleVersion?: string | null; + imageBubbleVersion?: string | null; + } + + export interface Volumeseriesinfo { + + /** The display number string. This should be used only for display purposes and the actual sequence should be inferred from the below orderNumber. */ + bookDisplayNumber?: string | null; + + /** Resource type. */ + kind?: string | null; + + /** Short book title in the context of the series. */ + shortSeriesBookTitle?: string | null; + VolumeseriesinfoVolumeSeries?: Array; + } + + export interface VolumeseriesinfoVolumeSeries { + + /** List of issues. Applicable only for Collection Edition and Omnibus. */ + VolumeseriesinfoVolumeSeriesIssue?: Array; + + /** + * The book order number in the series. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + orderNumber?: number | null; + + /** The book type in the context of series. Examples - Single Issue, Collection Edition, etc. */ + seriesBookType?: string | null; + + /** The series id. */ + seriesId?: string | null; + } + + export interface VolumeseriesinfoVolumeSeriesIssue { + issueDisplayNumber?: string | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + issueOrderNumber?: number | null; + } + + export interface DownloadAccesses { + + /** A list of download access responses. */ + downloadAccessList?: Array; + + /** Resource type. */ + kind?: string | null; + } + + export interface FamilyInfo { + + /** Resource type. */ + kind?: string | null; + + /** Family membership info of the user that made the request. */ + membership?: FamilyInfoMembership; + } + + export interface FamilyInfoMembership { + + /** Restrictions on user buying and acquiring content. */ + acquirePermission?: string | null; + + /** The age group of the user. */ + ageGroup?: string | null; + + /** The maximum allowed maturity rating for the user. */ + allowedMaturityRating?: string | null; + isInFamily?: boolean | null; + + /** The role of the user in the family. */ + role?: string | null; + } + + export interface Geolayerdata { + common?: GeolayerdataCommon; + geo?: GeolayerdataGeo; + kind?: string | null; + } + + export interface GeolayerdataCommon { + + /** The language of the information url and description. */ + lang?: string | null; + + /** The URL for the preview image information. */ + previewImageUrl?: string | null; + + /** The description for this location. */ + snippet?: string | null; + + /** The URL for information for this location. Ex: wikipedia link. */ + snippetUrl?: string | null; + + /** The display title and localized canonical name to use when searching for this entity on Google search. */ + title?: string | null; + } + + export interface GeolayerdataGeo { + + /** The boundary of the location as a set of loops containing pairs of latitude, longitude coordinates. */ + boundary?: Array; + + /** The cache policy active for this data. EX: UNRESTRICTED, RESTRICTED, NEVER */ + cachePolicy?: string | null; + + /** The country code of the location. */ + countryCode?: string | null; + + /** + * The latitude of the location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude of the location. + * Type: double + */ + longitude?: number | null; + + /** The type of map that should be used for this location. EX: HYBRID, ROADMAP, SATELLITE, TERRAIN */ + mapType?: string | null; + + /** The viewport for showing this location. This is a latitude, longitude rectangle. */ + viewport?: GeolayerdataGeoViewport; + + /** + * The Zoom level to use for the map. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings). See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + zoom?: number | null; + } + + export interface GeolayerdataGeoViewport { + hi?: GeolayerdataGeoViewportHi; + lo?: GeolayerdataGeoViewportLo; + } + + export interface GeolayerdataGeoViewportHi { + + /** Type: double */ + latitude?: number | null; + + /** Type: double */ + longitude?: number | null; + } + + export interface GeolayerdataGeoViewportLo { + + /** Type: double */ + latitude?: number | null; + + /** Type: double */ + longitude?: number | null; + } + + export interface Layersummaries { + + /** A list of layer summary items. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + + /** + * The total number of layer summaries found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + + export interface Layersummary { + + /** + * The number of annotations for this layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + annotationCount?: number | null; + + /** The list of annotation types contained for this layer. */ + annotationTypes?: Array; + + /** Link to get data for this annotation. */ + annotationsDataLink?: string | null; + + /** The link to get the annotations for this layer. */ + annotationsLink?: string | null; + + /** The content version this resource is for. */ + contentVersion?: string | null; + + /** + * The number of data items for this layer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + dataCount?: number | null; + + /** Unique id of this layer summary. */ + id?: string | null; + + /** Resource Type */ + kind?: string | null; + + /** The layer id for this summary. */ + layerId?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Timestamp for the last time an item in this layer was updated. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + + /** The current version of this layer's volume annotations. Note that this version applies only to the data in the books.layers.volumeAnnotations.* responses. The actual annotation data is versioned separately. */ + volumeAnnotationsVersion?: string | null; + + /** The volume id this resource is for. */ + volumeId?: string | null; + } + + export interface Metadata { + + /** A list of offline dictionary metadata. */ + MetadataItems?: Array; + + /** Resource type. */ + kind?: string | null; + } + + export interface MetadataItems { + download_url?: string | null; + encrypted_key?: string | null; + language?: string | null; + size?: string | null; + version?: string | null; + } + + export interface Notification { + body?: string | null; + + /** The list of crm experiment ids. */ + crmExperimentIds?: Array; + doc_id?: string | null; + doc_type?: string | null; + dont_show_notification?: boolean | null; + iconUrl?: string | null; + is_document_mature?: boolean | null; + + /** Resource type. */ + kind?: string | null; + notificationGroup?: string | null; + notification_type?: string | null; + pcampaign_id?: string | null; + reason?: string | null; + show_notification_settings_action?: boolean | null; + targetUrl?: string | null; + timeToExpireMs?: string | null; + title?: string | null; + } + + export interface Offers { + + /** A list of offers. */ + OffersItems?: Array; + + /** Resource type. */ + kind?: string | null; + } + + export interface OffersItems { + artUrl?: string | null; + gservicesKey?: string | null; + id?: string | null; + OffersItemsItems?: Array; + } + + export interface OffersItemsItems { + author?: string | null; + canonicalVolumeLink?: string | null; + coverUrl?: string | null; + description?: string | null; + title?: string | null; + volumeId?: string | null; + } + + export interface RequestAccess { + concurrentAccess?: ConcurrentAccessRestriction; + downloadAccess?: DownloadAccessRestriction; + + /** Resource type. */ + kind?: string | null; + } + + export interface Series { + + /** Resource type. */ + kind?: string | null; + SeriesSeries?: Array; + } + + export interface SeriesSeries { + bannerImageUrl?: string | null; + eligibleForSubscription?: boolean | null; + imageUrl?: string | null; + isComplete?: boolean | null; + seriesFormatType?: string | null; + seriesId?: string | null; + seriesSubscriptionReleaseInfo?: SeriesSeriesSeriesSubscriptionReleaseInfo; + seriesType?: string | null; + subscriptionId?: string | null; + title?: string | null; + } + + export interface SeriesSeriesSeriesSubscriptionReleaseInfo { + + /** Cancellation date of the series subscription (or when it ends). */ + cancellationTimestampUs?: string | null; + currentReleaseInfo?: BooksSubscriptionReleaseInfo; + nextReleaseInfo?: BooksSubscriptionReleaseInfo; + + /** series subscription type. */ + seriesSubscriptionType?: string | null; + } + + export interface Seriesmembership { + + /** Resorce type. */ + kind?: string | null; + member?: Array; + nextPageToken?: string | null; + } + + export interface Usersettings { + + /** Resource type. */ + kind?: string | null; + + /** User settings in sub-objects, each for different purposes. */ + notesExport?: UsersettingsNotesExport; + notification?: UsersettingsNotification; + } + + export interface UsersettingsNotesExport { + folderName?: string | null; + isEnabled?: boolean | null; + } + + export interface UsersettingsNotification { + matchMyInterests?: UsersettingsNotificationMatchMyInterests; + moreFromAuthors?: UsersettingsNotificationMoreFromAuthors; + moreFromSeries?: UsersettingsNotificationMoreFromSeries; + priceDrop?: UsersettingsNotificationPriceDrop; + rewardExpirations?: UsersettingsNotificationRewardExpirations; + } + + export interface UsersettingsNotificationMatchMyInterests { + opted_state?: string | null; + } + + export interface UsersettingsNotificationMoreFromAuthors { + opted_state?: string | null; + } + + export interface UsersettingsNotificationMoreFromSeries { + opted_state?: string | null; + } + + export interface UsersettingsNotificationPriceDrop { + opted_state?: string | null; + } + + export interface UsersettingsNotificationRewardExpirations { + opted_state?: string | null; + } + + export interface Volume2 { + + /** A list of volumes. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + nextPageToken?: string | null; + } + + export interface Volumeannotation { + + /** The annotation data id for this volume annotation. */ + annotationDataId?: string | null; + + /** Link to get data for this annotation. */ + annotationDataLink?: string | null; + + /** The type of annotation this is. */ + annotationType?: string | null; + + /** The content ranges to identify the selected text. */ + contentRanges?: VolumeannotationContentRanges; + + /** Data for this annotation. */ + data?: string | null; + + /** Indicates that this annotation is deleted. */ + deleted?: boolean | null; + + /** Unique id of this volume annotation. */ + id?: string | null; + + /** Resource Type */ + kind?: string | null; + + /** The Layer this annotation is for. */ + layerId?: string | null; + + /** Pages the annotation spans. */ + pageIds?: Array; + + /** Excerpt from the volume. */ + selectedText?: string | null; + + /** URL to this resource. */ + selfLink?: string | null; + + /** Timestamp for the last time this anntoation was updated. (RFC 3339 UTC date-time format). */ + updated?: Date | null; + + /** The Volume this annotation is for. */ + volumeId?: string | null; + } + + export interface VolumeannotationContentRanges { + cfiRange?: BooksAnnotationsRange; + + /** Content version applicable to ranges below. */ + contentVersion?: string | null; + gbImageRange?: BooksAnnotationsRange; + gbTextRange?: BooksAnnotationsRange; + } + + export interface Volumeannotations { + + /** A list of volume annotations. */ + items?: Array; + + /** Resource type */ + kind?: string | null; + + /** Token to pass in for pagination for the next page. This will not be present if this request does not have more results. */ + nextPageToken?: string | null; + + /** + * The total number of volume annotations found. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + + /** The version string for all of the volume annotations in this layer (not just the ones in this response). Note: the version string doesn't apply to the annotation data, just the information in this response (e.g. the location of annotations in the book). */ + version?: string | null; + } + + export interface Volumes { + + /** A list of volumes. */ + items?: Array; + + /** Resource type. */ + kind?: string | null; + + /** + * Total number of volumes found. This might be greater than the number of volumes returned in this response if results have been paginated. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + totalItems?: number | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Post cloudloading/addBook + * @param {string} drive_document_id A drive document id. The upload_client_token must not be set. + * @param {string} mime_type The document MIME type. It can be set only if the drive_document_id is set. + * @param {string} name The document name. It can be set only if the drive_document_id is set. + * @return {void} Successful response + */ + Books_cloudloading_addBook(drive_document_id: string | null | undefined, mime_type: string | null | undefined, name: string | null | undefined, upload_client_token: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'cloudloading/addBook?drive_document_id=' + (drive_document_id == null ? '' : encodeURIComponent(drive_document_id)) + '&mime_type=' + (mime_type == null ? '' : encodeURIComponent(mime_type)) + '&name=' + (name == null ? '' : encodeURIComponent(name)) + '&upload_client_token=' + (upload_client_token == null ? '' : encodeURIComponent(upload_client_token)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Remove the book and its contents + * Post cloudloading/deleteBook + * @param {string} volumeId The id of the book to be removed. + * @return {void} Successful response + */ + Books_cloudloading_deleteBook(volumeId: string): Observable> { + return this.http.post(this.baseUri + 'cloudloading/deleteBook?volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Post cloudloading/updateBook + * @return {void} Successful response + */ + Books_cloudloading_updateBook(requestBody: BooksCloudloadingResource): Observable> { + return this.http.post(this.baseUri + 'cloudloading/updateBook', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Returns a list of offline dictionary metadata available + * Get dictionary/listOfflineMetadata + * @param {string} cpksver The device/version ID from which to request the data. + * @return {void} Successful response + */ + Books_dictionary_listOfflineMetadata(cpksver: string): Observable> { + return this.http.get(this.baseUri + 'dictionary/listOfflineMetadata?cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets information regarding the family that the user is part of. + * Get familysharing/getFamilyInfo + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_familysharing_getFamilyInfo(source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'familysharing/getFamilyInfo?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Initiates sharing of the content with the user's family. Empty response indicates success. + * Post familysharing/share + * @param {string} docId The docid to share. + * @param {string} source String to identify the originator of this request. + * @param {string} volumeId The volume to share. + * @return {void} Successful response + */ + Books_familysharing_share(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'familysharing/share?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Initiates revoking content that has already been shared with the user's family. Empty response indicates success. + * Post familysharing/unshare + * @param {string} docId The docid to unshare. + * @param {string} source String to identify the originator of this request. + * @param {string} volumeId The volume to unshare. + * @return {void} Successful response + */ + Books_familysharing_unshare(docId: string | null | undefined, source: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'familysharing/unshare?docId=' + (docId == null ? '' : encodeURIComponent(docId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the current settings for the user. + * Get myconfig/getUserSettings + * @return {void} Successful response + */ + Books_myconfig_getUserSettings(): Observable> { + return this.http.get(this.baseUri + 'myconfig/getUserSettings', { observe: 'response', responseType: 'text' }); + } + + /** + * Release downloaded content access restriction. + * Post myconfig/releaseDownloadAccess + * @param {Array} volumeIds The volume(s) to release restrictions for. + * @param {string} cpksver The device/version ID from which to release the restriction. + * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_myconfig_releaseDownloadAccess(volumeIds: Array, cpksver: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'myconfig/releaseDownloadAccess?' + volumeIds.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&') + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Request concurrent and download access restrictions. + * Post myconfig/requestAccess + * @param {string} source String to identify the originator of this request. + * @param {string} volumeId The volume to request concurrent/download restrictions for. + * @param {string} nonce The client nonce value. + * @param {string} cpksver The device/version ID from which to request the restrictions. + * @param {Books_myconfig_requestAccessLicenseTypes} licenseTypes The type of access license to request. If not specified, the default is BOTH. + * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @return {void} Successful response + */ + Books_myconfig_requestAccess(source: string, volumeId: string, nonce: string, cpksver: string, licenseTypes: Books_myconfig_requestAccessLicenseTypes | null | undefined, locale: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'myconfig/requestAccess?source=' + (source == null ? '' : encodeURIComponent(source)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&licenseTypes=' + licenseTypes + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Request downloaded content access for specified volumes on the My eBooks shelf. + * Post myconfig/syncVolumeLicenses + * @param {string} source String to identify the originator of this request. + * @param {string} nonce The client nonce value. + * @param {string} cpksver The device/version ID from which to release the restriction. + * @param {Array} features List of features supported by the client, i.e., 'RENTALS' + * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. + * @param {string} locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {Array} volumeIds The volume(s) to request download restrictions for. + * @return {void} Successful response + */ + Books_myconfig_syncVolumeLicenses(source: string, nonce: string, cpksver: string, features: Array | null | undefined, includeNonComicsSeries: boolean | null | undefined, locale: string | null | undefined, showPreorders: boolean | null | undefined, volumeIds: Array | null | undefined): Observable> { + return this.http.post(this.baseUri + 'myconfig/syncVolumeLicenses?source=' + (source == null ? '' : encodeURIComponent(source)) + '&nonce=' + (nonce == null ? '' : encodeURIComponent(nonce)) + '&cpksver=' + (cpksver == null ? '' : encodeURIComponent(cpksver)) + '&' + features?.map(z => `features=${encodeURIComponent(z)}`).join('&') + '&includeNonComicsSeries=' + includeNonComicsSeries + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&showPreorders=' + showPreorders + '&' + volumeIds?.map(z => `volumeIds=${encodeURIComponent(z)}`).join('&'), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value. + * Post myconfig/updateUserSettings + * @return {void} Successful response + */ + Books_myconfig_updateUserSettings(requestBody: Usersettings): Observable> { + return this.http.post(this.baseUri + 'myconfig/updateUserSettings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves a list of annotations, possibly filtered. + * Get mylibrary/annotations + * @param {string} contentVersion The content version for the requested volume. + * @param {string} layerId The layer ID to limit annotation by. + * @param {Array} layerIds The layer ID(s) to limit annotation by. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 40 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {string} volumeId The volume to restrict annotations to. + * @return {void} Successful response + */ + Books_mylibrary_annotations_list(contentVersion: string | null | undefined, layerId: string | null | undefined, layerIds: Array | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/annotations?contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&layerId=' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&' + layerIds?.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Inserts a new annotation. + * Post mylibrary/annotations + * @param {string} annotationId The ID for the annotation to insert. + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {boolean} showOnlySummaryInResponse Requests that only the summary of the specified layer be provided in the response. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_annotations_insert(annotationId: string | null | undefined, country: string | null | undefined, showOnlySummaryInResponse: boolean | null | undefined, source: string | null | undefined, requestBody: Annotation): Observable> { + return this.http.post(this.baseUri + 'mylibrary/annotations?annotationId=' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&showOnlySummaryInResponse=' + showOnlySummaryInResponse + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Gets the summary of specified layers. + * Post mylibrary/annotations/summary + * @param {Array} layerIds Array of layer IDs to get the summary for. + * @param {string} volumeId Volume id to get the summary for. + * @return {void} Successful response + */ + Books_mylibrary_annotations_summary(layerIds: Array, volumeId: string): Observable> { + return this.http.post(this.baseUri + 'mylibrary/annotations/summary?' + layerIds.map(z => `layerIds=${encodeURIComponent(z)}`).join('&') + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Deletes an annotation. + * Delete mylibrary/annotations/{annotationId} + * @param {string} annotationId The ID for the annotation to delete. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_annotations_delete(annotationId: string, source: string | null | undefined): Observable> { + return this.http.delete(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Updates an existing annotation. + * Put mylibrary/annotations/{annotationId} + * @param {string} annotationId The ID for the annotation to update. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_annotations_update(annotationId: string, source: string | null | undefined, requestBody: Annotation): Observable> { + return this.http.put(this.baseUri + 'mylibrary/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves a list of bookshelves belonging to the authenticated user. + * Get mylibrary/bookshelves + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_list(source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/bookshelves?source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves metadata for a specific bookshelf belonging to the authenticated user. + * Get mylibrary/bookshelves/{shelf} + * @param {string} shelf ID of bookshelf to retrieve. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_get(shelf: string, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Adds a volume to a bookshelf. + * Post mylibrary/bookshelves/{shelf}/addVolume + * @param {string} shelf ID of bookshelf to which to add a volume. + * @param {string} volumeId ID of volume to add. + * @param {Books_mylibrary_bookshelves_addVolumeReason} reason The reason for which the book is added to the library. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_addVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_addVolumeReason | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/addVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Clears all volumes from a bookshelf. + * Post mylibrary/bookshelves/{shelf}/clearVolumes + * @param {string} shelf ID of bookshelf from which to remove a volume. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_clearVolumes(shelf: string, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/clearVolumes&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Moves a volume within a bookshelf. + * Post mylibrary/bookshelves/{shelf}/moveVolume + * @param {string} shelf ID of bookshelf with the volume. + * @param {string} volumeId ID of volume to move. + * @param {number} volumePosition Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_moveVolume(shelf: string, volumeId: string, volumePosition: number, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/moveVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&volumePosition=' + volumePosition + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Removes a volume from a bookshelf. + * Post mylibrary/bookshelves/{shelf}/removeVolume + * @param {string} shelf ID of bookshelf from which to remove a volume. + * @param {string} volumeId ID of volume to remove. + * @param {Books_mylibrary_bookshelves_removeVolumeReason} reason The reason for which the book is removed from the library. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_removeVolume(shelf: string, volumeId: string, reason: Books_mylibrary_bookshelves_removeVolumeReason | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/removeVolume&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&reason=' + reason + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Gets volume information for volumes on a bookshelf. + * Get mylibrary/bookshelves/{shelf}/volumes + * @param {string} shelf The bookshelf ID or name retrieve volumes for. + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 + * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. + * @param {string} q Full-text search query string in this bookshelf. + * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first element to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_mylibrary_bookshelves_volumes_list(shelf: string, country: string | null | undefined, maxResults: number | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, q: string | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&country=' + (country == null ? '' : encodeURIComponent(country)) + '&maxResults=' + maxResults + '&projection=' + projection + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves my reading position information for a volume. + * Get mylibrary/readingpositions/{volumeId} + * @param {string} volumeId ID of volume for which to retrieve a reading position. + * @param {string} contentVersion Volume content version for which this reading position is requested. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_readingpositions_get(volumeId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Sets my reading position information for a volume. + * Post mylibrary/readingpositions/{volumeId}/setPosition + * @param {string} volumeId ID of volume for which to update the reading position. + * @param {string} timestamp RFC 3339 UTC format timestamp associated with this reading position. + * @param {string} position Position string for the new volume reading position. + * @param {Books_mylibrary_readingpositions_setPositionAction} action Action that caused this reading position to be set. + * @param {string} contentVersion Volume content version for which this reading position applies. + * @param {string} deviceCookie Random persistent device cookie optional on set position. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_mylibrary_readingpositions_setPosition(volumeId: string, timestamp: string, position: string, action: Books_mylibrary_readingpositions_setPositionAction | null | undefined, contentVersion: string | null | undefined, deviceCookie: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'mylibrary/readingpositions/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/setPosition×tamp=' + (timestamp == null ? '' : encodeURIComponent(timestamp)) + '&position=' + (position == null ? '' : encodeURIComponent(position)) + '&action=' + action + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&deviceCookie=' + (deviceCookie == null ? '' : encodeURIComponent(deviceCookie)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Returns notification details for a given notification id. + * Get notification/get + * @param {string} notification_id String to identify the notification. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_notification_get(notification_id: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'notification/get?notification_id=' + (notification_id == null ? '' : encodeURIComponent(notification_id)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * List categories for onboarding experience. + * Get onboarding/listCategories + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * @return {void} Successful response + */ + Books_onboarding_listCategories(locale: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'onboarding/listCategories?locale=' + (locale == null ? '' : encodeURIComponent(locale)), { observe: 'response', responseType: 'text' }); + } + + /** + * List available volumes under categories for onboarding experience. + * Get onboarding/listCategoryVolumes + * @param {Array} categoryId List of category ids requested. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. + * @param {number} pageSize Number of maximum results per page to be included in the response. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} pageToken The value of the nextToken from the previous page. + * @return {void} Successful response + */ + Books_onboarding_listCategoryVolumes(categoryId: Array | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, pageSize: number | null | undefined, pageToken: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'onboarding/listCategoryVolumes?' + categoryId?.map(z => `categoryId=${encodeURIComponent(z)}`).join('&') + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&pageSize=' + pageSize + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)), { observe: 'response', responseType: 'text' }); + } + + /** + * Returns a stream of personalized book clusters + * Get personalizedstream/get + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_personalizedstream_get(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'personalizedstream/get?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Post promooffer/accept + * @param {string} androidId device android_id + * @param {string} device device device + * @param {string} manufacturer device manufacturer + * @param {string} model device model + * @param {string} product device product + * @param {string} serial device serial + * @param {string} volumeId Volume id to exercise the offer + * @return {void} Successful response + */ + Books_promooffer_accept(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined, volumeId: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'promooffer/accept?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)) + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Post promooffer/dismiss + * @param {string} androidId device android_id + * @param {string} device device device + * @param {string} manufacturer device manufacturer + * @param {string} model device model + * @param {string} offerId Offer to dimiss + * @param {string} product device product + * @param {string} serial device serial + * @return {void} Successful response + */ + Books_promooffer_dismiss(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, offerId: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'promooffer/dismiss?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&offerId=' + (offerId == null ? '' : encodeURIComponent(offerId)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Returns a list of promo offers available to the user + * Get promooffer/get + * @param {string} androidId device android_id + * @param {string} device device device + * @param {string} manufacturer device manufacturer + * @param {string} model device model + * @param {string} product device product + * @param {string} serial device serial + * @return {void} Successful response + */ + Books_promooffer_get(androidId: string | null | undefined, device: string | null | undefined, manufacturer: string | null | undefined, model: string | null | undefined, product: string | null | undefined, serial: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'promooffer/get?androidId=' + (androidId == null ? '' : encodeURIComponent(androidId)) + '&device=' + (device == null ? '' : encodeURIComponent(device)) + '&manufacturer=' + (manufacturer == null ? '' : encodeURIComponent(manufacturer)) + '&model=' + (model == null ? '' : encodeURIComponent(model)) + '&product=' + (product == null ? '' : encodeURIComponent(product)) + '&serial=' + (serial == null ? '' : encodeURIComponent(serial)), { observe: 'response', responseType: 'text' }); + } + + /** + * Returns Series metadata for the given series ids. + * Get series/get + * @param {Array} series_id String that identifies the series + * @return {void} Successful response + */ + Books_series_get(series_id: Array): Observable> { + return this.http.get(this.baseUri + 'series/get?' + series_id.map(z => `series_id=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); + } + + /** + * Returns Series membership data given the series id. + * Get series/membership/get + * @param {string} series_id String that identifies the series + * @param {number} page_size Number of maximum results per page to be included in the response. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} page_token The value of the nextToken from the previous page. + * @return {void} Successful response + */ + Books_series_membership_get(series_id: string, page_size: number | null | undefined, page_token: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'series/membership/get?series_id=' + (series_id == null ? '' : encodeURIComponent(series_id)) + '&page_size=' + page_size + '&page_token=' + (page_token == null ? '' : encodeURIComponent(page_token)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves a list of public bookshelves for the specified user. + * Get users/{userId}/bookshelves + * @param {string} userId ID of user for whom to retrieve bookshelves. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_bookshelves_list(userId: string, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves metadata for a specific bookshelf for the specified user. + * Get users/{userId}/bookshelves/{shelf} + * @param {string} userId ID of user for whom to retrieve bookshelves. + * @param {string} shelf ID of bookshelf to retrieve. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_bookshelves_get(userId: string, shelf: string, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieves volumes in a specific bookshelf for the specified user. + * Get users/{userId}/bookshelves/{shelf}/volumes + * @param {string} userId ID of user for whom to retrieve bookshelf volumes. + * @param {string} shelf ID of bookshelf to retrieve volumes. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 + * @param {boolean} showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first element to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_bookshelves_volumes_list(userId: string, shelf: string, maxResults: number | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'users/' + (userId == null ? '' : encodeURIComponent(userId)) + '/bookshelves/' + (shelf == null ? '' : encodeURIComponent(shelf)) + '/volumes&maxResults=' + maxResults + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Performs a book search. + * Get volumes + * @param {string} q Full-text search query string. + * @param {Books_volumes_listDownload} download Restrict to volumes by download availability. + * @param {Books_volumes_listFilter} filter Filter search results. + * @param {string} langRestrict Restrict results to books with this language code. + * @param {Books_volumes_listLibraryRestrict} libraryRestrict Restrict search to this user's library. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {number} maxResults Maximum number of results to return. + * Minimum: 0 Maximum: 40 + * @param {Books_volumes_listOrderBy} orderBy Sort search results. + * @param {string} partner Restrict and brand results for partner ID. + * @param {Books_volumes_listPrintType} printType Restrict to books or magazines. + * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. + * @param {boolean} showPreorders Set to true to show books available for preorder. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first result to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_volumes_list(q: string, download: Books_volumes_listDownload | null | undefined, filter: Books_volumes_listFilter | null | undefined, langRestrict: string | null | undefined, libraryRestrict: Books_volumes_listLibraryRestrict | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, maxResults: number | null | undefined, orderBy: Books_volumes_listOrderBy | null | undefined, partner: string | null | undefined, printType: Books_volumes_listPrintType | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, showPreorders: boolean | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes?q=' + (q == null ? '' : encodeURIComponent(q)) + '&download=' + download + '&filter=' + filter + '&langRestrict=' + (langRestrict == null ? '' : encodeURIComponent(langRestrict)) + '&libraryRestrict=' + libraryRestrict + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&maxResults=' + maxResults + '&orderBy=' + orderBy + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&printType=' + printType + '&projection=' + projection + '&showPreorders=' + showPreorders + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of books in My Library. + * Get volumes/mybooks + * @param {Array} acquireMethod How the book was acquired + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. + * @param {number} maxResults Maximum number of results to return. + * Minimum: 0 Maximum: 100 + * @param {Array} processingState The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first result to return (starts at 0) + * Minimum: 0 + * @return {void} Successful response + */ + Books_volumes_mybooks_list(acquireMethod: Array | null | undefined, country: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/mybooks?' + acquireMethod?.map(z => `acquireMethod=${encodeURIComponent(z)}`).join('&') + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of recommended books for the current user. + * Get volumes/recommended + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_recommended_list(locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/recommended?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Rate a recommended book for the current user. + * Post volumes/recommended/rate + * @param {Books_volumes_recommended_rateRating} rating Rating to be given to the volume. + * @param {string} volumeId ID of the source volume. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_recommended_rate(rating: Books_volumes_recommended_rateRating, volumeId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.post(this.baseUri + 'volumes/recommended/rate?rating=' + rating + '&volumeId=' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), null, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of books uploaded by the current user. + * Get volumes/useruploaded + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {number} maxResults Maximum number of results to return. + * Minimum: 0 Maximum: 40 + * @param {Array} processingState The processing state of the user uploaded volumes to be returned. + * @param {string} source String to identify the originator of this request. + * @param {number} startIndex Index of the first result to return (starts at 0) + * Minimum: 0 + * @param {Array} volumeId The ids of the volumes to be returned. If not specified all that match the processingState are returned. + * @return {void} Successful response + */ + Books_volumes_useruploaded_list(locale: string | null | undefined, maxResults: number | null | undefined, processingState: Array | null | undefined, source: string | null | undefined, startIndex: number | null | undefined, volumeId: Array | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/useruploaded?locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&' + processingState?.map(z => `processingState=${encodeURIComponent(z)}`).join('&') + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startIndex=' + startIndex + '&' + volumeId?.map(z => `volumeId=${encodeURIComponent(z)}`).join('&'), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets volume information for a single volume. + * Get volumes/{volumeId} + * @param {string} volumeId ID of volume to retrieve. + * @param {string} country ISO-3166-1 code to override the IP-based location. + * @param {boolean} includeNonComicsSeries Set to true to include non-comics series. Defaults to false. + * @param {string} partner Brand results for partner ID. + * @param {Books_mylibrary_bookshelves_volumes_listProjection} projection Restrict information returned to a set of selected fields. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_get(volumeId: string, country: string | null | undefined, includeNonComicsSeries: boolean | null | undefined, partner: string | null | undefined, projection: Books_mylibrary_bookshelves_volumes_listProjection | null | undefined, source: string | null | undefined, user_library_consistent_read: boolean | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '&country=' + (country == null ? '' : encodeURIComponent(country)) + '&includeNonComicsSeries=' + includeNonComicsSeries + '&partner=' + (partner == null ? '' : encodeURIComponent(partner)) + '&projection=' + projection + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&user_library_consistent_read=' + user_library_consistent_read, { observe: 'response', responseType: 'text' }); + } + + /** + * Return a list of associated books. + * Get volumes/{volumeId}/associated + * @param {string} volumeId ID of the source volume. + * @param {Books_volumes_associated_listAssociation} association Association type. + * @param {string} locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating} maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_volumes_associated_list(volumeId: string, association: Books_volumes_associated_listAssociation | null | undefined, locale: string | null | undefined, maxAllowedMaturityRating: Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/associated&association=' + association + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxAllowedMaturityRating=' + maxAllowedMaturityRating + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the volume annotations for a volume and layer. + * Get volumes/{volumeId}/layers/{layerId} + * @param {string} volumeId The volume to retrieve annotations for. + * @param {string} layerId The ID for the layer to get the annotations. + * @param {string} contentVersion The content version for the requested volume. + * @param {string} endOffset The end offset to end retrieving data from. + * @param {string} endPosition The end position to end retrieving data from. + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 200 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {boolean} showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * @param {string} source String to identify the originator of this request. + * @param {string} startOffset The start offset to start retrieving data from. + * @param {string} startPosition The start position to start retrieving data from. + * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {string} volumeAnnotationsVersion The version of the volume annotations that you are requesting. + * @return {void} Successful response + */ + Books_layers_volumeAnnotations_list(volumeId: string, layerId: string, contentVersion: string, endOffset: string | null | undefined, endPosition: string | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, showDeleted: boolean | null | undefined, source: string | null | undefined, startOffset: string | null | undefined, startPosition: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, volumeAnnotationsVersion: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&endOffset=' + (endOffset == null ? '' : encodeURIComponent(endOffset)) + '&endPosition=' + (endPosition == null ? '' : encodeURIComponent(endPosition)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&showDeleted=' + showDeleted + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&startOffset=' + (startOffset == null ? '' : encodeURIComponent(startOffset)) + '&startPosition=' + (startPosition == null ? '' : encodeURIComponent(startPosition)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&volumeAnnotationsVersion=' + (volumeAnnotationsVersion == null ? '' : encodeURIComponent(volumeAnnotationsVersion)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the volume annotation. + * Get volumes/{volumeId}/layers/{layerId}/annotations/{annotationId} + * @param {string} volumeId The volume to retrieve annotations for. + * @param {string} layerId The ID for the layer to get the annotations. + * @param {string} annotationId The ID of the volume annotation to retrieve. + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_layers_volumeAnnotations_get(volumeId: string, layerId: string, annotationId: string, locale: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/annotations/' + (annotationId == null ? '' : encodeURIComponent(annotationId)) + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the annotation data for a volume and layer. + * Get volumes/{volumeId}/layers/{layerId}/data + * @param {string} volumeId The volume to retrieve annotation data for. + * @param {string} layerId The ID for the layer to get the annotation data. + * @param {string} contentVersion The content version for the requested volume. + * @param {Array} annotationDataId The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. + * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 200 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {number} scale The requested scale for the image. + * Minimum: 0 + * @param {string} source String to identify the originator of this request. + * @param {string} updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string} updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Successful response + */ + Books_layers_annotationData_list(volumeId: string, layerId: string, contentVersion: string, annotationDataId: Array | null | undefined, h: number | null | undefined, locale: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, updatedMax: string | null | undefined, updatedMin: string | null | undefined, w: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&' + annotationDataId?.map(z => `annotationDataId=${encodeURIComponent(z)}`).join('&') + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&updatedMax=' + (updatedMax == null ? '' : encodeURIComponent(updatedMax)) + '&updatedMin=' + (updatedMin == null ? '' : encodeURIComponent(updatedMin)) + '&w=' + w, { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the annotation data. + * Get volumes/{volumeId}/layers/{layerId}/data/{annotationDataId} + * @param {string} volumeId The volume to retrieve annotations for. + * @param {string} layerId The ID for the layer to get the annotations. + * @param {string} annotationDataId The ID of the annotation data to retrieve. + * @param {string} contentVersion The content version for the volume you are trying to retrieve. + * @param {boolean} allowWebDefinitions For the dictionary layer. Whether or not to allow web definitions. + * @param {number} h The requested pixel height for any images. If height is provided width must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {number} scale The requested scale for the image. + * Minimum: 0 + * @param {string} source String to identify the originator of this request. + * @param {number} w The requested pixel width for any images. If width is provided height must also be provided. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} Successful response + */ + Books_layers_annotationData_get(volumeId: string, layerId: string, annotationDataId: string, contentVersion: string, allowWebDefinitions: boolean | null | undefined, h: number | null | undefined, locale: string | null | undefined, scale: number | null | undefined, source: string | null | undefined, w: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layers/' + (layerId == null ? '' : encodeURIComponent(layerId)) + '/data/' + (annotationDataId == null ? '' : encodeURIComponent(annotationDataId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&allowWebDefinitions=' + allowWebDefinitions + '&h=' + h + '&locale=' + (locale == null ? '' : encodeURIComponent(locale)) + '&scale=' + scale + '&source=' + (source == null ? '' : encodeURIComponent(source)) + '&w=' + w, { observe: 'response', responseType: 'text' }); + } + + /** + * List the layer summaries for a volume. + * Get volumes/{volumeId}/layersummary + * @param {string} volumeId The volume to retrieve layers for. + * @param {string} contentVersion The content version for the requested volume. + * @param {number} maxResults Maximum number of results to return + * Minimum: 0 Maximum: 200 + * @param {string} pageToken The value of the nextToken from the previous page. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_layers_list(volumeId: string, contentVersion: string | null | undefined, maxResults: number | null | undefined, pageToken: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&maxResults=' + maxResults + '&pageToken=' + (pageToken == null ? '' : encodeURIComponent(pageToken)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + + /** + * Gets the layer summary for a volume. + * Get volumes/{volumeId}/layersummary/{summaryId} + * @param {string} volumeId The volume to retrieve layers for. + * @param {string} summaryId The ID for the layer to get the summary for. + * @param {string} contentVersion The content version for the requested volume. + * @param {string} source String to identify the originator of this request. + * @return {void} Successful response + */ + Books_layers_get(volumeId: string, summaryId: string, contentVersion: string | null | undefined, source: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'volumes/' + (volumeId == null ? '' : encodeURIComponent(volumeId)) + '/layersummary/' + (summaryId == null ? '' : encodeURIComponent(summaryId)) + '&contentVersion=' + (contentVersion == null ? '' : encodeURIComponent(contentVersion)) + '&source=' + (source == null ? '' : encodeURIComponent(source)), { observe: 'response', responseType: 'text' }); + } + } + + export enum Books_myconfig_requestAccessLicenseTypes { BOTH = 0, CONCURRENT = 1, DOWNLOAD = 2 } + + export enum Books_mylibrary_bookshelves_addVolumeReason { IOS_PREX = 0, IOS_SEARCH = 1, ONBOARDING = 2 } + + export enum Books_mylibrary_bookshelves_removeVolumeReason { ONBOARDING = 0 } + + export enum Books_mylibrary_bookshelves_volumes_listProjection { full = 0, lite = 1 } + + export enum Books_mylibrary_readingpositions_setPositionAction { bookmark = 0, chapter = 1, 'next-page' = 2, 'prev-page' = 3, scroll = 4, search = 5 } + + export enum Books_onboarding_listCategoryVolumesMaxAllowedMaturityRating { mature = 0, 'not-mature' = 1 } + + export enum Books_volumes_listDownload { epub = 0 } + + export enum Books_volumes_listFilter { ebooks = 0, 'free-ebooks' = 1, full = 2, 'paid-ebooks' = 3, partial = 4 } + + export enum Books_volumes_listLibraryRestrict { 'my-library' = 0, 'no-restrict' = 1 } + + export enum Books_volumes_listOrderBy { newest = 0, relevance = 1 } + + export enum Books_volumes_listPrintType { all = 0, books = 1, magazines = 2 } + + export enum Books_volumes_recommended_rateRating { HAVE_IT = 0, NOT_INTERESTED = 1 } + + export enum Books_volumes_associated_listAssociation { 'end-of-sample' = 0, 'end-of-volume' = 1, 'related-for-play' = 2 } + +} + diff --git a/Tests/SwagTsTests/NG2Results/mcp.txt b/Tests/SwagTsTests/NG2Results/mcp.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/mcp.txt rename to Tests/SwagTsTests/NG2Results/mcp.ts index 005ebec4..8501ff48 100644 --- a/Tests/SwagTsTests/NG2Results/mcp.txt +++ b/Tests/SwagTsTests/NG2Results/mcp.ts @@ -1,889 +1,889 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface BBSReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface ProviderType { - providerNumber: string; - } - - export interface BBSPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface PaymentRunType { - payerName?: string | null; - runDate?: Date | null; - runNumber?: string | null; - } - - export interface PaymentType { - accountInfo: BankAccountType; - depositAmount?: string | null; - paymentReference?: string | null; - } - - export interface BankAccountType { - accountName?: string | null; - accountNumber?: string | null; - bsbCode?: string | null; - } - - export interface ClaimSummaryType { - accountReferenceId?: string | null; - benefit?: string | null; - chargeAmount?: string | null; - claimChannelCode?: string | null; - claimId?: string | null; - lodgementDate?: Date | null; - transactionId?: string | null; - } - - export interface ServiceMessagesType { - highestSeverity: ServiceMessagesTypeHighestSeverity; - serviceMessage: Array; - } - - export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } - - export interface ServiceMessageType { - code: string; - severity: ServiceMessagesTypeHighestSeverity; - reason: string; - } - - export interface BBSProcessingReportResponseType { - claimAssessment?: ClaimAssessmentType; - status: string; - } - - export interface ClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface MedicalEventResponseType { - patient?: MembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface MembershipStatusType { - status?: StatusType; - currentMembership?: MembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface StatusType { - code?: number | null; - text?: string | null; - } - - export interface MembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - } - - export interface IdentityType { - dateOfBirth?: Date | null; - familyName?: string | null; - givenName?: string | null; - secondInitial?: string | null; - sex?: string | null; - } - - export interface ServiceResponseType { - error?: StatusType; - id?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface BulkBillStoreForwardRequestType { - claim: BulkBillClaimStoreForwardClaimType; - } - - export interface BulkBillClaimStoreForwardClaimType { - facilityId?: string | null; - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface BBSMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - medicalEventDate: Date; - medicalEventTime?: string | null; - patient: MedicarePatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface MedicarePatientType { - identity: IdentityType; - medicare: MembershipType; - } - - export interface ReferralType { - issueDate: Date; - period?: string | null; - periodCode?: string | null; - provider: ProviderType; - typeCode: string; - } - - export interface ServiceType { - id: string; - accessionDateTime?: Date | null; - aftercareOverrideInd?: string | null; - chargeAmount?: string | null; - collectionDateTime?: Date | null; - duplicateServiceOverrideInd?: string | null; - fieldQuantity?: string | null; - itemNumber?: string | null; - lspNumber?: string | null; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - restrictiveOverrideCode?: string | null; - rule3ExemptInd?: string | null; - s4b3ExemptInd?: string | null; - scpId?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - } - - export interface BulkBillStoreForwardResponseType { - claimId: string; - status: string; - } - - export interface AlliedHealthClaimRequestType { - claim: VAAClaimType; - } - - export interface VAAClaimType { - hospitalInd?: string | null; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - serviceTypeCode: string; - } - - export interface VAAMedicalEventType { - id: string; - acceptedDisability?: AcceptedDisabilityType; - authorisationDate: Date; - breakInEpisodeEndDate?: Date | null; - breakInEpisodeOfCareNumber?: string | null; - breakInEpisodeStartDate?: Date | null; - numberOfCNCHours?: string | null; - numberOfCNCVisits?: string | null; - createDateTime: Date; - numberOfENHours?: string | null; - numberOfENVisits?: string | null; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - numberOfNSSHours?: string | null; - numberOfNSSVisits?: string | null; - patient: VeteranPatientType; - referral?: ReferralType; - referralOverrideCode?: string | null; - numberOfRNHours?: string | null; - numberOfRNVisits?: string | null; - service: Array; - submissionAuthorityInd: string; - } - - export interface AcceptedDisabilityType { - code: string; - ind: string; - } - - export interface VAAServiceType { - id: string; - accountReferenceNumber?: string | null; - admissionDate?: Date | null; - chargeAmount?: string | null; - dischargeDate?: Date | null; - distanceKilometres?: number | null; - duplicateServiceOverrideInd?: string | null; - itemNumber: string; - multipleProcedureOverrideInd?: string | null; - numberOfPatientsSeen?: string | null; - numberOfTeeth?: string | null; - opticalScriptCode?: string | null; - restrictiveOverrideCode?: string | null; - secondDeviceInd?: string | null; - selfDeemedCode?: string | null; - text?: string | null; - timeDuration?: string | null; - toothNumber?: string | null; - upperLowerJawCode?: string | null; - } - - export interface VeteranPatientType extends PatientType { - veteranMembership?: VeteranMembershipType; - } - - export interface VeteranMembershipType { - veteranNumber: string; - } - - export interface PatientType { - identity: IdentityType; - residentialAddress?: AddressType; - } - - export interface AddressType { - addressLineOne?: string | null; - addressLineTwo?: string | null; - locality?: string | null; - postcode?: string | null; - } - - export interface AlliedHealthClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAClaimRequestType { - claim: DVAClaimType; - } - - export interface DVAClaimType { - hospitalInd?: string | null; - serviceTypeCode: string; - medicalEvent: Array; - serviceProvider: ProviderType; - payeeProvider?: ProviderType; - } - - export interface DVAMedicalEventType { - id: string; - authorisationDate: Date; - createDateTime: Date; - facilityId?: string | null; - medicalEventDate: Date; - medicalEventTime?: string | null; - referralOverrideCode?: string | null; - submissionAuthorityInd: string; - treatmentLocationCode?: string | null; - acceptedDisability?: AcceptedDisabilityType; - referral?: ReferralType; - patient: VeteranPatientType; - service: Array; - } - - export interface DVAServiceType extends ServiceType { - accountReferenceNumber?: string | null; - distanceKilometres?: number | null; - } - - export interface DVAClaimResponseType { - claimId: string; - status: string; - } - - export interface DVAReportRequestType { - payeeProvider: ProviderType; - claimId?: string | null; - lodgementDate?: Date | null; - } - - export interface DVAPaymentReportResponseType { - paymentRun?: PaymentRunType; - paymentInfo?: PaymentType; - claimSummary?: Array; - status: string; - } - - export interface DVAProcessingReportResponseType { - claimAssessment?: DVAClaimAssessmentType; - status: string; - } - - export interface DVAClaimAssessmentType { - medicalEvent?: Array; - serviceProvider?: ProviderType; - benefitPaid?: string | null; - chargeAmount?: string | null; - claimId?: string | null; - } - - export interface DVAMedicalEventAssessmentType { - patient?: VeteranMembershipStatusType; - service?: Array; - id?: string | null; - eventDate?: Date | null; - } - - export interface VeteranMembershipStatusType { - currentMembership?: VeteranMembershipResponseType; - currentMember?: IdentityType; - status?: StatusType; - processDate?: Date | null; - } - - export interface DVAServiceAssessmentType { - id?: string | null; - accountReferenceNumber?: string | null; - assessmentCode?: string | null; - benefitPaid?: string | null; - chargeAmount?: string | null; - gstInd?: string | null; - itemNumber?: string | null; - numberOfPatientsSeen?: string | null; - } - - export interface VeteranMembershipResponseType extends VeteranMembershipType { - entitlementCode?: string | null; - } - - export interface EnterpriseConcessionVerificationRequestType { - timeout?: number | null; - concessionVerificationRequest: Array; - } - - export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { - id: string; - } - - export interface ConcessionVerificationRequestType { - patient: MedicarePatientType; - dateOfService?: Date | null; - } - - export interface EnterpriseConcessionVerificationResponseType { - status: string; - concessionVerificationResponse?: Array; - } - - export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { - id: string; - } - - export interface ConcessionVerificationResponseType { - medicareStatus: MembershipStatusType; - concessionStatus: ConcessionStatusType; - } - - export interface ConcessionStatusType { - status?: StatusType; - processDate?: Date | null; - } - - export interface EnterprisePatientVerificationRequestType { - timeout?: number | null; - patientVerificationRequest: Array; - } - - export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { - id: string; - } - - export interface PatientVerificationRequestType { - patient: FundPatientType; - provider?: ProviderType; - dateOfService?: Date | null; - typeCode: string; - } - - export interface FundPatientType extends PatientType { - alsoKnownAs?: IdentityType; - medicare?: MembershipType; - healthFund?: FundMembershipType; - } - - export interface FundMembershipType { - memberNumber?: string | null; - memberRefNumber?: string | null; - organisation?: string | null; - } - - export interface EnterprisePatientVerificationResponseType { - status: string; - patientVerificationResponse?: Array; - } - - export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { - id: string; - } - - export interface PatientVerificationResponseType { - medicareStatus?: MembershipStatusType; - healthFundStatus?: FundMembershipStatusType; - } - - export interface FundMembershipStatusType { - status?: StatusType; - currentMembership?: FundMembershipType; - currentMember?: IdentityType; - processDate?: Date | null; - } - - export interface EnterpriseVeteranVerificationRequestType { - timeout?: number | null; - veteranVerificationRequest: Array; - } - - export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { - id: string; - } - - export interface VeteranVerificationRequestType { - patient: VeteranPatientType; - } - - export interface EnterpriseVeteranVerificationResponseType { - status: string; - veteranVerificationResponse?: Array; - } - - export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { - id?: string | null; - } - - export interface VeteranVerificationResponseType { - veteranStatus?: VeteranMembershipStatusType; - } - - export interface PatientClaimInteractiveRequestType { - patientClaimInteractive: PatientClaimInteractiveType; - } - - export interface PatientClaimInteractiveType { - patient: MedicarePatientType; - referral?: ReferralType; - claimant: ClaimantType; - medicalEvent: Array; - payeeProvider?: ProviderType; - serviceProvider: ProviderType; - referralOverrideCode?: string | null; - accountPaidInd: string; - accountReferenceId?: string | null; - submissionAuthorityInd: string; - authorisationDate: Date; - } - - export interface PCIMedicalEventType { - service: Array; - id: string; - medicalEventDate: Date; - medicalEventTime?: string | null; - } - - export interface PCIServiceType extends ServiceType { - patientContribAmount?: string | null; - facilityId?: string | null; - hospitalInd?: string | null; - } - - export interface ClaimantType extends MedicarePatientType { - eftDetails?: BankAccountType; - residentialAddress?: AddressType; - contactDetails?: ContactType; - } - - export interface ContactType { - emailAddress?: string | null; - name?: string | null; - phoneNumber?: string | null; - } - - export interface PatientClaimInteractiveResponseType { - claimAssessment: PCIAssessmentType; - status: string; - } - - export interface PCIAssessmentType { - claimant?: CurrentMembershipType; - patient?: CurrentMembershipType; - medicalEvent?: Array; - error?: StatusType; - claimId: string; - } - - export interface CurrentMembershipType { - currentMembership: MembershipType; - } - - export interface PCIMedicalEventResponseType { - service?: Array; - eventDate?: Date | null; - id?: string | null; - } - - export interface RetrieveReportRequestType { - transactionId: Array; - } - - export interface RetrieveReportResponseType { - content?: Array; - } - - export interface ContentType { - transactionId?: string | null; - status?: string | null; - } - - export interface EnterpriseConcessionVerificationReportContentType extends ContentType { - report?: EnterpriseConcessionVerificationResponseType; - } - - export interface EnterprisePatientVerificationReportContentType extends ContentType { - report?: EnterprisePatientVerificationResponseType; - } - - export interface EnterpriseVeteranVerificationReportContentType extends ContentType { - report?: EnterpriseVeteranVerificationResponseType; - } - - export interface SameDayDeleteRequestType { - sameDayDelete: SameDayDeleteType; - } - - export interface SameDayDeleteType { - patient: MedicarePatientType; - reasonCode: string; - } - - export interface SameDayDeleteResponseType { - status: string; - } - - export interface StatusReportRequestType { - transactionId?: Array; - associateName?: string | null; - fromDateTime?: Date | null; - toDateTime?: Date | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - status?: string | null; - } - - export interface StatusReportResponseType { - transactionStatus?: Array; - status: string; - } - - export interface TransactionStatusType { - associateName?: string | null; - lodgementDateTime?: Date | null; - processStatus?: string | null; - reference?: string | null; - reportStatus?: string | null; - requestTransmissionType?: string | null; - transactionId?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This is the request - * Post mcp/bulkbillpaymentreport/v1 - * @return {BBSPaymentReportResponseType} successful operation - */ - McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillprocessingreport/v1 - * @return {BBSProcessingReportResponseType} successful operation - */ - McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/general/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/pathology/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/bulkbillstoreforward/specialist/v1 - * @return {BulkBillStoreForwardResponseType} successful operation - */ - McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/allied/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/communitynursing/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/dental/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/optical/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/psych/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaalliedhealth/speechpathology/v1 - * @return {AlliedHealthClaimResponseType} successful operation - */ - McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaclaim/general/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaclaim/pathology/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaclaim/specialist/v1 - * @return {DVAClaimResponseType} successful operation - */ - McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvapaymentreport/v1 - * @return {DVAPaymentReportResponseType} successful operation - */ - McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/dvaprocessingreport/v1 - * @return {DVAProcessingReportResponseType} successful operation - */ - McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/v1 - * @return {EnterpriseConcessionVerificationResponseType} successful operation - */ - McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/v1 - * @return {EnterprisePatientVerificationResponseType} successful operation - */ - McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/v1 - * @return {EnterpriseVeteranVerificationResponseType} successful operation - */ - McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/general/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/pathology/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientclaiminteractive/specialist/v1 - * @return {PatientClaimInteractiveResponseType} successful operation - */ - McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientverification/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientverification/hf/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/patientverification/medicare/v1 - * @return {PatientVerificationResponseType} successful operation - */ - McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseconcessionverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterprisepatientverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/enterpriseveteranverification/retrievereport/v1 - * @return {RetrieveReportResponseType} successful operation - */ - McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/samedaydelete/v1 - * @return {SameDayDeleteResponseType} successful operation - */ - McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/statusreport/v1 - * @return {StatusReportResponseType} successful operation - */ - McpStatusReport1Eigw(requestBody: StatusReportRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This is the request - * Post mcp/veteranverification/v1 - * @return {VeteranVerificationResponseType} successful operation - */ - McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Observable { - return this.http.post(this.baseUri + 'mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface BBSReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface ProviderType { + providerNumber: string; + } + + export interface BBSPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface PaymentRunType { + payerName?: string | null; + runDate?: Date | null; + runNumber?: string | null; + } + + export interface PaymentType { + accountInfo: BankAccountType; + depositAmount?: string | null; + paymentReference?: string | null; + } + + export interface BankAccountType { + accountName?: string | null; + accountNumber?: string | null; + bsbCode?: string | null; + } + + export interface ClaimSummaryType { + accountReferenceId?: string | null; + benefit?: string | null; + chargeAmount?: string | null; + claimChannelCode?: string | null; + claimId?: string | null; + lodgementDate?: Date | null; + transactionId?: string | null; + } + + export interface ServiceMessagesType { + highestSeverity: ServiceMessagesTypeHighestSeverity; + serviceMessage: Array; + } + + export enum ServiceMessagesTypeHighestSeverity { Fatal = 0, Error = 1, Warning = 2, Informational = 3 } + + export interface ServiceMessageType { + code: string; + severity: ServiceMessagesTypeHighestSeverity; + reason: string; + } + + export interface BBSProcessingReportResponseType { + claimAssessment?: ClaimAssessmentType; + status: string; + } + + export interface ClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface MedicalEventResponseType { + patient?: MembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface MembershipStatusType { + status?: StatusType; + currentMembership?: MembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface StatusType { + code?: number | null; + text?: string | null; + } + + export interface MembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + } + + export interface IdentityType { + dateOfBirth?: Date | null; + familyName?: string | null; + givenName?: string | null; + secondInitial?: string | null; + sex?: string | null; + } + + export interface ServiceResponseType { + error?: StatusType; + id?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface BulkBillStoreForwardRequestType { + claim: BulkBillClaimStoreForwardClaimType; + } + + export interface BulkBillClaimStoreForwardClaimType { + facilityId?: string | null; + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface BBSMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + medicalEventDate: Date; + medicalEventTime?: string | null; + patient: MedicarePatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface MedicarePatientType { + identity: IdentityType; + medicare: MembershipType; + } + + export interface ReferralType { + issueDate: Date; + period?: string | null; + periodCode?: string | null; + provider: ProviderType; + typeCode: string; + } + + export interface ServiceType { + id: string; + accessionDateTime?: Date | null; + aftercareOverrideInd?: string | null; + chargeAmount?: string | null; + collectionDateTime?: Date | null; + duplicateServiceOverrideInd?: string | null; + fieldQuantity?: string | null; + itemNumber?: string | null; + lspNumber?: string | null; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + restrictiveOverrideCode?: string | null; + rule3ExemptInd?: string | null; + s4b3ExemptInd?: string | null; + scpId?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + } + + export interface BulkBillStoreForwardResponseType { + claimId: string; + status: string; + } + + export interface AlliedHealthClaimRequestType { + claim: VAAClaimType; + } + + export interface VAAClaimType { + hospitalInd?: string | null; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + serviceTypeCode: string; + } + + export interface VAAMedicalEventType { + id: string; + acceptedDisability?: AcceptedDisabilityType; + authorisationDate: Date; + breakInEpisodeEndDate?: Date | null; + breakInEpisodeOfCareNumber?: string | null; + breakInEpisodeStartDate?: Date | null; + numberOfCNCHours?: string | null; + numberOfCNCVisits?: string | null; + createDateTime: Date; + numberOfENHours?: string | null; + numberOfENVisits?: string | null; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + numberOfNSSHours?: string | null; + numberOfNSSVisits?: string | null; + patient: VeteranPatientType; + referral?: ReferralType; + referralOverrideCode?: string | null; + numberOfRNHours?: string | null; + numberOfRNVisits?: string | null; + service: Array; + submissionAuthorityInd: string; + } + + export interface AcceptedDisabilityType { + code: string; + ind: string; + } + + export interface VAAServiceType { + id: string; + accountReferenceNumber?: string | null; + admissionDate?: Date | null; + chargeAmount?: string | null; + dischargeDate?: Date | null; + distanceKilometres?: number | null; + duplicateServiceOverrideInd?: string | null; + itemNumber: string; + multipleProcedureOverrideInd?: string | null; + numberOfPatientsSeen?: string | null; + numberOfTeeth?: string | null; + opticalScriptCode?: string | null; + restrictiveOverrideCode?: string | null; + secondDeviceInd?: string | null; + selfDeemedCode?: string | null; + text?: string | null; + timeDuration?: string | null; + toothNumber?: string | null; + upperLowerJawCode?: string | null; + } + + export interface VeteranPatientType extends PatientType { + veteranMembership?: VeteranMembershipType; + } + + export interface VeteranMembershipType { + veteranNumber: string; + } + + export interface PatientType { + identity: IdentityType; + residentialAddress?: AddressType; + } + + export interface AddressType { + addressLineOne?: string | null; + addressLineTwo?: string | null; + locality?: string | null; + postcode?: string | null; + } + + export interface AlliedHealthClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAClaimRequestType { + claim: DVAClaimType; + } + + export interface DVAClaimType { + hospitalInd?: string | null; + serviceTypeCode: string; + medicalEvent: Array; + serviceProvider: ProviderType; + payeeProvider?: ProviderType; + } + + export interface DVAMedicalEventType { + id: string; + authorisationDate: Date; + createDateTime: Date; + facilityId?: string | null; + medicalEventDate: Date; + medicalEventTime?: string | null; + referralOverrideCode?: string | null; + submissionAuthorityInd: string; + treatmentLocationCode?: string | null; + acceptedDisability?: AcceptedDisabilityType; + referral?: ReferralType; + patient: VeteranPatientType; + service: Array; + } + + export interface DVAServiceType extends ServiceType { + accountReferenceNumber?: string | null; + distanceKilometres?: number | null; + } + + export interface DVAClaimResponseType { + claimId: string; + status: string; + } + + export interface DVAReportRequestType { + payeeProvider: ProviderType; + claimId?: string | null; + lodgementDate?: Date | null; + } + + export interface DVAPaymentReportResponseType { + paymentRun?: PaymentRunType; + paymentInfo?: PaymentType; + claimSummary?: Array; + status: string; + } + + export interface DVAProcessingReportResponseType { + claimAssessment?: DVAClaimAssessmentType; + status: string; + } + + export interface DVAClaimAssessmentType { + medicalEvent?: Array; + serviceProvider?: ProviderType; + benefitPaid?: string | null; + chargeAmount?: string | null; + claimId?: string | null; + } + + export interface DVAMedicalEventAssessmentType { + patient?: VeteranMembershipStatusType; + service?: Array; + id?: string | null; + eventDate?: Date | null; + } + + export interface VeteranMembershipStatusType { + currentMembership?: VeteranMembershipResponseType; + currentMember?: IdentityType; + status?: StatusType; + processDate?: Date | null; + } + + export interface DVAServiceAssessmentType { + id?: string | null; + accountReferenceNumber?: string | null; + assessmentCode?: string | null; + benefitPaid?: string | null; + chargeAmount?: string | null; + gstInd?: string | null; + itemNumber?: string | null; + numberOfPatientsSeen?: string | null; + } + + export interface VeteranMembershipResponseType extends VeteranMembershipType { + entitlementCode?: string | null; + } + + export interface EnterpriseConcessionVerificationRequestType { + timeout?: number | null; + concessionVerificationRequest: Array; + } + + export interface ReferenceConcessionVerificationRequestType extends ConcessionVerificationRequestType { + id: string; + } + + export interface ConcessionVerificationRequestType { + patient: MedicarePatientType; + dateOfService?: Date | null; + } + + export interface EnterpriseConcessionVerificationResponseType { + status: string; + concessionVerificationResponse?: Array; + } + + export interface ReferenceConcessionVerificationResponseType extends ConcessionVerificationResponseType { + id: string; + } + + export interface ConcessionVerificationResponseType { + medicareStatus: MembershipStatusType; + concessionStatus: ConcessionStatusType; + } + + export interface ConcessionStatusType { + status?: StatusType; + processDate?: Date | null; + } + + export interface EnterprisePatientVerificationRequestType { + timeout?: number | null; + patientVerificationRequest: Array; + } + + export interface ReferencePatientVerificationRequestType extends PatientVerificationRequestType { + id: string; + } + + export interface PatientVerificationRequestType { + patient: FundPatientType; + provider?: ProviderType; + dateOfService?: Date | null; + typeCode: string; + } + + export interface FundPatientType extends PatientType { + alsoKnownAs?: IdentityType; + medicare?: MembershipType; + healthFund?: FundMembershipType; + } + + export interface FundMembershipType { + memberNumber?: string | null; + memberRefNumber?: string | null; + organisation?: string | null; + } + + export interface EnterprisePatientVerificationResponseType { + status: string; + patientVerificationResponse?: Array; + } + + export interface ReferencePatientVerificationResponseType extends PatientVerificationResponseType { + id: string; + } + + export interface PatientVerificationResponseType { + medicareStatus?: MembershipStatusType; + healthFundStatus?: FundMembershipStatusType; + } + + export interface FundMembershipStatusType { + status?: StatusType; + currentMembership?: FundMembershipType; + currentMember?: IdentityType; + processDate?: Date | null; + } + + export interface EnterpriseVeteranVerificationRequestType { + timeout?: number | null; + veteranVerificationRequest: Array; + } + + export interface ReferenceVeteranVerificationRequestType extends VeteranVerificationRequestType { + id: string; + } + + export interface VeteranVerificationRequestType { + patient: VeteranPatientType; + } + + export interface EnterpriseVeteranVerificationResponseType { + status: string; + veteranVerificationResponse?: Array; + } + + export interface ReferenceVeteranVerificationResponseType extends VeteranVerificationResponseType { + id?: string | null; + } + + export interface VeteranVerificationResponseType { + veteranStatus?: VeteranMembershipStatusType; + } + + export interface PatientClaimInteractiveRequestType { + patientClaimInteractive: PatientClaimInteractiveType; + } + + export interface PatientClaimInteractiveType { + patient: MedicarePatientType; + referral?: ReferralType; + claimant: ClaimantType; + medicalEvent: Array; + payeeProvider?: ProviderType; + serviceProvider: ProviderType; + referralOverrideCode?: string | null; + accountPaidInd: string; + accountReferenceId?: string | null; + submissionAuthorityInd: string; + authorisationDate: Date; + } + + export interface PCIMedicalEventType { + service: Array; + id: string; + medicalEventDate: Date; + medicalEventTime?: string | null; + } + + export interface PCIServiceType extends ServiceType { + patientContribAmount?: string | null; + facilityId?: string | null; + hospitalInd?: string | null; + } + + export interface ClaimantType extends MedicarePatientType { + eftDetails?: BankAccountType; + residentialAddress?: AddressType; + contactDetails?: ContactType; + } + + export interface ContactType { + emailAddress?: string | null; + name?: string | null; + phoneNumber?: string | null; + } + + export interface PatientClaimInteractiveResponseType { + claimAssessment: PCIAssessmentType; + status: string; + } + + export interface PCIAssessmentType { + claimant?: CurrentMembershipType; + patient?: CurrentMembershipType; + medicalEvent?: Array; + error?: StatusType; + claimId: string; + } + + export interface CurrentMembershipType { + currentMembership: MembershipType; + } + + export interface PCIMedicalEventResponseType { + service?: Array; + eventDate?: Date | null; + id?: string | null; + } + + export interface RetrieveReportRequestType { + transactionId: Array; + } + + export interface RetrieveReportResponseType { + content?: Array; + } + + export interface ContentType { + transactionId?: string | null; + status?: string | null; + } + + export interface EnterpriseConcessionVerificationReportContentType extends ContentType { + report?: EnterpriseConcessionVerificationResponseType; + } + + export interface EnterprisePatientVerificationReportContentType extends ContentType { + report?: EnterprisePatientVerificationResponseType; + } + + export interface EnterpriseVeteranVerificationReportContentType extends ContentType { + report?: EnterpriseVeteranVerificationResponseType; + } + + export interface SameDayDeleteRequestType { + sameDayDelete: SameDayDeleteType; + } + + export interface SameDayDeleteType { + patient: MedicarePatientType; + reasonCode: string; + } + + export interface SameDayDeleteResponseType { + status: string; + } + + export interface StatusReportRequestType { + transactionId?: Array; + associateName?: string | null; + fromDateTime?: Date | null; + toDateTime?: Date | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + status?: string | null; + } + + export interface StatusReportResponseType { + transactionStatus?: Array; + status: string; + } + + export interface TransactionStatusType { + associateName?: string | null; + lodgementDateTime?: Date | null; + processStatus?: string | null; + reference?: string | null; + reportStatus?: string | null; + requestTransmissionType?: string | null; + transactionId?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This is the request + * Post mcp/bulkbillpaymentreport/v1 + * @return {BBSPaymentReportResponseType} successful operation + */ + McpBulkBillPaymentReport1Eigw(requestBody: BBSReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillpaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillprocessingreport/v1 + * @return {BBSProcessingReportResponseType} successful operation + */ + McpBulkBillProcessingReport1Eigw(requestBody: BBSReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/general/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardGeneral1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/pathology/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardPathology1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/bulkbillstoreforward/specialist/v1 + * @return {BulkBillStoreForwardResponseType} successful operation + */ + McpBulkBillStoreForwardSpecialist1Eigw(requestBody: BulkBillStoreForwardRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/bulkbillstoreforward/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/allied/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthAllied1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/allied/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/communitynursing/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthCommunityNursing1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/communitynursing/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/dental/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthDental1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/dental/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/optical/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthOptical1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/optical/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/psych/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthPsych1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/psych/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaalliedhealth/speechpathology/v1 + * @return {AlliedHealthClaimResponseType} successful operation + */ + McpDvaAlliedHealthSpeechPathology1Eigw(requestBody: AlliedHealthClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaalliedhealth/speechpathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaclaim/general/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimGeneral1Eigw(requestBody: DVAClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaclaim/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaclaim/pathology/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimPathology1Eigw(requestBody: DVAClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaclaim/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaclaim/specialist/v1 + * @return {DVAClaimResponseType} successful operation + */ + McpDvaClaimSpecialist1Eigw(requestBody: DVAClaimRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaclaim/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvapaymentreport/v1 + * @return {DVAPaymentReportResponseType} successful operation + */ + McpDvaPaymentReport1Eigw(requestBody: DVAReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvapaymentreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/dvaprocessingreport/v1 + * @return {DVAProcessingReportResponseType} successful operation + */ + McpDvaProcessingReport1Eigw(requestBody: DVAReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/dvaprocessingreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/v1 + * @return {EnterpriseConcessionVerificationResponseType} successful operation + */ + McpEnterpriseConcessionVerification1Eigw(requestBody: EnterpriseConcessionVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/v1 + * @return {EnterprisePatientVerificationResponseType} successful operation + */ + McpEnterprisePatientVerification1Eigw(requestBody: EnterprisePatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/v1 + * @return {EnterpriseVeteranVerificationResponseType} successful operation + */ + McpEnterpriseVeteranVerification1Eigw(requestBody: EnterpriseVeteranVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/general/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveGeneral1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/general/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/pathology/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractivePathology1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/pathology/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientclaiminteractive/specialist/v1 + * @return {PatientClaimInteractiveResponseType} successful operation + */ + McpPatientClaimInteractiveSpecialist1Eigw(requestBody: PatientClaimInteractiveRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientclaiminteractive/specialist/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientverification/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerification1Eigw(requestBody: PatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientverification/hf/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationHf1Eigw(requestBody: PatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientverification/hf/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/patientverification/medicare/v1 + * @return {PatientVerificationResponseType} successful operation + */ + McpPatientVerificationMedicare1Eigw(requestBody: PatientVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/patientverification/medicare/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseconcessionverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEcv1Eigw(requestBody: RetrieveReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseconcessionverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterprisepatientverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEpv1Eigw(requestBody: RetrieveReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterprisepatientverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/enterpriseveteranverification/retrievereport/v1 + * @return {RetrieveReportResponseType} successful operation + */ + McpRetrieveReportEvv1Eigw(requestBody: RetrieveReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/enterpriseveteranverification/retrievereport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/samedaydelete/v1 + * @return {SameDayDeleteResponseType} successful operation + */ + McpSameDayDelete1Eigw(requestBody: SameDayDeleteRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/samedaydelete/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/statusreport/v1 + * @return {StatusReportResponseType} successful operation + */ + McpStatusReport1Eigw(requestBody: StatusReportRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/statusreport/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This is the request + * Post mcp/veteranverification/v1 + * @return {VeteranVerificationResponseType} successful operation + */ + McpVeteranVerification1Eigw(requestBody: VeteranVerificationRequestType): Observable { + return this.http.post(this.baseUri + 'mcp/veteranverification/v1', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/redocOpenApi200501.txt b/Tests/SwagTsTests/NG2Results/redocOpenApi200501.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/redocOpenApi200501.txt rename to Tests/SwagTsTests/NG2Results/redocOpenApi200501.ts index a38ecc37..6facec9f 100644 --- a/Tests/SwagTsTests/NG2Results/redocOpenApi200501.txt +++ b/Tests/SwagTsTests/NG2Results/redocOpenApi200501.ts @@ -1,414 +1,414 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface ApiResponse { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - code?: number | null; - type?: string | null; - message?: string | null; - } - - - /** A representation of a cat */ - export interface Cat extends Pet { - - /** - * The measured skill for hunting - * Required - */ - huntingSkill: CatHuntingSkill; - } - - export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } - - export interface Category { - - /** Category ID */ - id?: string | null; - - /** - * Category name - * Min length: 1 - */ - name?: string | null; - - /** Test Sub Category */ - sub?: CategorySub; - } - - export interface CategorySub { - - /** Dumb Property */ - prop1?: string | null; - } - - - /** A representation of a dog */ - export interface Dog extends Pet { - - /** - * The size of the pack the dog is from - * Required - * Minimum: 1.0 - */ - packSize: number; - } - - - /** A representation of a honey bee */ - export interface HoneyBee extends Pet { - - /** - * Average amount of honey produced per day in ounces - * Required - * Type: double - */ - honeyPerDay: number; - } - - export interface Order { - - /** Order ID */ - id?: string | null; - - /** Pet ID */ - petId?: string | null; - - /** Minimum: 1.0 */ - quantity?: number | null; - - /** Estimated ship date */ - shipDate?: Date | null; - - /** Order Status */ - status?: OrderStatus | null; - - /** Indicates whenever order was completed or not */ - complete?: boolean | null; - - /** Unique Request Id */ - requestId?: string | null; - } - - export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } - - export interface Pet { - - /** Pet ID */ - id?: string | null; - - /** Categories this pet belongs to */ - category?: Category; - - /** - * The name given to a pet - * Required - */ - name: string; - - /** - * The list of URL to a cute photos featuring pet - * Required - * Maximum items: 20 - */ - photoUrls: Array; - friend?: Pet; - - /** - * Tags attached to the pet - * Minimum items: 1 - */ - tags?: Array; - - /** Pet status in the store */ - status?: PetStatus | null; - - /** Type of a pet */ - petType?: string | null; - } - - export interface Tag { - - /** Tag ID */ - id?: string | null; - - /** - * Tag name - * Min length: 1 - */ - name?: string | null; - } - - export enum PetStatus { available = 0, pending = 1, sold = 2 } - - export interface User { - - /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ - id?: string | null; - pet?: Pet; - - /** - * User supplied username - * Min length: 4 - */ - username?: string | null; - - /** - * User first name - * Min length: 1 - */ - firstName?: string | null; - - /** - * User last name - * Min length: 1 - */ - lastName?: string | null; - - /** User email address */ - email?: string | null; - - /** - * User password, MUST contain a mix of upper and lower case letters, as well as digits - * Min length: 8 - */ - password?: string | null; - - /** User phone number in international format */ - phone?: string | null; - - /** - * User status - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - userStatus?: number | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Add a new pet to the store - * Add new pet to the store inventory. - * Post pet - * @return {void} - */ - AddPet(): Observable> { - return this.http.post(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Update an existing pet - * Put pet - * @return {void} - */ - UpdatePet(): Observable> { - return this.http.put(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Find pet by ID - * Returns a single pet - * Get pet/{petId} - * @param {string} petId ID of pet to return - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {Pet} successful operation - */ - GetPetById(petId: string): Observable { - return this.http.get(this.baseUri + 'pet/' + petId, {}); - } - - /** - * Deletes a pet - * Delete pet/{petId} - * @param {string} petId Pet id to delete - * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 - * @return {void} - */ - DeletePet(petId: string): Observable> { - return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Get pet/findByStatus - * @param {Array} status Status values that need to be considered for filter - * Minimum items: 1 Maximum items: 3 - * @return {Array} successful operation - */ - FindPetsByStatus(status: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Get pet/findByTags - * @param {Array} tags Tags to filter by - * @return {Array} successful operation - */ - FindPetsByTags(tags: Array): Observable> { - return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Get store/inventory - * @return {{[id: string]: number }} successful operation - */ - GetInventory(): Observable<{[id: string]: number }> { - return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); - } - - /** - * Place an order for a pet - * Post store/order - * @param {Order} requestBody order placed for purchasing the pet - * @return {Order} successful operation - */ - PlaceOrder(requestBody: Order): Observable { - return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Get store/order/{orderId} - * @param {string} orderId ID of pet that needs to be fetched - * Minimum: 1.0 Maximum: 5.0 - * @return {Order} successful operation - */ - GetOrderById(orderId: string): Observable { - return this.http.get(this.baseUri + 'store/order/' + orderId, {}); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Delete store/order/{orderId} - * @param {string} orderId ID of the order that needs to be deleted - * Minimum: 1.0 - * @return {void} - */ - DeleteOrder(orderId: string): Observable> { - return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Subscribe to the Store events - * Add subscription for a store events - * Post store/subscribe - * @return {void} - */ - Subscribe(requestBody: SubscribePostBody): Observable> { - return this.http.post(this.baseUri + 'store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Create user - * This can only be done by the logged in user. - * Post user - * @param {User} requestBody Created user object - * @return {void} - */ - CreateUser(requestBody: User): Observable> { - return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Get user by user name - * Get user/{username} - * @param {string} username The name that needs to be fetched. Use user1 for testing. - * @return {User} successful operation - */ - GetUserByName(username: string): Observable { - return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); - } - - /** - * Updated user - * This can only be done by the logged in user. - * Put user/{username} - * @param {string} username name that need to be deleted - * @param {User} requestBody Updated user object - * @return {void} - */ - UpdateUser(username: string, requestBody: User): Observable> { - return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Delete user - * This can only be done by the logged in user. - * Delete user/{username} - * @param {string} username The name that needs to be deleted - * @return {void} - */ - DeleteUser(username: string): Observable> { - return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithArray - * @return {void} - */ - CreateUsersWithArrayInput(): Observable> { - return this.http.post(this.baseUri + 'user/createWithArray', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Creates list of users with given input array - * Post user/createWithList - * @return {void} - */ - CreateUsersWithListInput(): Observable> { - return this.http.post(this.baseUri + 'user/createWithList', null, { observe: 'response', responseType: 'text' }); - } - - /** - * Logs user into the system - * Get user/login - * @param {string} username The user name for login - * @param {string} password The password for login in clear text - * @return {string} successful operation - */ - LoginUser(username: string, password: string): Observable { - return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); - } - - /** - * Logs out current logged in user session - * Get user/logout - * @return {void} - */ - LogoutUser(): Observable> { - return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); - } - } - - export interface SubscribePostBody { - - /** - * This URL will be called by the server when the desired event will occur - * Required - */ - callbackUrl: string; - - /** - * Event name for the subscription - * Required - */ - eventName: SubscribePostBodyEventName; - } - - export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface ApiResponse { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + code?: number | null; + type?: string | null; + message?: string | null; + } + + + /** A representation of a cat */ + export interface Cat extends Pet { + + /** + * The measured skill for hunting + * Required + */ + huntingSkill: CatHuntingSkill; + } + + export enum CatHuntingSkill { clueless = 0, lazy = 1, adventurous = 2, aggressive = 3 } + + export interface Category { + + /** Category ID */ + id?: string | null; + + /** + * Category name + * Min length: 1 + */ + name?: string | null; + + /** Test Sub Category */ + sub?: CategorySub; + } + + export interface CategorySub { + + /** Dumb Property */ + prop1?: string | null; + } + + + /** A representation of a dog */ + export interface Dog extends Pet { + + /** + * The size of the pack the dog is from + * Required + * Minimum: 1.0 + */ + packSize: number; + } + + + /** A representation of a honey bee */ + export interface HoneyBee extends Pet { + + /** + * Average amount of honey produced per day in ounces + * Required + * Type: double + */ + honeyPerDay: number; + } + + export interface Order { + + /** Order ID */ + id?: string | null; + + /** Pet ID */ + petId?: string | null; + + /** Minimum: 1.0 */ + quantity?: number | null; + + /** Estimated ship date */ + shipDate?: Date | null; + + /** Order Status */ + status?: OrderStatus | null; + + /** Indicates whenever order was completed or not */ + complete?: boolean | null; + + /** Unique Request Id */ + requestId?: string | null; + } + + export enum OrderStatus { placed = 0, approved = 1, delivered = 2 } + + export interface Pet { + + /** Pet ID */ + id?: string | null; + + /** Categories this pet belongs to */ + category?: Category; + + /** + * The name given to a pet + * Required + */ + name: string; + + /** + * The list of URL to a cute photos featuring pet + * Required + * Maximum items: 20 + */ + photoUrls: Array; + friend?: Pet; + + /** + * Tags attached to the pet + * Minimum items: 1 + */ + tags?: Array; + + /** Pet status in the store */ + status?: PetStatus | null; + + /** Type of a pet */ + petType?: string | null; + } + + export interface Tag { + + /** Tag ID */ + id?: string | null; + + /** + * Tag name + * Min length: 1 + */ + name?: string | null; + } + + export enum PetStatus { available = 0, pending = 1, sold = 2 } + + export interface User { + + /** Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 */ + id?: string | null; + pet?: Pet; + + /** + * User supplied username + * Min length: 4 + */ + username?: string | null; + + /** + * User first name + * Min length: 1 + */ + firstName?: string | null; + + /** + * User last name + * Min length: 1 + */ + lastName?: string | null; + + /** User email address */ + email?: string | null; + + /** + * User password, MUST contain a mix of upper and lower case letters, as well as digits + * Min length: 8 + */ + password?: string | null; + + /** User phone number in international format */ + phone?: string | null; + + /** + * User status + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + userStatus?: number | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Add a new pet to the store + * Add new pet to the store inventory. + * Post pet + * @return {void} + */ + AddPet(): Observable> { + return this.http.post(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Update an existing pet + * Put pet + * @return {void} + */ + UpdatePet(): Observable> { + return this.http.put(this.baseUri + 'pet', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Find pet by ID + * Returns a single pet + * Get pet/{petId} + * @param {string} petId ID of pet to return + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {Pet} successful operation + */ + GetPetById(petId: string): Observable { + return this.http.get(this.baseUri + 'pet/' + petId, {}); + } + + /** + * Deletes a pet + * Delete pet/{petId} + * @param {string} petId Pet id to delete + * Type: long, -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 + * @return {void} + */ + DeletePet(petId: string): Observable> { + return this.http.delete(this.baseUri + 'pet/' + petId, { observe: 'response', responseType: 'text' }); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * Get pet/findByStatus + * @param {Array} status Status values that need to be considered for filter + * Minimum items: 1 Maximum items: 3 + * @return {Array} successful operation + */ + FindPetsByStatus(status: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByStatus?' + status.map(z => `status=${z}`).join('&'), {}); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Get pet/findByTags + * @param {Array} tags Tags to filter by + * @return {Array} successful operation + */ + FindPetsByTags(tags: Array): Observable> { + return this.http.get>(this.baseUri + 'pet/findByTags?' + tags.map(z => `tags=${encodeURIComponent(z)}`).join('&'), {}); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * Get store/inventory + * @return {{[id: string]: number }} successful operation + */ + GetInventory(): Observable<{[id: string]: number }> { + return this.http.get<{[id: string]: number }>(this.baseUri + 'store/inventory', {}); + } + + /** + * Place an order for a pet + * Post store/order + * @param {Order} requestBody order placed for purchasing the pet + * @return {Order} successful operation + */ + PlaceOrder(requestBody: Order): Observable { + return this.http.post(this.baseUri + 'store/order', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Get store/order/{orderId} + * @param {string} orderId ID of pet that needs to be fetched + * Minimum: 1.0 Maximum: 5.0 + * @return {Order} successful operation + */ + GetOrderById(orderId: string): Observable { + return this.http.get(this.baseUri + 'store/order/' + orderId, {}); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete store/order/{orderId} + * @param {string} orderId ID of the order that needs to be deleted + * Minimum: 1.0 + * @return {void} + */ + DeleteOrder(orderId: string): Observable> { + return this.http.delete(this.baseUri + 'store/order/' + (orderId == null ? '' : encodeURIComponent(orderId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Subscribe to the Store events + * Add subscription for a store events + * Post store/subscribe + * @return {void} + */ + Subscribe(requestBody: SubscribePostBody): Observable> { + return this.http.post(this.baseUri + 'store/subscribe', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Create user + * This can only be done by the logged in user. + * Post user + * @param {User} requestBody Created user object + * @return {void} + */ + CreateUser(requestBody: User): Observable> { + return this.http.post(this.baseUri + 'user', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Get user by user name + * Get user/{username} + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @return {User} successful operation + */ + GetUserByName(username: string): Observable { + return this.http.get(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), {}); + } + + /** + * Updated user + * This can only be done by the logged in user. + * Put user/{username} + * @param {string} username name that need to be deleted + * @param {User} requestBody Updated user object + * @return {void} + */ + UpdateUser(username: string, requestBody: User): Observable> { + return this.http.put(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Delete user + * This can only be done by the logged in user. + * Delete user/{username} + * @param {string} username The name that needs to be deleted + * @return {void} + */ + DeleteUser(username: string): Observable> { + return this.http.delete(this.baseUri + 'user/' + (username == null ? '' : encodeURIComponent(username)), { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithArray + * @return {void} + */ + CreateUsersWithArrayInput(): Observable> { + return this.http.post(this.baseUri + 'user/createWithArray', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Creates list of users with given input array + * Post user/createWithList + * @return {void} + */ + CreateUsersWithListInput(): Observable> { + return this.http.post(this.baseUri + 'user/createWithList', null, { observe: 'response', responseType: 'text' }); + } + + /** + * Logs user into the system + * Get user/login + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @return {string} successful operation + */ + LoginUser(username: string, password: string): Observable { + return this.http.get(this.baseUri + 'user/login?username=' + (username == null ? '' : encodeURIComponent(username)) + '&password=' + (password == null ? '' : encodeURIComponent(password)), { responseType: 'text' }); + } + + /** + * Logs out current logged in user session + * Get user/logout + * @return {void} + */ + LogoutUser(): Observable> { + return this.http.get(this.baseUri + 'user/logout', { observe: 'response', responseType: 'text' }); + } + } + + export interface SubscribePostBody { + + /** + * This URL will be called by the server when the desired event will occur + * Required + */ + callbackUrl: string; + + /** + * Event name for the subscription + * Required + */ + eventName: SubscribePostBodyEventName; + } + + export enum SubscribePostBodyEventName { orderInProgress = 0, orderShipped = 1, orderDelivered = 2 } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_account.txt b/Tests/SwagTsTests/NG2Results/sell_account.ts similarity index 99% rename from Tests/SwagTsTests/NG2Results/sell_account.txt rename to Tests/SwagTsTests/NG2Results/sell_account.ts index bb2fb918..cfed0b6a 100644 --- a/Tests/SwagTsTests/NG2Results/sell_account.txt +++ b/Tests/SwagTsTests/NG2Results/sell_account.ts @@ -1,1121 +1,1121 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ - export interface CategoryType { - - /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ - default?: boolean | null; - - /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ - name?: string | null; - } - - - /** A container that describes the details of a deposit. Used only with motor listings. */ - export interface Deposit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - dueIn?: TimeDuration; - - /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ - paymentMethods?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ - export interface PaymentMethod { - - /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ - brands?: Array; - - /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ - paymentMethodType?: string | null; - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - recipientAccountReference?: RecipientAccountReference; - } - - - /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ - export interface RecipientAccountReference { - - /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ - referenceId?: string | null; - - /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ - referenceType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface FulfillmentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ - export interface ShippingOption { - - /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ - costType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - insuranceFee?: Amount; - - /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ - insuranceOffered?: boolean | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ - optionType?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - packageHandlingCost?: Amount; - - /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ - rateTableId?: string | null; - - /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ - shippingServices?: Array; - } - - - /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ - export interface ShippingService { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalShippingCost?: Amount; - - /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForPickup?: boolean | null; - - /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ - buyerResponsibleForShipping?: boolean | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - cashOnDeliveryFee?: Amount; - - /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ - freeShipping?: boolean | null; - - /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ - shippingCarrierCode?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - shippingCost?: Amount; - - /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ - shippingServiceCode?: string | null; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** - * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - sortOrder?: number | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - surcharge?: Amount; - } - - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - export interface RegionSet { - - /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ - regionExcluded?: Array; - - /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ - regionIncluded?: Array; - } - - - /** This type defines information for a region. */ - export interface Region { - - /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ - regionName?: string | null; - - /** Reserved for future use. For implementation help, refer to eBay API documentation */ - regionType?: string | null; - } - - - /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface FulfillmentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. Default: false */ - freightShipping?: boolean | null; - - /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - } - - - /** The response payload for requests that return a list of fulfillment policies. */ - export interface FulfillmentPolicyResponse { - - /** A list of the seller's fulfillment policies. */ - fulfillmentPolicies?: Array; - - /** Returns a URL link to the result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - export interface InternationalReturnOverrideType { - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ - returnsAccepted?: boolean | null; - - /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface PaymentPolicy { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - } - - - /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface PaymentPolicyRequest { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - } - - - /** The response payload for payment policy requests. */ - export interface PaymentPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** A list of the seller's payment policies. */ - paymentPolicies?: Array; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object containing the sellers status with regards to the specified payment program. */ - export interface PaymentsProgramResponse { - - /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ - paymentsProgramType?: string | null; - - /** For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ - wasPreviouslyOptedIn?: boolean | null; - } - - - /** A seller program in to which a seller can opt-in. */ - export interface Program { - - /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ - programType?: string | null; - } - - - /** A list of the supported seller programs. */ - export interface Programs { - - /** A list of seller programs. */ - programs?: Array; - } - - - /** A complex type that contains information pertaining to a shipping rate table. */ - export interface RateTable { - - /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ - locality?: string | null; - - /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ - name?: string | null; - - /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ - rateTableId?: string | null; - } - - - /** The response container for with information on a seller's shipping rate tables. */ - export interface RateTableResponse { - - /** A list of elements that provide information on the seller-defined shipping rate tables. */ - rateTables?: Array; - } - - - /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ - export interface ReturnPolicy { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ - export interface ReturnPolicyRequest { - - /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ - restockingFeePercentage?: string | null; - - /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ - returnInstructions?: string | null; - - /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ - returnsAccepted?: boolean | null; - - /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - } - - - /** The response payload for return policy requests. */ - export interface ReturnPolicyResponse { - - /** Returns a URL link to the current result set. */ - href?: string | null; - - /** - * Returns the maximum number of results that can be returned in result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a URL link to the next set of results. */ - next?: string | null; - - /** - * Returns how many result sets were skipped before the currently returned result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** Returns a URL link to the previous set of results. */ - prev?: string | null; - - /** A list of the seller's return policies. */ - returnPolicies?: Array; - - /** - * Returns the total number of result sets in the paginated collection. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ - export interface SalesTax { - - /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ - salesTaxJurisdictionId?: string | null; - - /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A container that describes the how the sales tax rate is calculated. */ - export interface SalesTaxBase { - - /** The sales tax rate, as a percentage of the sale. */ - salesTaxPercentage?: string | null; - - /** If set to true, shipping and handling charges are taxed. */ - shippingAndHandlingTaxed?: boolean | null; - } - - - /** A list of sales tax tables. */ - export interface SalesTaxes { - - /** A list of sales tax tables that have been set up by a seller. */ - salesTaxes?: Array; - } - - - /** Defines the selling limit applied to an eBay seller's account. */ - export interface SellingLimit { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - amount?: Amount; - - /** - * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A merchant's selling limit, and the status of their account registration. */ - export interface SellingPrivileges { - - /** If set to true, the seller's registration is completed. */ - sellerRegistrationCompleted?: boolean | null; - - /** Defines the selling limit applied to an eBay seller's account. */ - sellingLimit?: SellingLimit; - } - - - /** Complex type that that gets populated with a response containing a fulfillment policy. */ - export interface SetFulfillmentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ - description?: string | null; - - /** If set to true, the seller offers freight shipping. */ - freightShipping?: boolean | null; - - /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ - fulfillmentPolicyId?: string | null; - - /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ - globalShipping?: boolean | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - handlingTime?: TimeDuration; - - /** If set to true, the seller offers local pickup of their items. */ - localPickup?: boolean | null; - - /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ - pickupDropOff?: boolean | null; - - /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ - shippingOptions?: Array; - - /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ - shipToLocations?: RegionSet; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** Complex type that that gets populated with a response containing a payment policy. */ - export interface SetPaymentPolicyResponse { - - /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ - categoryTypes?: Array; - - /** A container that describes the details of a deposit. Used only with motor listings. */ - deposit?: Deposit; - - /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - fullPaymentDueIn?: TimeDuration; - - /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ - immediatePay?: boolean | null; - - /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ - paymentInstructions?: string | null; - - /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ - paymentMethods?: Array; - - /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ - paymentPolicyId?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - - /** Complex type that that gets populated with a response containing a return policy. */ - export interface SetReturnPolicyResponse { - - /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ - categoryTypes?: Array; - - /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ - description?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ - extendedHolidayReturnsOffered?: boolean | null; - - /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ - internationalOverride?: InternationalReturnOverrideType; - - /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ - name?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ - refundMethod?: string | null; - - /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ - restockingFeePercentage?: string | null; - - /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ - returnInstructions?: string | null; - - /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ - returnMethod?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - returnPeriod?: TimeDuration; - - /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ - returnPolicyId?: string | null; - - /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ - returnsAccepted?: boolean | null; - - /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ - returnShippingCostPayer?: string | null; - - /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ - warnings?: Array; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {FulfillmentPolicyResponse} Success - */ - GetFulfillmentPolicies(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - - /** - * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post fulfillment_policy/ - * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. - * @return {void} - */ - CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Observable> { - return this.http.post(this.baseUri + 'fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. - * Get fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicy(fulfillmentPolicyId: string): Observable { - return this.http.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}); - } - - /** - * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. - * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request - * @return {SetFulfillmentPolicyResponse} OK - */ - UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Observable { - return this.http.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. - * Delete fulfillment_policy/{fulfillmentPolicyId} - * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. - * @return {void} - */ - DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Observable> { - return this.http.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get fulfillment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. - * @return {FulfillmentPolicy} Success - */ - GetFulfillmentPolicyByName(marketplace_id: string, name: string): Observable { - return this.http.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); - } - - /** - * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/ - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {PaymentPolicyResponse} Success - */ - GetPaymentPolicies(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - - /** - * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post payment_policy/ - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {void} - */ - CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Observable> { - return this.http.post(this.baseUri + 'payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. - * Get payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicy(payment_policy_id: string): Observable { - return this.http.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}); - } - - /** - * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. - * @param {PaymentPolicyRequest} requestBody Payment policy request - * @return {SetPaymentPolicyResponse} OK - */ - UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Observable { - return this.http.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. - * Delete payment_policy/{payment_policy_id} - * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. - * @return {void} - */ - DeletePaymentPolicy(payment_policy_id: string): Observable> { - return this.http.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get payment_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. - * @return {PaymentPolicy} Success - */ - GetPaymentPolicyByName(marketplace_id: string, name: string): Observable { - return this.http.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); - } - - /** - * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. - * Get payments_program/{marketplace_id}/{payments_program_type} - * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. - * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. - * @return {PaymentsProgramResponse} Success - */ - GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Observable { - return this.http.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}); - } - - /** - * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). - * Get privilege/ - * @return {SellingPrivileges} Success - */ - GetPrivileges(): Observable { - return this.http.get(this.baseUri + 'privilege/', {}); - } - - /** - * This method gets a list of the seller programs that the seller has opted-in to. - * Get program/get_opted_in_programs - * @return {Programs} Success - */ - GetOptedInPrograms(): Observable { - return this.http.get(this.baseUri + 'program/get_opted_in_programs', {}); - } - - /** - * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. - * Post program/opt_in - * @param {Program} requestBody Program being opted-in to. - * @return {string} Success - */ - OptInToProgram(requestBody: Program): Observable { - return this.http.post(this.baseUri + 'program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. - * Post program/opt_out - * @param {Program} requestBody Program being opted-out of. - * @return {string} Success - */ - OptOutOfProgram(requestBody: Program): Observable { - return this.http.post(this.baseUri + 'program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. - * Get rate_table/ - * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {RateTableResponse} Success - */ - GetRateTables(country_code: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); - } - - /** - * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/ - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - - /** - * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. - * Post return_policy/ - * @param {ReturnPolicyRequest} requestBody Return policy request - * @return {void} - */ - CreateReturnPolicy(requestBody: ReturnPolicyRequest): Observable> { - return this.http.post(this.baseUri + 'return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. - * Get return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicy(return_policy_id: string): Observable { - return this.http.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}); - } - - /** - * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. - * Put return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. - * @param {ReturnPolicyRequest} requestBody Container for a return policy request. - * @return {SetReturnPolicyResponse} OK - */ - UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Observable { - return this.http.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. - * Delete return_policy/{return_policy_id} - * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. - * @return {void} - */ - DeleteReturnPolicy(return_policy_id: string): Observable> { - return this.http.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. - * Get return_policy/get_by_policy_name - * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html - * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. - * @return {ReturnPolicy} Success - */ - GetReturnPolicyByName(marketplace_id: string, name: string): Observable { - return this.http.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); - } - - /** - * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. - * Get sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. - * @return {SalesTax} Success - */ - GetSalesTax(countryCode: string, jurisdictionId: string): Observable { - return this.http.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}); - } - - /** - * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. - * Put sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. - * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. - * @return {void} - */ - CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Observable> { - return this.http.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. - * Delete sales_tax/{countryCode}/{jurisdictionId} - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. - * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. - * @return {void} - */ - DeleteSalesTax(countryCode: string, jurisdictionId: string): Observable> { - return this.http.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { observe: 'response', responseType: 'text' }); - } - - /** - * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. - * Get sales_tax/ - * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html - * @return {SalesTaxes} Success - */ - GetSalesTaxes(country_code: string): Observable { - return this.http.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** The category type discerns whether the policy covers the sale of motor vehicles (via eBay Motors), or the sale of everything except motor vehicles. Each business policy can be associated with either or both categories ('MOTORS_VEHICLES' and 'ALL_EXCLUDING_MOTORS_VEHICLES'); however,the 'MOTORS_VEHICLES' category type is not valid for return policies–return policies cannot be used with motor vehicle listings. */ + export interface CategoryType { + + /** Sellers can create multiple policies for any marketplaceId and categoryTypes.name combination. For example, you can create multiple fulfillment policies for one marketplace, where they all target the same category type name. However, only one policy can be the default for any marketplaceId and name combination, and eBay designates the first policy created for a combination as the default. If set to true, this policy is the default policy for the associated categoryTypes.name and marketplaceId pair. Note: eBay considers the status of this field only when you create listings through the Web flow. If you create listings using the APIs, you must specifically set the policies you want applied to a listing in the payload of the call you use to create the listing. If you use the Web flow to create item listings, eBay uses the default policy for the marketplace and category type specified, unless you override the default. For more on default policies, see Changing the default policy for a category type. */ + default?: boolean | null; + + /** The category type to which the policy applies (motor vehicles or non-motor vehicles). Note for return policies: The 'MOTORS_VEHICLES' category type is not valid for return policies because eBay flows do not support the return of motor vehicles. For implementation help, refer to eBay API documentation */ + name?: string | null; + } + + + /** A container that describes the details of a deposit. Used only with motor listings. */ + export interface Deposit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + dueIn?: TimeDuration; + + /** A list of accepted payment methods. For deposits (which are applicable to only motor listings), the paymentMethodType must be set to 'PayPal' */ + paymentMethods?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** Required in the TimeDuration container. A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The unit is applied to the number in the value field to define a span of time. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * Required in the TimeDuration container. An amount of time, as measured by the time-measurement units specified in the unit field. Supported values for this field vary according to the object using the time duration. See the containing object for details and call GeteBayDetails in the Trading API to get the allowable values for the specific object you're configuring. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** Container specifying a payment method that is accepted by the seller. Specify multiple payment methods by repeating this container. For more on payment methods, see Accepted payments policy. Note that payment methods are not applicable to classified ad listings – all classified ad payments are handled off of the eBay platform. */ + export interface PaymentMethod { + + /** Required if paymentMethodType is set to CREDIT_CARD. A list of credit card brands accepted by the seller. It's important to note that the credit card brands Visa and MasterCard must both be listed if either one is listed, as is shown in the following code fragment: "paymentMethods": [{ "brands": [VISA, MASTERCARD] }] ... Note: Different eBay marketplaces may or may not support this field. Use the Trading API GetCategoryFeatures call with FeatureID set to PaymentMethods and DetailLevel set to ReturnAll to see what credit card brands different marketplaces support. If the GetCategoryFeatures call returns details on credit card brands for the categories in which you sell, then you can use this field to list the credit card brands the seller accepts. If, on the other hand, GetCategoryFeatures does not enumerate credit card brands for your target site (for example, if it returns PaymentMethod set to CCAccepted), then you cannot enumerate specific credit card brands with this field for that marketplace. */ + brands?: Array; + + /** The payment method, selected from the supported payment method types. Use GetCategoryFeatures in the Trading API to retrieve the payment methods allowed for a category on a specific marketplace, as well as the default payment method for that marketplace (review the SiteDefaults.PaymentMethod field). For example, the response from GetCategoryFeatures shows that on the US marketplace, most categories allow only electronic payments via credit cards, PayPal, and the like. Also, note that GeteBayDetails does not return payment method information. Note: If you create item listings using the Inventory API, you must set this field to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items where the only supported paymentMethod is PayPal). For implementation help, refer to eBay API documentation */ + paymentMethodType?: string | null; + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + recipientAccountReference?: RecipientAccountReference; + } + + + /** Recipient account information, like PayPal email. If the payment method is PayPal, this structure contains the recipient's PayPal email address. */ + export interface RecipientAccountReference { + + /** Contains the PayPal email address of the recipient (buyer) if referenceType is set to PAYPAL_EMAIL. */ + referenceId?: string | null; + + /** A reference a recipient's account. Currently only PAYPAL_EMAIL is valid. For implementation help, refer to eBay API documentation */ + referenceType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. fulfillmentPolicy encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface FulfillmentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for the fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** This complex type defines a seller's shipping configuration for either a DOMESTIC or INTERNATIONAL shipping option. Shipping options configure the high-level settings for shipments, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the policy. Each shippingOption element has a shippingServices container that defines the list of shipping carriers and services that are available for the parent shipping option (that is, for either DOMESTIC or INTERNATIONAL shipping). If a seller offers an international shipping option, they must also offer a domestic shipping option. Note that costType (FLAT_RATE or CALCULATED) is set in shippingOptions and that all associated shipping services must be able to support this cost type. */ + export interface ShippingOption { + + /** Required if the policy offers shipping options using a shippingOptions container. Defines whether the shipping cost is FLAT_RATE, CALCULATED, or NOT_SPECIFIED (for use with freight shipping and local pickup). For implementation help, refer to eBay API documentation */ + costType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + insuranceFee?: Amount; + + /** If set to true, the seller offers buyer-paid shipping insurance. The optionType shows whether this is for either a domestic or international shipment. Buyer-paid shipping insurance is currently supported in only Australia (AU), France (FR), and Italy (IT). */ + insuranceOffered?: boolean | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Use this field to set the ShippingOption element to either DOMESTIC or INTERNATIONAL. For implementation help, refer to eBay API documentation */ + optionType?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + packageHandlingCost?: Amount; + + /** A unique eBay-assigned ID associated with a user-created shipping rate table. The locality of a shipping rate table can be either DOMESTIC or INTERNATIONAL and you must ensure the value specified in this field references a shipping rate table that matches the type specified in the shippingOptions.optionType field. If you mismatch the types, eBay responds with a 20403 error. Call getRateTable to retrieve information (including rateTableId values) on the rate tables configured by a seller. For information on creating rate tables, see Using shipping rate tables. */ + rateTableId?: string | null; + + /** Required if the policy offers shipping options using a shippingOptions container. Contains a list of shipping services offered for either DOMESTIC or INTERNATIONAL shipments. Sellers can specify up to four domestic shipping services and up to five international shipping services by using separate shippingService containers for each. Note that if the seller is opted in to the Global Shipping Program, they can specify only four other international shipping services, regardless of whether or not Global Shipping is offered as one of the services. */ + shippingServices?: Array; + } + + + /** A complex type that defines the available shipping services offered in the parent shippingOptions container. The shipping services specified here must be able to accommodate the optionType defined in the parent shippingOption container (either DOMESTIC or INTERNATIONAL). Tip: For more on setting up shipping services, see Setting the shipping carrier and shipping service values. */ + export interface ShippingService { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalShippingCost?: Amount; + + /** This field is only applicable to vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for picking up the vehicle. Otherwise, the seller should specify the vehicle pickup arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForPickup?: boolean | null; + + /** This field is applicable for only items listed in vehicle categories on eBay Motors (US and Canada). If set to true, the buyer is responsible for the shipment of the vehicle. Otherwise, the seller should specify the vehicle shipping arrangements in the item description. The seller cannot modify this flag if the vehicle has bids or if the listing ends within 12 hours. Default: false */ + buyerResponsibleForShipping?: boolean | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + cashOnDeliveryFee?: Amount; + + /** If set to true, the seller offers free shipping to the buyer. This field can only be included and set to 'true' for the first domestic shipping service option specified in the shippingServices container (it is ignored if set for subsequent shipping services). The first specified shipping service option has a sortOrder value of 1 or (if the sortOrderId field is not used) it is the shipping service option that's specified first in the shippingServices container. */ + freeShipping?: boolean | null; + + /** The shipping carrier, such as 'USPS', 'FedEx', 'UPS', and so on. */ + shippingCarrierCode?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + shippingCost?: Amount; + + /** The shipping service that the shipping carrier uses to ship an item. For example, an overnight, two-day delivery, or other type of service. For details on configuring shipping services, see Setting the shipping carrier and shipping service values. */ + shippingServiceCode?: string | null; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** + * This integer value controls the order that this shipping service option appears in the View Item and Checkout pages, as related to the other specified shipping service options. Sellers can specify up to four domestic shipping services (in four separate shippingService containers), so valid values are 1, 2, 3, and 4. A shipping service option with a sortOrder value of '1' appears at the top of View Item and Checkout pages. Conversely, a shipping service option with a sortOrder value of '4' appears at the bottom of the list. Sellers can specify up to five international shipping services (in five separate shippingService containers, so valid values for international shipping services are 1, 2, 3, 4, and 5. Similarly to domestic shipping service options, the sortOrder value of a international shipping service option controls the placement of that shipping service option in the View Item and Checkout pages. Set up different domestic and international services by configuring two shippingOptions containers, where you set shippingOptions.optionType to either DOMESTIC or INTERNATIONAL to indicate the area supported by the listed shipping services. If the sortOrder field is not supplied, the order of domestic and international shipping service options is determined by the order in which they are listed in the API call. Min: 1. Max: 4 (for domestic shipping service) or 5 (for international shipping service). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + sortOrder?: number | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + surcharge?: Amount; + } + + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + export interface RegionSet { + + /** A list of one or more regionsName fields that specify the areas to where a seller does not ship. Populate regionExcluded in only the top-level shipToLocations container (do not populate this field within the shippingOptions container). Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options and they don't have a need to exclude any regions from their ship-to locations. With this, there's no reason to set regionExclude fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's located within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region, from the larger world area they ship to. To retrieve the regions you can specify in the associated regionName field, call GeteBayDetails with DetailName set to ExcludeShippingLocationDetails, then review the Location fields in the response for the strings that you can specify regionExcluded.regionName. Note that if a buyer's primary ship-to location is a region that a seller has excluded in their fulfillment policy (or if the buyer does not have a primary ship-to location), they will receive an error message if they attempt to buy or place a bid on an item that uses that fulfillment policy. For details on setting this field, see Excluding specific regions from included shipping areas. */ + regionExcluded?: Array; + + /** Required if optionType set to INTERNATIONAL. A list of one or more regionsName fields that specify the areas to where a seller ships. Important: Populate this field only when the parent shipToLocations object is located within a shippingOptions container (that is, the parent shipTolocations object must not be the one at the top-level of the policy). Also, this field needs to be populated only when the associated shippingOptions container has optionType set to INTERNATIONAL. Withing an international shipping option, set this value to Worldwide to indicate the seller ships to all world regions. If needed, use the regionExcluded field to exclude any regions in the world to where the seller does not ship. Each eBay marketplace supports its own set of allowable shipping locations. Obtain the valid 'Ship-To Locations' for a marketplace by calling GeteBayDetails with DetailName set to ShippingLocationDetails, then review the ShippingLocation fields in the response for the strings that you can specify in the regionIncluded.regionName field. For DOMESTIC shipping options, eBay automatically uses the seller's listing country as the default regionIncluded country. For details on setting this field, see How to set up worldwide shipping. This field is always returned in the shipping policy response. */ + regionIncluded?: Array; + } + + + /** This type defines information for a region. */ + export interface Region { + + /** A string that indicates the name of a region, as defined by eBay. A "region" can be either a 'world region' (e.g., the "Middle East" or "Southeast Asia") or a country, as represented with a two-letter country code. Use GeteBayDetails to get the values accepted by this field. The values that you're allowed to use for a specific regionName field depend on the context in which you are setting the value. For details on how to set the values for this field, see The shipToLocations container. */ + regionName?: string | null; + + /** Reserved for future use. For implementation help, refer to eBay API documentation */ + regionType?: string | null; + } + + + /** This root container defines a seller's fulfillment policy for a specific marketplace and category type. Used when creating or updating a fulfillment policy, fulfillmentPolicyRequest encapsulates a seller's terms for fulfilling an order and includes the shipping carriers and services used for shipment and time the seller takes to ship an order. While each seller must define at least one fulfillment policy for every marketplace into which they sell, sellers can define multiple fulfillment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a fulfillmentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface FulfillmentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. Default: false */ + freightShipping?: boolean | null; + + /** If set to true, the seller has opted-in to the eBay Global Shipping Program and that they use that service for their international shipments. Setting this value automatically sets the international shipping service for the policy to International Priority Shipping and the buyer does not need to set any other shipping services for their INTERNATIONAL shipping options (unless they sell items not covered by the Global Shipping Program). If this value is set to false, the seller is responsible for manually specifying the international shipping services, as described in Setting up worldwide shipping. To opt-in to the Global Shipping Program, log in to eBay and navigate to My Account > Site Preferences > Shipping preferences. Default: false */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. Local pickup is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable local pickup, a seller (1) must be eligible for local pickup and (2) must set this boolean field to 'true'. Currently, local pickup is available to only large retail merchants and can be applied to only multiple-quantity, fixed-price listings. In addition to setting this field, the merchant must also do the following to enable the "Local Pickup" option on a multiple-quantity, fixed-price listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Include the seller-defined SKU value of the product(s) in the request. For single-variation listings, the SKU value is specified in the Item.SKU field and for multiple-variation listings, the SKU value(s) are specified in the Item.Variations.Variation.SKU field(s). Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a seller is successful at listing an item with the In-Store Pickup feature enabled, prospective buyers within a reasonable distance (25 miles or so) from one of the seller's stores (that has stock available) will see the "Available for In-Store Pickup" option on the listing, along with information on the closest store that has the item.Default: false */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" feature. Click and Collect is supported by the Inventory API, and it can be used with Add/Revise/Relist calls. To enable "Click and Collect", a seller (1) must be eligible for Click and Collect and (2) must set this boolean field to 'true'. Currently, Click and Collect is available to only large retail merchants selling in the eBay AU and UK marketplaces. In addition to setting this field, the merchant must also do the following to enable the "Click and Collect" option on a listing: Have inventory for the product at one or more physical stores tied to the merchant's account. Sellers can use the createInventoryLocaion method in the Inventory API to associate physical stores to their account and they can then can add inventory to specific store locations. Set an immediate payment requirement on the item. The immediate payment feature requires the seller to: Set the immediatePay flag in the payment policy to 'true'. Include only one paymentMethods field in the payment policy and set its value to PAYPAL. Include a valid PayPal contact in the recipientAccountReference.referenceId field of the payment policy. Have a valid store location with a complete street address. When a UK merchant successfully lists an item with Click and Collect, prospective buyers within a reasonable distance from one of the merchant's stores (that has stock available) will see the "Available for Click and Collect" option on the listing, along with information on the closest store that has the item.Default: false */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. shippingOptions is a list with a single element if the seller ships to only domestic locations. If the seller also ships internationally, the list contains a second element that defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, any rate tables the seller wants to associate with the shipping services, plus other details (such as the shippingServices offered for domestic or international shipments). */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + } + + + /** The response payload for requests that return a list of fulfillment policies. */ + export interface FulfillmentPolicyResponse { + + /** A list of the seller's fulfillment policies. */ + fulfillmentPolicies?: Array; + + /** Returns a URL link to the result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + export interface InternationalReturnOverrideType { + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** Required if the seller wants to set an international return policy that differs from their domestic return policy. If set to true, the seller allows international returns. If set to false, the seller does not accept international returns. */ + returnsAccepted?: boolean | null; + + /** Required if the internationalOverride.returnsAccepted field is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** Root container that defines the fields for a seller's payment policy. The paymentPolicy encapsulates a seller's payment terms and consists of payment details for the seller, the name and description of the policy, and the marketplace and category group(s) covered by the payment policy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface PaymentPolicy { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + } + + + /** This root container defines a seller's payment policy for a specific marketplace and category type. Used when creating or updating a payment policy, paymentPolicyRequest encapsulates a seller's terms for how buyers can pay for the items they buy. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface PaymentPolicyRequest { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. The seller can change the immediate payment requirement at any time during the life cycle of a listing. The following must be true before a seller can apply an immediate payment requirement to an item: The seller must have a PayPal Business account. The Buy It Now price cannot be higher than $60,000 USD. The eBay marketplace on which the item is listed must support PayPal payments. The listing type must be fixed-price, or an auction with a Buy It Now option.To enable the immediate payment requirement, the seller must also perform the following actions via API calls: Provide a valid paymentMethods.recipientAccountReference.referenceId value. Offer PayPal as the only payment method for the item(s). Specify all related costs to the buyer (because the buyer is not be able to use the Buyer Request Total feature in an immediate payment listing); these costs include flat-rate shipping costs for each domestic and international shipping service offered, package handling costs, and any shipping surcharges. Include and set the shippingProfileDiscountInfo container values if you are going to use promotional shipping discounts.For more information, see the Understanding immediate payment Help page. Note: Listings created with the Inventory API must reference a payment policy that has immediatePay is set to true. Items listed with the Inventory API must also be fixed-price good-till-canceled (GTC) listings where PayPal is the only supported payment method (paymentMethod must be set to PAYPAL).Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified, the value defaults to the eBay registration site of the seller. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Note: Each eBay marketplace supports and requires its own set of payment methods, and not all marketplaces allow all payment methods. Check the specifics of the marketplaces where you list items to ensure your payment policies meet the payment method requirements needed for any specific listing. Note: Item listings created with the Inventory API must reference a payment policy that has this value set to PAYPAL (currently, the Inventory API supports only fixed-prince GTC items with immediate pay (which required payments to be made via PayPal). Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + } + + + /** The response payload for payment policy requests. */ + export interface PaymentPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** A list of the seller's payment policies. */ + paymentPolicies?: Array; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object containing the sellers status with regards to the specified payment program. */ + export interface PaymentsProgramResponse { + + /** The ID of the eBay marketplace to which the payment policy applies. If this value is not specified in the request, the value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This path parameter specifies the payment program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. For implementation help, refer to eBay API documentation */ + paymentsProgramType?: string | null; + + /** For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** If set to true, the seller was at one point opted-in to the associated payment program, but they later opted out of the program. A value of false indicates the seller never opted-in to the program or if they did opt-in to the program, they never opted-out of it. It's important to note that the setting of this field does not indicate the seller's current status regarding the payment program. It is possible for this field to return true while the status field returns OPTED_IN. */ + wasPreviouslyOptedIn?: boolean | null; + } + + + /** A seller program in to which a seller can opt-in. */ + export interface Program { + + /** A seller program in to which a seller can opt-in. For implementation help, refer to eBay API documentation */ + programType?: string | null; + } + + + /** A list of the supported seller programs. */ + export interface Programs { + + /** A list of seller programs. */ + programs?: Array; + } + + + /** A complex type that contains information pertaining to a shipping rate table. */ + export interface RateTable { + + /** A two-letter ISO 3166-1 Alpha-2 country code representing the eBay marketplace where an item is listed. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The region covered by the shipping rate table, either DOMESTIC or INTERNATIONAL. DOMESTIC indicates that the shipping rate table applies to regions within the country where an item is listed (the source country) while INTERNATIONAL indicates that the shipping rate table applies to regions outside of the country where an item is listed. For implementation help, refer to eBay API documentation */ + locality?: string | null; + + /** The user-defined name for the shipping rate table. Sellers can access Seller Hub (or My eBay > Account > Site Preferences > Shipping preferences) to create and assign names to their shipping rate tables. */ + name?: string | null; + + /** A unique eBay-assigned ID for a seller's shipping rate table. Call getRateTables to retrieve the seller's current rate table IDs. */ + rateTableId?: string | null; + } + + + /** The response container for with information on a seller's shipping rate tables. */ + export interface RateTableResponse { + + /** A list of elements that provide information on the seller-defined shipping rate tables. */ + rateTables?: Array; + } + + + /** Root container that defines the fields for a seller's return policy. The returnPolicy encapsulates a seller's terms for how they handle item returns, the name and description of the policy, and the marketplace and category group(s) to which the return policy is applied. While each seller must define at least one return policy for every marketplace into which they sell, sellers can define multiple return policies for a single marketplace by specifying different configurations for the unique policies. */ + export interface ReturnPolicy { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Each eBay marketplace may support different sets of refund methods and marketplaces can also have differing default values for this field. Sellers are obligated to honor the refund method displayed in their listings. Call GeteBayDetails in the Trading API to see the refund methods supported by the marketplaces you sell into. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for this policy. This ID value is appended to the end of the Location URI that is returned as a response header when you call createReturnPolicy). */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** This root container defines a seller's return policy for a specific marketplace and category type. Used when creating or updating a return policy, returnPolicyRequest encapsulates a seller's terms for how buyers can return items. While each seller must define at least one payment policy for every marketplace into which they sell, sellers can define multiple payment policies for a single marketplace by specifying different configurations for the unique policies. A successful call returns a paymentPolicyId, plus the Location response header contains the URI to the resource. Use the Metadata API method to determine which categories in the marketplace(s) require you to provide a return policy. Also note that some marketplaces require you to provide a specific return policy for vehicle listings. Policy instructions can be localized by providing a locale in the Content-Language HTTP request header. For example: Content-Language: de-DE. Tip: For more on using business policies, see eBay business policies. */ + export interface ReturnPolicyRequest { + + /** For return policies, this field can be set to only ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the Returns on eBay page before the holiday season begins. If the feature is not enabled for the season, this field is ignored. The extended holiday returns period is defined by three dates: The start date = start of November. The purchase cutoff date = end of the year. The end date = end of January. The above dates may vary by a few days each year. Sellers are notified of the current dates on their eBay marketplace before the holiday period starts. Sellers can specify Extended Holiday Returns (as well as their regular non-holiday returns period) for chosen listings at any time during the year. The Extended Holiday Returns offer is not visible in listings until the start date of current year's holiday returns period, at which point it overrides the non-holiday returns policy. Buyers can see the Extended Holiday Returns offer in listings displayed through the purchase cutoff date and are able to return those purchases until the end date of the period. After the purchase cutoff date, the Extended Holiday Returns offer automatically disappears from the listings and the seller's non-holiday returns period reappears. Purchases made from that point on are subject to the non-holiday returns period, while purchases made before the cutoff date still have until the end of the period to return under the program. If the value of holidayReturns is false for an item, the return period specified by the returnsWithinOption field applies, regardless of the purchase date. If the item is listed with a policy of no returns, holidayReturns is automatically reset to false. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! this field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. Note that each eBay marketplace can support different sets of refund methods. Also, each eBay marketplace has a default setting for this value and if you do not specifically set this value, sellers are obligated to honor the setting that displays in their listings. Call GeteBayDetails in the Trading API to see what refund methods the marketplaces you sell into support. We recommend you set this field to the value of your preferred refund method and that you use the description field to detail the seller's return policy (such as indicating how quickly the seller will process a refund, whether the seller must receive the item before processing a refund, and other similar useful details). You cannot modify this value in a Revise item call if (1) the listing has bids or (2) the listing ends within 12 hours. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Sellers who accept returns should include this field if they charge buyers a restocking fee when items are returned. A restocking fee comes into play only when an item is returned due to buyer remorse and/or a purchasing mistake, but sellers cannot charge a restocking fee for SNAD-related returns. The total amount returned to the buyer is reduced by the cost of the item multiplied by the percentage indicated by this field. Allowable restocking fee values are: 0.0: No restocking fee is charged to the buyer 10.0: 10 percent of the item price is charged to the buyer 15.0: 15 percent of the item price is charged to the buyer 20.0: Up to 20 percent of the item price is charged to the buyer */ + restockingFeePercentage?: string | null; + + /** Important! This field is being deprecated on many marketplaces. Once deprecated, this field will be ignored on marketplaces where it is not supported and it will neither be read nor returned. This optional field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) Where valid, sellers can use this field to add details about their return policies. eBay uses this text string as-is in the Return Policy section of the View Item page. Avoid HTML and avoid character entity references (such as &amp;pound; or &amp;#163;). To include special characters in the return policy description, use the literal UTF-8 or ISO-8559-1 character (e.g. &#163;). Max length: 5000 (8000 for DE) */ + returnInstructions?: string | null; + + /** Valid in the US marketplace only, this optional field indicates additional services (other than money-back) that sellers can offer buyers for remorse returns. As of version 1.2.0, the only accepted value for this field is REPLACEMENT. This field is valid in only the US marketplace, any supplied value is ignored in other marketplaces. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** If set to true, the seller accepts returns. Call the getReturnPolicies in the Metadata API to see what categories require returns to be offered for listings in each category. Also, note that some European marketplaces (for example, UK, IE, and DE) require sellers to accept returns for fixed-price items and auctions listed with Buy It Now. For details, see Returns and the Law (UK). Note:Top-Rated sellers must accept item returns and the handlingTime should be set to zero days or one day for a listing to receive a Top-Rated Plus badge on the View Item or search result pages. For more information on eBay's Top-Rated seller program, see Becoming a Top Rated Seller and qualifying for Top Rated Plus benefits. */ + returnsAccepted?: boolean | null; + + /** Required if returnsAccepted is set to true. This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + } + + + /** The response payload for return policy requests. */ + export interface ReturnPolicyResponse { + + /** Returns a URL link to the current result set. */ + href?: string | null; + + /** + * Returns the maximum number of results that can be returned in result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a URL link to the next set of results. */ + next?: string | null; + + /** + * Returns how many result sets were skipped before the currently returned result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** Returns a URL link to the previous set of results. */ + prev?: string | null; + + /** A list of the seller's return policies. */ + returnPolicies?: Array; + + /** + * Returns the total number of result sets in the paginated collection. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The applicable sales tax rate, as a percentage of the sale amount, for a given country and sales tax jurisdiction within that country. */ + export interface SalesTax { + + /** The country code identifying the country to which this tax rate applies. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** A unique ID that identifies the sales tax jurisdiction to which the tax rate applies (for example a state within the United States). */ + salesTaxJurisdictionId?: string | null; + + /** The sales tax rate (as a percentage of the sale) applied to sales transactions made in this country and sales tax jurisdiction. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A container that describes the how the sales tax rate is calculated. */ + export interface SalesTaxBase { + + /** The sales tax rate, as a percentage of the sale. */ + salesTaxPercentage?: string | null; + + /** If set to true, shipping and handling charges are taxed. */ + shippingAndHandlingTaxed?: boolean | null; + } + + + /** A list of sales tax tables. */ + export interface SalesTaxes { + + /** A list of sales tax tables that have been set up by a seller. */ + salesTaxes?: Array; + } + + + /** Defines the selling limit applied to an eBay seller's account. */ + export interface SellingLimit { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + amount?: Amount; + + /** + * The maximum quantity of items that can be listed by the seller per calendar month. Note that for a listing with variations, all of the items listed in the variation count as individual items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A merchant's selling limit, and the status of their account registration. */ + export interface SellingPrivileges { + + /** If set to true, the seller's registration is completed. */ + sellerRegistrationCompleted?: boolean | null; + + /** Defines the selling limit applied to an eBay seller's account. */ + sellingLimit?: SellingLimit; + } + + + /** Complex type that that gets populated with a response containing a fulfillment policy. */ + export interface SetFulfillmentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the fulfillment policy for internal use (this value is not displayed to end users). Max length: 250 */ + description?: string | null; + + /** If set to true, the seller offers freight shipping. */ + freightShipping?: boolean | null; + + /** A unique eBay-assigned ID for a fulfillment policy. This ID is generated when the policy is created. */ + fulfillmentPolicyId?: string | null; + + /** If set to true, the seller has opted-in to the Global Shipping Program and eBay automatically sets the international shipping service options to International Priority Shipping. If the value of globalShipping is false, the seller is responsible for specifying one or more international shipping service options if they want to ship internationally. */ + globalShipping?: boolean | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + handlingTime?: TimeDuration; + + /** If set to true, the seller offers local pickup of their items. */ + localPickup?: boolean | null; + + /** The ID of the eBay marketplace to which this fulfillment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this fulfillment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** If set to true, the seller offers the "Click and Collect" option. Currently, "Click and Collect" is available only to large retail merchants the eBay AU and UK marketplaces. */ + pickupDropOff?: boolean | null; + + /** A list that defines the seller's shipping configurations for DOMESTIC and INTERNATIONAL order shipments. The list has a single element if the seller ships to only domestic locations. If the seller also ships internationally, a second element defines their international shipping options. Shipping options configure the high-level shipping settings that apply to orders, such as flat-rate or calculated shipping, and any rate tables the seller wants to associate with the shipping services. Each shippingOption element has a shippingServices container that defines the list of shipping services (domestic or international) offered with this fulfillment policy. */ + shippingOptions?: Array; + + /** This complex type contains the regionIncluded and regionExcluded fields, which indicate the areas to where the seller does and doesn't ship. Normally a seller ships to as many areas as possible using both DOMESTIC and INTERNATIONAL shipping options, and they don't have a need to exclude any regions from their ship-to locations. Here, there's no reason to set regionExcluded fields. However, it makes sense to set the regionExcluded field when a seller wants to exclude a small area that's within a larger area they service. For example, suppose a seller indicates they ship 'Worldwide', but for some reason must exclude a specific country, or world region. Note: Configuring the shipToLocations is tricky because the regionIncluded and regionExcluded fields are valid in different parts of the schema and their allowable settings vary upon the context. For details on setting these fields, see . */ + shipToLocations?: RegionSet; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** Complex type that that gets populated with a response containing a payment policy. */ + export interface SetPaymentPolicyResponse { + + /** The CategoryTypeEnum value to which this policy applies. Used to discern accounts that sell motor vehicles from those that don't. (Currently, each policy can be set to only one categoryTypes value at a time.) */ + categoryTypes?: Array; + + /** A container that describes the details of a deposit. Used only with motor listings. */ + deposit?: Deposit; + + /** An optional seller-defined description of the payment policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + fullPaymentDueIn?: TimeDuration; + + /** If set to true, payment is due upon receipt (eBay generates a receipt when the buyer agrees to purchase an item). Your items will be available for other buyers until payment is complete. This boolean must be set in the payment policy if the seller wants to create a listing that has an "immediate payment" requirement. Default: false */ + immediatePay?: boolean | null; + + /** The ID of the eBay marketplace to which this payment policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this payment policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** This user-defined field allows the seller to give payment instructions to the buyer. These instructions appear on the eBay View Item and Checkout pages. eBay recommends the seller use this field to clarify payment policies for motor vehicles (eBay Motors US and CA). For example, sellers can include the specifics on the deposit (if required), pickup/delivery arrangements, and full payment details on the vehicle. Max length: 500 */ + paymentInstructions?: string | null; + + /** A list of the payment methods accepted by the seller. Each payment policy must specify at least one payment method. Payment policies used with motor vehicle listings that require a deposit must have PayPal listed has a payment method (deposits require PayPal as the payment method). Also, in order for a buyer to make a full payment on a US or CA motor vehicle, the payment policy must specify at least one of the following as a payment method: CashOnPickup LoanCheck MOCC (money order or cashier's check) PaymentSeeDescription (payment instructions are in the paymentInstructions field) PersonalCheck */ + paymentMethods?: Array; + + /** A unique eBay-assigned ID for a payment policy. This ID is generated when the policy is created. */ + paymentPolicyId?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + + /** Complex type that that gets populated with a response containing a return policy. */ + export interface SetReturnPolicyResponse { + + /** For return policies, this field always returns ALL_EXCLUDING_MOTORS_VEHICLES (returns on motor vehicles are not processed through eBay flows.) Default: ALL_EXCLUDING_MOTORS_VEHICLES (for return policies only) */ + categoryTypes?: Array; + + /** An optional seller-defined description of the return policy for internal use (this value is not displayed to end users). */ + description?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. If set to true, the seller offers an Extended Holiday Returns policy for their listings. IMPORTANT: Extended Holiday Returns is a seasonally available feature that is offered on some eBay marketplaces. To see if the feature is enabled in any given year, check the eBay Seller Center Returns on eBay page of before the holiday season begins. */ + extendedHolidayReturnsOffered?: boolean | null; + + /** This type defines the fields for a seller's international return policy. If a seller does not populate the fields in this complex type, the international return policy defaults to the return policy set for domestic returns. */ + internationalOverride?: InternationalReturnOverrideType; + + /** The ID of the eBay marketplace to which this return policy applies. If this value is not specified, value defaults to the seller's eBay registration site. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A user-defined name for this return policy. Names must be unique for policies assigned to the same marketplace. Max length: 64 */ + name?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value other than MONEY_BACK will be treated as MONEY_BACK (although for a period of time, eBay will store and return the legacy values to preserve backwards compatibility). Indicates the method the seller uses to compensate the buyer for returned items. The return method specified applies only to remorse returns. For implementation help, refer to eBay API documentation */ + refundMethod?: string | null; + + /** Important! This field has been deprecated as of version 1.2.0, released on May 31, 2018. Any value supplied in this field is ignored, it is neither read nor returned. Optionally set by the seller, the percentage charged if the seller charges buyers a a restocking fee when items are returned due to buyer remorse and/or a purchasing mistake. The total amount charged to the buyer is the cost of the item multiplied by the percentage indicated in this field. */ + restockingFeePercentage?: string | null; + + /** This field contains the seller's detailed explanation for their return policy and is displayed in the Return Policy section of the View Item page. This field is valid in only the following marketplaces (the field is otherwise ignored): Germany (DE) Spain (ES) France (FR) Italy (IT) */ + returnInstructions?: string | null; + + /** This field indicates the method in which the seller handles non-money back return requests for remorse returns. This field is valid in only the US marketplace and the only valid value is REPLACEMENT. For implementation help, refer to eBay API documentation */ + returnMethod?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + returnPeriod?: TimeDuration; + + /** A unique eBay-assigned ID for a return policy. This ID is generated when the policy is created. */ + returnPolicyId?: string | null; + + /** If set to true, the seller accepts returns. If set to false, this field indicates that the seller does not accept returns. */ + returnsAccepted?: boolean | null; + + /** This field indicates who is responsible for paying for the shipping charges for returned items. The field can be set to either BUYER or SELLER. Depending on the return policy and specifics of the return, either the buyer or the seller can be responsible for the return shipping costs. Note that the seller is always responsible for return shipping costs for SNAD-related issues. For implementation help, refer to eBay API documentation */ + returnShippingCostPayer?: string | null; + + /** A list of warnings related to request. This field normally returns empty, which indicates the request did not generate any warnings. */ + warnings?: Array; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method retrieves all the fulfillment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {FulfillmentPolicyResponse} Success + */ + GetFulfillmentPolicies(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'fulfillment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + + /** + * This method creates a new fulfillment policy where the policy encapsulates seller's terms for fulfilling item purchases. Fulfillment policies include the shipment options that the seller offers to buyers. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific fulfillment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post fulfillment_policy/ + * @param {FulfillmentPolicyRequest} requestBody Request to create a seller account fulfillment policy. + * @return {void} + */ + CreateFulfillmentPolicy(requestBody: FulfillmentPolicyRequest): Observable> { + return this.http.post(this.baseUri + 'fulfillment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a fulfillment policy. Supply the ID of the policy you want to retrieve using the fulfillmentPolicyId path parameter. + * Get fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicy(fulfillmentPolicyId: string): Observable { + return this.http.get(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), {}); + } + + /** + * This method updates an existing fulfillment policy. Specify the policy you want to update using the fulfillment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy you want to update. + * @param {FulfillmentPolicyRequest} requestBody Fulfillment policy request + * @return {SetFulfillmentPolicyResponse} OK + */ + UpdateFulfillmentPolicy(fulfillmentPolicyId: string, requestBody: FulfillmentPolicyRequest): Observable { + return this.http.put(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a fulfillment policy. Supply the ID of the policy you want to delete in the fulfillmentPolicyId path parameter. Note that you cannot delete the default fulfillment policy. + * Delete fulfillment_policy/{fulfillmentPolicyId} + * @param {string} fulfillmentPolicyId This path parameter specifies the ID of the fulfillment policy to delete. + * @return {void} + */ + DeleteFulfillmentPolicy(fulfillmentPolicyId: string): Observable> { + return this.http.delete(this.baseUri + 'fulfillment_policy/' + (fulfillmentPolicyId == null ? '' : encodeURIComponent(fulfillmentPolicyId)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details for a single fulfillment policy. In the request, supply both the policy name and its associated marketplace_id as query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get fulfillment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the fulfillment policy you want to retrieve. + * @return {FulfillmentPolicy} Success + */ + GetFulfillmentPolicyByName(marketplace_id: string, name: string): Observable { + return this.http.get(this.baseUri + 'fulfillment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); + } + + /** + * This method retrieves all the payment policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/ + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policies you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {PaymentPolicyResponse} Success + */ + GetPaymentPolicies(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'payment_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + + /** + * This method creates a new payment policy where the policy encapsulates seller's terms for purchase payments. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. Be aware that some marketplaces require a specific payment policy for vehicle listings. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post payment_policy/ + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {void} + */ + CreatePaymentPolicy(requestBody: PaymentPolicyRequest): Observable> { + return this.http.post(this.baseUri + 'payment_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a payment policy. Supply the ID of the policy you want to retrieve using the paymentPolicyId path parameter. + * Get payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicy(payment_policy_id: string): Observable { + return this.http.get(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), {}); + } + + /** + * This method updates an existing payment policy. Specify the policy you want to update using the payment_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to update. + * @param {PaymentPolicyRequest} requestBody Payment policy request + * @return {SetPaymentPolicyResponse} OK + */ + UpdatePaymentPolicy(payment_policy_id: string, requestBody: PaymentPolicyRequest): Observable { + return this.http.put(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a payment policy. Supply the ID of the policy you want to delete in the paymentPolicyId path parameter. Note that you cannot delete the default payment policy. + * Delete payment_policy/{payment_policy_id} + * @param {string} payment_policy_id This path parameter specifies the ID of the payment policy you want to delete. + * @return {void} + */ + DeletePaymentPolicy(payment_policy_id: string): Observable> { + return this.http.delete(this.baseUri + 'payment_policy/' + (payment_policy_id == null ? '' : encodeURIComponent(payment_policy_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a single payment policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get payment_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the payment policy you want to retrieve. + * @return {PaymentPolicy} Success + */ + GetPaymentPolicyByName(marketplace_id: string, name: string): Observable { + return this.http.get(this.baseUri + 'payment_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); + } + + /** + * This method returns whether or not the user is opted-in to the payment program. Sellers opt-in to payment programs by marketplace and you must target a specific marketplace in your requests to this method using the marketplace_id path parameter. + * Get payments_program/{marketplace_id}/{payments_program_type} + * @param {string} marketplace_id This path parameter specifies the eBay marketplace of the payment program for which you want to retrieve the seller's status. + * @param {string} payments_program_type This path parameter specifies the payments program whose status is returned by the call. Currently the only supported payments program is EBAY_PAYMENTS. For details on the program, see Payments Terms of Use. + * @return {PaymentsProgramResponse} Success + */ + GetPaymentsProgram(marketplace_id: string, payments_program_type: string): Observable { + return this.http.get(this.baseUri + 'payments_program/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/' + (payments_program_type == null ? '' : encodeURIComponent(payments_program_type)), {}); + } + + /** + * This method retrieves the seller's current set of privileges. The call returns whether or not the seller's eBay registration has been completed, as well as the details of their site-wide sellingLimt (the amount and quantity they can sell on a given day). + * Get privilege/ + * @return {SellingPrivileges} Success + */ + GetPrivileges(): Observable { + return this.http.get(this.baseUri + 'privilege/', {}); + } + + /** + * This method gets a list of the seller programs that the seller has opted-in to. + * Get program/get_opted_in_programs + * @return {Programs} Success + */ + GetOptedInPrograms(): Observable { + return this.http.get(this.baseUri + 'program/get_opted_in_programs', {}); + } + + /** + * This method opts the seller in to an eBay seller program. Currently available programs include the Out of Stock Control and the Selling Policy Management program. When you opt-in to the SELLING_POLICY_MANAGEMENT, eBay can associate the business policies you create with the items you list. Note: It can take up to 24-hours for eBay to process your request to opt-in to a Seller Program. Use the getOptedInPrograms call to check the status of your request after a processing period has passed. + * Post program/opt_in + * @param {Program} requestBody Program being opted-in to. + * @return {string} Success + */ + OptInToProgram(requestBody: Program): Observable { + return this.http.post(this.baseUri + 'program/opt_in', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method opts the seller out of a seller program to which you have previously opted-in to. Get a list of the seller programs you have opted-in to using the getOptedInPrograms call. + * Post program/opt_out + * @param {Program} requestBody Program being opted-out of. + * @return {string} Success + */ + OptOutOfProgram(requestBody: Program): Observable { + return this.http.post(this.baseUri + 'program/opt_out', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method retrieves a seller's shipping rate tables for the country specified in the country_code query parameter. If no country code is specified, the call returns all shipping rate tables that have been assigned a rateTableId (to assign an ID to an older rate table, call this method using the table's country code). The method's response includes a rateTableId for each table defined by the seller. Use a table's ID value in a fulfillment policy to specify the shipping rate table to use for that policy's DOMESTIC or INTERNATIONAL shipping option (make sure the locality of the rate table matches the optionType of the shipping option). Sellers can define up to 40 shipping rate tables for their account, which lets them set up different rate tables for each of the marketplaces they sell into. Go to My eBay > Account > Site Preferences to create and maintain the rate tables. For more, see Using shipping rate tables. If you're using the Trading API, use the rate table ID values in the RateTableDetails container of the Add/Revise/Relist calls. If the locality for a rate table is set to DOMESTIC, pass the ID value in the RateTableDetails.DomesticRateTableId field. Otherwise, if locality is INTERNATIONAL, pass the ID value in RateTableDetails.InternationalRateTableId. Note: For regions that are not yet ramped up with multi-rate table support, this method returns an ID that maps to the seller's default rate table for the country specified. Currently, only the US and AU marketplaces support the extended multi-rate table functionality. + * Get rate_table/ + * @param {string} country_code This query parameter specifies the two-letter ISO 3166-1 Alpha-2 code of country for which you want shipping-rate table information. If you do not specify a county code, the request returns all the seller-defined rate tables. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {RateTableResponse} Success + */ + GetRateTables(country_code: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'rate_table/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); + } + + /** + * This method retrieves all the return policies configured for the marketplace you specify using the marketplace_id query parameter. Marketplaces and locales Get the correct policies for a marketplace that supports multiple locales using the Content-Language request header. For example, get the policies for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/ + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'return_policy/?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + + /** + * This method creates a new return policy where the policy encapsulates seller's terms for returning items. Use the Metadata API method getReturnPolicies to determine which categories require you to supply a return policy for the marketplace(s) into which you list. Each policy targets a marketplaceId and categoryTypes.name combination and you can create multiple policies for each combination. A successful request returns the URI to the new policy in the Location response header and the ID for the new policy is returned in the response payload. Tip: For details on creating and using the business policies supported by the Account API, see eBay business policies. Marketplaces and locales Policy instructions can be localized by providing a locale in the Accept-Language HTTP request header. For example, the following setting displays field values from the request body in German: Accept-Language: de-DE. Target the specific locale of a marketplace that supports multiple locales using the Content-Language request header. For example, target the French locale of the Canadian marketplace by specifying the fr-CA locale for Content-Language. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. Tip: For details on headers, see HTTP request headers. + * Post return_policy/ + * @param {ReturnPolicyRequest} requestBody Return policy request + * @return {void} + */ + CreateReturnPolicy(requestBody: ReturnPolicyRequest): Observable> { + return this.http.post(this.baseUri + 'return_policy/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of the return policy specified by the returnPolicyId path parameter. + * Get return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicy(return_policy_id: string): Observable { + return this.http.get(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), {}); + } + + /** + * This method updates an existing return policy. Specify the policy you want to update using the return_policy_id path parameter. Supply a complete policy payload with the updates you want to make; this call overwrites the existing policy with the new details specified in the payload. + * Put return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to update. + * @param {ReturnPolicyRequest} requestBody Container for a return policy request. + * @return {SetReturnPolicyResponse} OK + */ + UpdateReturnPolicy(return_policy_id: string, requestBody: ReturnPolicyRequest): Observable { + return this.http.put(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a return policy. Supply the ID of the policy you want to delete in the returnPolicyId path parameter. Note that you cannot delete the default return policy. + * Delete return_policy/{return_policy_id} + * @param {string} return_policy_id This path parameter specifies the ID of the return policy you want to delete. + * @return {void} + */ + DeleteReturnPolicy(return_policy_id: string): Observable> { + return this.http.delete(this.baseUri + 'return_policy/' + (return_policy_id == null ? '' : encodeURIComponent(return_policy_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of a single return policy. Supply both the policy name and its associated marketplace_id in the request query parameters. Marketplaces and locales Get the correct policy for a marketplace that supports multiple locales using the Content-Language request header. For example, get a policy for the French locale of the Canadian marketplace by specifying fr-CA for the Content-Language header. Likewise, target the Dutch locale of the Belgium marketplace by setting Content-Language: fr-BE. For details on header values, see HTTP request headers. + * Get return_policy/get_by_policy_name + * @param {string} marketplace_id This query parameter specifies the ID of the eBay marketplace of the policy you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/MarketplaceIdEnum.html + * @param {string} name This query parameter specifies the user-defined name of the return policy you want to retrieve. + * @return {ReturnPolicy} Success + */ + GetReturnPolicyByName(marketplace_id: string, name: string): Observable { + return this.http.get(this.baseUri + 'return_policy/get_by_policy_name?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&name=' + (name == null ? '' : encodeURIComponent(name)), {}); + } + + /** + * This call gets the current tax table entry for a specific tax jurisdiction. Specify the jurisdiction to retrieve using the countryCode and jurisdictionId path parameters. + * Get sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction for the tax table entry you want to retrieve. + * @return {SalesTax} Success + */ + GetSalesTax(countryCode: string, jurisdictionId: string): Observable { + return this.http.get(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), {}); + } + + /** + * This method creates or updates a sales tax table entry for a jurisdiction. Specify the tax table entry you want to configure using the two path parameters: countryCode and jurisdictionId. A tax table entry for a jurisdiction is comprised of two fields: one for the jurisdiction's sales-tax rate and another that's a boolean value indicating whether or not shipping and handling are taxed in the jurisdiction. You can set up tax tables for countries that support different tax jurisdictions. Currently, only Canada, India, and the US support separate tax jurisdictions. If you sell into any of these countries, you can set up tax tables for any of the country's jurisdictions. Retrieve valid jurisdiction IDs using getSalesTaxJurisdictions in the Metadata API. For details on using this call, see Establishing sales-tax tables. + * Put sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country for which you want to create tax table entry. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales-tax jurisdiction for the table entry you want to create. + * @param {SalesTaxBase} requestBody A container that describes the how the sales tax is calculated. + * @return {void} + */ + CreateOrReplaceSalesTax(countryCode: string, jurisdictionId: string, requestBody: SalesTaxBase): Observable> { + return this.http.put(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call deletes a tax table entry for a jurisdiction. Specify the jurisdiction to delete using the countryCode and jurisdictionId path parameters. + * Delete sales_tax/{countryCode}/{jurisdictionId} + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table entry you want to delete. + * @param {string} jurisdictionId This path parameter specifies the ID of the sales tax jurisdiction whose table entry you want to delete. + * @return {void} + */ + DeleteSalesTax(countryCode: string, jurisdictionId: string): Observable> { + return this.http.delete(this.baseUri + 'sales_tax/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/' + (jurisdictionId == null ? '' : encodeURIComponent(jurisdictionId)), { observe: 'response', responseType: 'text' }); + } + + /** + * Use this call to retrieve a sales tax table that the seller established for a specific country. Specify the tax table to retrieve using the country_code query parameter. + * Get sales_tax/ + * @param {string} country_code This path parameter specifies the two-letter ISO 3166-1 Alpha-2 code for the country whose tax table you want to retrieve. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/account/types/CountryCodeEnum.html + * @return {SalesTaxes} Success + */ + GetSalesTaxes(country_code: string): Observable { + return this.http.get(this.baseUri + 'sales_tax/?country_code=' + (country_code == null ? '' : encodeURIComponent(country_code)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_analytics.txt b/Tests/SwagTsTests/NG2Results/sell_analytics.ts similarity index 99% rename from Tests/SwagTsTests/NG2Results/sell_analytics.txt rename to Tests/SwagTsTests/NG2Results/sell_analytics.ts index b17ae1fa..4cb389e7 100644 --- a/Tests/SwagTsTests/NG2Results/sell_analytics.txt +++ b/Tests/SwagTsTests/NG2Results/sell_analytics.ts @@ -1,374 +1,374 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - export interface BenchmarkMetadata { - - /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ - average?: string | null; - } - - - /** A complex type that describes a program cycle. */ - export interface Cycle { - - /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ - cycleType?: string | null; - - /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - evaluationDate?: string | null; - - /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ - evaluationMonth?: string | null; - } - - - /** A complex type that defines a dimension key and metrics in a traffic report. */ - export interface Definition { - - /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The value the dimension or metric parameter as submitted in the request. */ - key?: string | null; - - /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ - localizedName?: string | null; - } - - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - export interface Dimension { - - /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ - dimensionKey?: string | null; - - /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ - name?: string | null; - - /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ - value?: string | null; - } - - - /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ - export interface DimensionMetric { - - /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ - dimension?: Dimension; - - /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ - metrics?: Array; - } - - - /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ - export interface Metric { - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - benchmark?: MetricBenchmark; - - /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ - distributions?: Array; - - /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ - metricKey?: string | null; - - /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ - value?: string | null; - } - - - /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ - export interface MetricBenchmark { - - /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ - adjustment?: string | null; - - /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ - basis?: string | null; - - /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ - metadata?: BenchmarkMetadata; - - /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ - rating?: string | null; - } - - - /** This complex data type describes the metric distribution by basis. */ - export interface MetricDistribution { - - /** This field returns the basis, or the method, by which the metric rating is calculated. */ - basis?: string | null; - - /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ - data?: Array; - } - - - /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ - export interface Distribution { - - /** The name of a distribution in which the seller is active. */ - name?: string | null; - - /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ - value?: string | null; - } - - - /** Type that defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ - category?: string | null; - - /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error than given in the message error field. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** If present, indicates which subsystem in which the error occurred. */ - subdomain?: string | null; - } - - - /** A complex type that defines an error and error message. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - export interface EvaluationCycle { - - /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - endDate?: string | null; - - /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ - evaluationDate?: string | null; - - /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ - evaluationType?: string | null; - - /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ - startDate?: string | null; - } - - - /** The response container for a list of seller profiles. */ - export interface FindSellerStandardsProfilesResponse { - - /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ - standardsProfiles?: Array; - } - - - /** A complex type that defines a seller profile. */ - export interface StandardsProfile { - - /** A complex type that describes a program cycle. */ - cycle?: Cycle; - - /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ - defaultProgram?: boolean | null; - - /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ - evaluationReason?: string | null; - - /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ - metrics?: Array; - - /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ - program?: string | null; - - /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ - standardsLevel?: string | null; - } - - - /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ - export interface GetCustomerServiceMetricResponse { - - /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ - dimensionMetrics?: Array; - - /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ - evaluationCycle?: EvaluationCycle; - - /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - export interface Header { - - /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ - dimensionKeys?: Array; - - /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ - metrics?: Array; - } - - - /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ - export interface Metadata { - - /** Type that defines the metadata header fields. */ - metadataHeader?: MetadataHeader; - - /** A list of the individual report records. */ - metadataRecords?: Array; - } - - - /** Type that defines the metadata header fields. */ - export interface MetadataHeader { - - /** The key value used for the report. For example: "key": "LISTING_ID" */ - key?: string | null; - - /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ - metadataKeys?: Array; - } - - - /** A complex type that defines the data records returned in the report. */ - export interface MetadataRecord { - - /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ - metadataValues?: Array; - - /** A complex type that contains a value, plus the veracity of that value. */ - value?: Value; - } - - - /** A complex type that contains a value, plus the veracity of that value. */ - export interface Value { - - /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ - applicable?: boolean | null; - - /** The value of the report data. */ - value?: string | null; - } - - - /** Type that defines the fields of the individual record of the report. */ - export interface Record { - - /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ - dimensionValues?: Array; - - /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ - metricValues?: Array; - } - - - /** The complex type that defines that defines the report. */ - export interface Report { - - /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ - dimensionMetadata?: Array; - - /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - endDate?: string | null; - - /** Type that defines the headers for the dimension keys and metrics returned in the report. */ - header?: Header; - - /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ - lastUpdatedDate?: string | null; - - /** A complex type containing the individual data records for the traffic report. */ - records?: Array; - - /** The start date of the date range used to calculate the report, in ISO 8601 format. */ - startDate?: string | null; - - /** An array of any process errors or warnings that were generated during the processing of the call processing. */ - warnings?: Array; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. - * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} - * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED - * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html - * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. - * @return {GetCustomerServiceMetricResponse} Success - */ - GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Observable { - return this.http.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}); - } - - /** - * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. - * Get seller_standards_profile - * @return {FindSellerStandardsProfilesResponse} Success - */ - FindSellerStandardsProfiles(): Observable { - return this.http.get(this.baseUri + 'seller_standards_profile', {}); - } - - /** - * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. - * Get seller_standards_profile/{program}/{cycle} - * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. - * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. - * @return {StandardsProfile} Success - */ - GetSellerStandardsProfile(cycle: string, program: string): Observable { - return this.http.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}); - } - - /** - * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. - * Get traffic_report - * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. - * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html - * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count - * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html - * @return {Report} Success - */ - GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + export interface BenchmarkMetadata { + + /** This field returns the average value for the group, as defined by the specified basis. When the benchmark basis is set to PEER_BENCHMARK, the value returned in this field is the benchmark value to which the seller's metric value is compared to determine the seller's rating for the customer service metric. */ + average?: string | null; + } + + + /** A complex type that describes a program cycle. */ + export interface Cycle { + + /** The cycle type, either CURRENT or PROJECTED. CURRENT means the profile's metrics values are from the most recent official eBay monthly standards evaluation. PROJECTED means the profile values were determined when the profile was requested. For implementation help, refer to eBay API documentation */ + cycleType?: string | null; + + /** The date and time at which the standard compliance values were determined for the profile. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + evaluationDate?: string | null; + + /** The month in which the currently effective seller level was computed. The value is always formatted as YYYY-MM. If the cycle is CURRENT, this value is the month and year the of the last eBay compliance evaluation. If this is for a PROJECTED cycle, the value is the month and year of the next scheduled evaluation. Because eBay does official evaluations around the 20th of each month, a PROJECTED value may indicate either the current or the next month. */ + evaluationMonth?: string | null; + } + + + /** A complex type that defines a dimension key and metrics in a traffic report. */ + export interface Definition { + + /** Indicates the data type of the returned dimension. For example, if the dimension is day, the data type is DATE. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The value the dimension or metric parameter as submitted in the request. */ + key?: string | null; + + /** The localized name of the metric or dimension (translated into the language specified in the Accept-Language HTTP request header). For example, if Accept-Language is set to de-DE, the value "day" in the dimension container is returned as "tag", and a metric of TRANSACTION is returned as "Transaktionsanzahl". */ + localizedName?: string | null; + } + + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + export interface Dimension { + + /** dimensionKey defines the basis against which the seller's customer service metric is measured. The value of this field gets set according to the value of the customer_service_metric_type input parameter. The following input configurations return the responses shown: ITEM_NOT_AS_DESCRIBED – Returns benchmark ratings based on L1 listing categories, so the result shows metrics where the dimensionKey is set to LISTING_CATEGORY. ITEM_NOT_RECEIVED – Returns benchmark ratings based on world shipping regions, so the result shows metrics where the dimensionKey is set to SHIPPING_REGION. The shipping region is indicated by the associated value field. For specifics on world shipping regions, see the FAQ section on the following page: Monitor your service metrics For implementation help, refer to eBay API documentation */ + dimensionKey?: string | null; + + /** The dimension name returned in this field depends on the dimensionKey: If dimensionKey is set to SHIPPING_REGION, this field is set to one of following values, which represent established shipping corridors: Domestic International: Mature region International: Emerging region If dimensionKey is set to LISTING_CATEGORY, this field is set to the name of the primary (L1) category in which the items being rated were listed. */ + name?: string | null; + + /** The value returned in this field depends on the dimensionKey. If dimensionKey equals LISTING_CATEGORY, the value returned in this field is the category ID of the primary (L1) category in which the items being rated were listed. If dimensionKey equals SHIPPING_REGION, one of the following values is returned: DOMESTIC INTERNATIONAL_MATURED_REGION INTERNATIONAL_EMERGING_REGION */ + value?: string | null; + } + + + /** This complex type defines a the customer service metrics and seller benchmark performance related to a given dimension. */ + export interface DimensionMetric { + + /** The fields in this complex type define the dimension, or attributes, by which the associated customer service metric and benchmark data is measured. The value of dimensionKey gets set according to the configuration of the input request. The name and value pair further define dimension under the key. */ + dimension?: Dimension; + + /** This is a list of Metric elements where each element contains data and information related to the transactions grouped by the associated dimension. */ + metrics?: Array; + } + + + /** This complex data type defines the details of the customer service metric and benchmark data related to the associated dimension. */ + export interface Metric { + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + benchmark?: MetricBenchmark; + + /** Returned when metricKey equals COUNT, this field returns an array of seller data where each set of data is grouped according by an overarching basis. When the seller distribution is returned, the numeric value of the associated value container equals the sum of the transactions where the seller meets the criteria of the customer service metric type for the given dimension during the evaluationCycle. */ + distributions?: Array; + + /** This field indicates the customer service metric being returned in the associated metrics container. The field is set as follows: TRANSACTION_COUNT – When set to this value, the associated value field equals the total number of transactions completed in the seller group for the metric in the given dimension during the associated evaluationCycle. COUNT – When set to this value, the associated value field is set to the total number of transactions the seller completed that meet the criteria of the customer service metric type for the given dimension that occurred during the evaluationCycle. RATE – When set to this value, the value of the associated value field is the rate of the customer service metric type in the given dimension during the associated evaluationCycle. Specifically, when metricKey is set to RATE, the associated value field is set to the value of metricKey TRANSACTION_COUNT divided by the value of metricKey COUNT. The returned benchmark.rating for the seller is based on this calculated value. */ + metricKey?: string | null; + + /** This field is set to the seller's numeric rating for the associated metricKey for the given dimension during the evaluationCycle. To determine the seller's rating for this metric, the value of this field is compared to the average metric value of the group. */ + value?: string | null; + } + + + /** This complex type defines the benchmark data, which includes the average value of the metric for the group (the benchmark) and the seller's overall rating when compared to the benchmark. */ + export interface MetricBenchmark { + + /** If this field is present, it indicates that the rating given to the seller was "adjusted" for one reason or another. If eBay determines that the normal rating of a seller is impacted by circumstances beyond their control, they can issue an override to adjust the rating given to the seller. For implementation help, refer to eBay API documentation */ + adjustment?: string | null; + + /** This field returns the "basis" by which the benchmark is calculated for the customer service metric type. Currently, the only supported basis is PEER_BENCHMARK. For implementation help, refer to eBay API documentation */ + basis?: string | null; + + /** This complex type defines the fields that comprise the benchmark against which the seller's performance is compared. The comparison determines the seller's rating for the metric. */ + metadata?: BenchmarkMetadata; + + /** This field returns seller's rating for the customer service metric. The rating is set to a value that equals the relative deviation between the seller's metric value and the benchmark value for the customer service metric. Deviation values range from LOW to VERY HIGH, and the lower the deviation, the better the seller rating. For implementation help, refer to eBay API documentation */ + rating?: string | null; + } + + + /** This complex data type describes the metric distribution by basis. */ + export interface MetricDistribution { + + /** This field returns the basis, or the method, by which the metric rating is calculated. */ + basis?: string | null; + + /** This field returns a list of name/value pairs, where the name indicates the distribution being rated and the value indicates the count of seller transactions that meet the distribution criteria. */ + data?: Array; + } + + + /** This complex type defines of a piece of data that is grouped by the associated basis. It contains the name for the data set and its associated value. */ + export interface Distribution { + + /** The name of a distribution in which the seller is active. */ + name?: string | null; + + /** This field contains the number of transactions the seller had in the distribution (identified by the associated name field) during the metric evaluationCycle. */ + value?: string | null; + } + + + /** Type that defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies whether the error was in the REQUEST or happened when running the APPLICATION. */ + category?: string | null; + + /** The primary system where the error occurred. This is relevant for application errors. For Analytics errors, it always has the value API_ANALYTICS. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. Traffic report error IDs range from 50001 to 50500. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error than given in the message error field. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional list of name/value pairs that contain context-specific ErrorParameter objects, with each item in the list being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** If present, indicates which subsystem in which the error occurred. */ + subdomain?: string | null; + } + + + /** A complex type that defines an error and error message. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + export interface EvaluationCycle { + + /** End date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + endDate?: string | null; + + /** The ISO-8601 date and time at which the seller was evaluated for this customer service metric rating. */ + evaluationDate?: string | null; + + /** This field specifies the transaction lookback period used for the evaluation. The evaluation_type value specified in the request is returned in this field. There are two possible values: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. For implementation help, refer to eBay API documentation */ + evaluationType?: string | null; + + /** The start date and time of the transaction lookback range. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z */ + startDate?: string | null; + } + + + /** The response container for a list of seller profiles. */ + export interface FindSellerStandardsProfilesResponse { + + /** A list of the seller's standards profiles. A "standards profile" is a set of eBay seller standards categories and the values related to the associated seller. Profiles are distinguished by a combination of cycle and program values. The "program" value specifies the region to which the data is from. The "cycle" value specifies whether the values were determined just now, or if the values are from the last official eBay seller standards evaluation. */ + standardsProfiles?: Array; + } + + + /** A complex type that defines a seller profile. */ + export interface StandardsProfile { + + /** A complex type that describes a program cycle. */ + cycle?: Cycle; + + /** If set to true, this flag indicates this is the default program for the seller. Except for sellers in China, a seller's default program is the marketplace where they registered with eBay. Seller's in China select their default program when they register. */ + defaultProgram?: boolean | null; + + /** Specifies how the overall seller level was calculated. In the event of special circumstances (as determined by eBay), eBay may override the calculated seller level. In general, such overrides protect a seller's level. The usual value for both cycle types is "Seller level generated by standards monthly evaluation cycle." */ + evaluationReason?: string | null; + + /** A list of the metrics upon which a seller's profile is evaluated. Each program's applicable metrics and requirements are listed at eBay Top Rated seller program standards. */ + metrics?: Array; + + /** Indicates the program used to generate the profile data. Values can be PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. For implementation help, refer to eBay API documentation */ + program?: string | null; + + /** The overall standards level of the seller, one of TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD. For implementation help, refer to eBay API documentation */ + standardsLevel?: string | null; + } + + + /** This complex data type defines the response data that is returned from a request to getCustomerServiceMetric. The dimensionMetrics object contains the details of the dimension being measured and the calculated customer service metric values. The evaluationCycle defines the period used to calculate the metric values. The marketplaceId is the eBay marketplace for which the metrics are being considered. */ + export interface GetCustomerServiceMetricResponse { + + /** This container provides a seller's customer service metric performance for a given dimension. In the getCustomerServiceMetric request, specify values for the following request parameters to control the returned dimension and the associated metric values: customer_service_metric_type evaluation_type evaluation_marketplace_id */ + dimensionMetrics?: Array; + + /** This complex type describes the start and end dates of the of the time period over which the associated benchmark is computed. All timestamps are based on Mountain Standard Time (MST). The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. */ + evaluationCycle?: EvaluationCycle; + + /** The eBay marketplace ID of the marketplace upon which the customer service metric evaluation is based. The customer_service_metric resource supports a limited set of marketplaces. For a complete list of the supported marketplaces, please see the Service metrics policy page. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + export interface Header { + + /** A list of the dimension or metric keys returned in the report. The values for each are is returned in the associated key fields. */ + dimensionKeys?: Array; + + /** The list of metrics returned in the report. The values for each are is returned in the associated key fields. */ + metrics?: Array; + } + + + /** Type the defines the metadata information of the report. This includes the headers and the individual metadata records. */ + export interface Metadata { + + /** Type that defines the metadata header fields. */ + metadataHeader?: MetadataHeader; + + /** A list of the individual report records. */ + metadataRecords?: Array; + } + + + /** Type that defines the metadata header fields. */ + export interface MetadataHeader { + + /** The key value used for the report. For example: "key": "LISTING_ID" */ + key?: string | null; + + /** The list of dimension key values used for the report header. Each list element contains the key name, its data type, and its localized name. For example: "metadataKeys": [   "key": "LISTING_TITLE",   "localizedName": "Listing title",   "dataType": "STRING" */ + metadataKeys?: Array; + } + + + /** A complex type that defines the data records returned in the report. */ + export interface MetadataRecord { + + /** A list of data in a row returned in the traffic report. The data in each of the cells match the labels in headers of the report. */ + metadataValues?: Array; + + /** A complex type that contains a value, plus the veracity of that value. */ + value?: Value; + } + + + /** A complex type that contains a value, plus the veracity of that value. */ + export interface Value { + + /** If set to true, this flag indicates the value in the value field is valid as computed. A value of false indicates one or more of the values used to calculate the value was invalid. The occurrence of this is a rare, however consider this case: suppose a buyer navigates to a View Item page at 11:59 pm (the end of the day) and purchases the item at 12:05am the next day. In this case, the item would have been purchased with 0 views for the day. */ + applicable?: boolean | null; + + /** The value of the report data. */ + value?: string | null; + } + + + /** Type that defines the fields of the individual record of the report. */ + export interface Record { + + /** A list where each element contains either the string DAY (if the dimension is DAY), or the listing ID for which the record's metric data is computed. A second array member, applicable, is always true for dimension values. */ + dimensionValues?: Array; + + /** A list where each element contains a value field that indicates the record's value for the metric. Each element also contains an applicable field that indicates the veracity of the computed value. Note that there are no metric names or IDs associated with the values returned in this array. The metadata to which these values relate can be found in the key values . The order of the metric values in this array equals the order of the key values in metadataHeader. */ + metricValues?: Array; + } + + + /** The complex type that defines that defines the report. */ + export interface Report { + + /** A complex type containing the header of the report and the type of data containted in the rows of the report. */ + dimensionMetadata?: Array; + + /** The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. If you specify an end date that is beyond the lastUpdatedDate value, eBay returns a report that contains data only up to the lastUpdateDate date. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + endDate?: string | null; + + /** Type that defines the headers for the dimension keys and metrics returned in the report. */ + header?: Header; + + /** The date and time, in ISO 8601 format, that indicates the last time the data returned in the report was updated. */ + lastUpdatedDate?: string | null; + + /** A complex type containing the individual data records for the traffic report. */ + records?: Array; + + /** The start date of the date range used to calculate the report, in ISO 8601 format. */ + startDate?: string | null; + + /** An array of any process errors or warnings that were generated during the processing of the call processing. */ + warnings?: Array; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Use this method to retrieve a seller's performance and rating for the customer service metric. Control the response from the getCustomerServiceMetric method using the following path and query parameters: customer_service_metric_type controls the type of customer service transactions evaluated for the metric rating. evaluation_type controls the period you want to review. evaluation_marketplace_id specifies the target marketplace for the evaluation. Currently, metric data is returned for only peer benchmarking. For more detail on the workings of peer benchmarking, see Service metrics policy. + * Get customer_service_metric/{customer_service_metric_type}/{evaluation_type} + * @param {string} customer_service_metric_type Use this path parameter to specify the type of customer service metrics and benchmark data you want returned for the seller. Supported types are: ITEM_NOT_AS_DESCRIBED ITEM_NOT_RECEIVED + * @param {string} evaluation_marketplace_id Use this query parameter to specify the Marketplace ID to evaluate for the customer service metrics and benchmark data. For the list of supported marketplaces, see Analytics API requirements and restrictions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/MarketplaceIdEnum.html + * @param {string} evaluation_type Use this path parameter to specify the type of the seller evaluation you want returned, either: CURRENT – A monthly evaluation that occurs on the 20th of every month. PROJECTED – A daily evaluation that provides a projection of how the seller is currently performing with regards to the upcoming evaluation period. + * @return {GetCustomerServiceMetricResponse} Success + */ + GetCustomerServiceMetric(customer_service_metric_type: string, evaluation_marketplace_id: string, evaluation_type: string): Observable { + return this.http.get(this.baseUri + 'customer_service_metric/' + (customer_service_metric_type == null ? '' : encodeURIComponent(customer_service_metric_type)) + '/' + (evaluation_type == null ? '' : encodeURIComponent(evaluation_type)) + '&evaluation_marketplace_id=' + (evaluation_marketplace_id == null ? '' : encodeURIComponent(evaluation_marketplace_id)), {}); + } + + /** + * This call retrieves all the standards profiles for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller's multiple profiles are distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation or at the time of the request. + * Get seller_standards_profile + * @return {FindSellerStandardsProfilesResponse} Success + */ + FindSellerStandardsProfiles(): Observable { + return this.http.get(this.baseUri + 'seller_standards_profile', {}); + } + + /** + * This call retrieves a single standards profile for the associated seller. A standards profile is a set of eBay seller metrics and the seller's associated compliance values (either TOP_RATED, ABOVE_STANDARD, or BELOW_STANDARD). A seller can have multiple profiles distinguished by two criteria, a "program" and a "cycle." A profile's program is one of three regions where the seller may have done business, or PROGRAM_GLOBAL to indicate all marketplaces where the seller has done business. The cycle value specifies whether the standards compliance values were determined at the last official eBay evaluation (CURRENT) or at the time of the request (PROJECTED). Both cycle and a program values are required URI parameters for this method. + * Get seller_standards_profile/{program}/{cycle} + * @param {string} cycle The period covered by the returned standards profile evaluation. Supply one of two values, CURRENT means the response reflects eBay's most recent monthly standards evaluation and PROJECTED means the response reflect the seller's projected monthly evaluation, as calculated at the time of the request. + * @param {string} program This input value specifies the region used to determine the seller's standards profile. Supply one of the four following values, PROGRAM_DE, PROGRAM_UK, PROGRAM_US, or PROGRAM_GLOBAL. + * @return {StandardsProfile} Success + */ + GetSellerStandardsProfile(cycle: string, program: string): Observable { + return this.http.get(this.baseUri + 'seller_standards_profile/' + (program == null ? '' : encodeURIComponent(program)) + '/' + (cycle == null ? '' : encodeURIComponent(cycle)), {}); + } + + /** + * This method returns a report that details the user traffic received by a seller's listings. A traffic report gives sellers the ability to review how often their listings appeared on eBay, how many times their listings are viewed, and how many purchases were made. The report also returns the report's start and end dates, and the date the information was last updated. When using this call: Be sure to URL-encode the values you pass in query parameters, as described in URI parameters. See the request samples below for details. You can only specify a single metric in the sort parameter and the specified metric must be listed in the metric parameter of your request. Parameter names are case sensitive, but metric names are not. For example, the following are correct: sort=LISTING_IMPRESSION_TOTAL sort=lisitng_impression_total metric=lisitng_impression_total However, these are incorrect: SORT=LISTING_IMPRESSION_TOTAL SORT=lisitng_impression_total Metric=lisitng_impression_total For more information, see Traffic report details. + * Get traffic_report + * @param {string} dimension This query parameter specifies the dimension, or "attribute," that is applied to the report metric. Valid values: DAY or LISTING Examples If you specify dimension=DAY and metric=CLICK_THROUGH_RATE, the traffic report contains the number of times an item displayed on a search results page and the buyer clicked through to the View Item page for each day in the date range, as in: 12-06-17: 32, 12-07-17: 54, ... If you specify dimension=LISTING and metric=LISTING_IMPRESSION_STORE, the traffic report contains the number of times that listing appeared on the seller's store during the specified date range. For example, LISTING_IMPRESSION_STORE: 157 means the item appeared 157 times in the store during the date range. + * @param {string} filter This query parameter refines the information returned in the traffic report. Configure the following properties of the filter parameter to tune the traffic report to your needs: date_range Limits the report to the specified range of dates. Format the date range by enclosing the earliest date and end date for the report in brackets ("[ ]"), as follows: [YYYYMMDD..YYYYMMDD] The maximum range between the start and end dates is 90 days, and the earliest start date you can specify is two years prior to the current date, which is defined as 730 days (365 * 2), not accounting for Leap Year. The last date for which traffic data exists is a value called lastUpdatedDate. eBay returns an error if you specify a date range greater than 90 days, or the start date is after the lastUpdatedDate. If the specified end date is beyond the lastUpdatedDate, eBay returns data up to the lastUpdatedDate. Required: Always listing_ids This filter limits the results to only the supplied list of listingId values. You can specify to 200 different listingId values. Enclose the list of IDs with curly braces ("{ }"), and separate multiple values with a pipe character ("|"). This filter only returns data for listings that have been either active or sold in last 90 days, and any unsold listings in the last 30 days. All listings must be the seller's and they must be listed on the marketplace specified by the marketplace_ids filter argument. marketplace_ids This filter limits the report to seller data related to only the specified marketplace ID (currently the filter allows only a single marketplace ID). Enclose the marketplace ID in curly braces ("{ }"). Valid values: EBAY_AU EBAY_DE EBAY_GB EBAY_US EBAY_MOTORS Required if you set the dimension parameter to DAY. traffic_source Limits the report to either Promoted Listings items or non-Promoted Listings (organic) items. Valid values are ORGANIC and PROMOTED_LISTINGS. Enclose the list of values with curly braces ("{ }"), and separate multiple values with a pipe character ("|") The default is both values. Example filter parameter The following example shows how to configure the filter parameter with the marketplace_ids and date_range filters: filter=marketplace_ids:{EBAY_US},date_range:[20170601..20170828] Note: You must URL encode all the values you supply in the filter parameter, as described in URL parameters. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/FilterField.html + * @param {string} metric This query parameter specifies the metrics you want covered in the report. Specify a comma-separated list of the metrics you want included in the report. Valid values: CLICK_THROUGH_RATE The number of times an item displays on the search results page divided by the number of times buyers clicked through to its View Item page. Localized name: Click through rate LISTING_IMPRESSION_SEARCH_RESULTS_PAGE The number of times the seller's listings displayed on the search results page. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from the search results page LISTING_IMPRESSION_STORE The number of times the seller's listings displayed on the seller's store. Note, the listing might not have been visible to the buyer due to its position on the page. Localized name: Listing impressions from your Store LISTING_IMPRESSION_TOTAL The total number of times the seller's listings displayed on the search results page OR in the seller's store. The item is counted each time it displays on either page. However, the listing might not have been visible to the buyer due to its position on the page. This is a combination of: LISTING_IMPRESSION_SEARCH_RESULTS_PAGE + LISTING_IMPRESSION_STORE. Localized name: Total listing impressions LISTING_VIEWS_SOURCE_DIRECT The number of times a View Item page was directly accessed, such as when a buyer navigates to the page using a bookmark. Localized name: Direct views LISTING_VIEWS_SOURCE_OFF_EBAY The number of times a View Item page was accessed via a site other than eBay, such as when a buyer clicks on a link to the listing from a search engine page. Localized name: Off eBay views LISTING_VIEWS_SOURCE_OTHER_EBAY The number of times a View Item page was accessed from an eBay page that is not either the search results page or the seller's store. Localized name: Views from non-search and non-store pages within eBay LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE The number of times the item displayed on the search results page. Localized name: Views on the search results page LISTING_VIEWS_SOURCE_STORE The number of times a View Item page was accessed via the seller's store. Localized name: Views from your Store LISTING_VIEWS_TOTAL Total number of listings viewed. This number sums: LISTING_VIEWS_SOURCE_DIRECT LISTING_VIEWS_SOURCE_OFF_EBAY LISTING_VIEWS_SOURCE_OTHER_EBAY LISTING_VIEWS_SOURCE_SEARCH_RESULTS_PAGE LISTING_VIEWS_SOURCE_STORE. Localized name: Total views SALES_CONVERSION_RATE The number of completed transactions divided by the number of View Item page views. Equals: TRANSACTION / LISTING_VIEWS_TOTAL Localized name: Sales conversion rate TRANSACTION The total number of completed transactions. Localized name: Transaction count + * @param {string} sort This query parameter sorts the report on the specified metric. The metric you specify must be included in the configuration of the report's metric parameter. Sorting is helpful when you want to review how a specific metric is performing, such as the CLICK_THROUGH_RATE. Reports can be sorted in ascending or descending order. Precede the value of a descending-order request with a minus sign ("-"), for example: sort=-CLICK_THROUGH_RATE. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/analytics/types/SortField.html + * @return {Report} Success + */ + GetTrafficReport(dimension: string | null | undefined, filter: string | null | undefined, metric: string | null | undefined, sort: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'traffic_report?dimension=' + (dimension == null ? '' : encodeURIComponent(dimension)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&metric=' + (metric == null ? '' : encodeURIComponent(metric)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_compliance.txt b/Tests/SwagTsTests/NG2Results/sell_compliance.ts similarity index 99% rename from Tests/SwagTsTests/NG2Results/sell_compliance.txt rename to Tests/SwagTsTests/NG2Results/sell_compliance.ts index 9ecbdce4..f9011dde 100644 --- a/Tests/SwagTsTests/NG2Results/sell_compliance.txt +++ b/Tests/SwagTsTests/NG2Results/sell_compliance.ts @@ -1,256 +1,256 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ - export interface AspectRecommendations { - - /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ - localizedAspectName?: string | null; - - /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ - suggestedValues?: Array; - } - - - /** This type is used by each listing violation that is returned under the violations container. */ - export interface ComplianceDetail { - - /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ - reasonCode?: string | null; - - /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ - message?: string | null; - - /** This type is used to identify the product variation that has the listing violation. */ - variation?: VariationDetails; - - /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ - violationData?: Array; - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - correctiveRecommendations?: CorrectiveRecommendations; - - /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ - complianceState?: string | null; - } - - - /** This type is used to identify the product variation that has the listing violation. */ - export interface VariationDetails { - - /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ - sku?: string | null; - - /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ - variationAspects?: Array; - } - - - /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ - export interface NameValueList { - - /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - name?: string | null; - - /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ - value?: string | null; - } - - - /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ - export interface CorrectiveRecommendations { - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - productRecommendation?: ProductRecommendation; - - /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ - aspectRecommendations?: Array; - } - - - /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ - export interface ProductRecommendation { - - /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ - epid?: string | null; - } - - - /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ - export interface ComplianceSummary { - - /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ - violationSummaries?: Array; - } - - - /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ - export interface ComplianceSummaryInfo { - - /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - listingCount?: number | null; - } - - - /** This type is used by each listing violation that is returned under the listingViolations container. */ - export interface ComplianceViolation { - - /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ - listingId?: string | null; - - /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ - sku?: string | null; - - /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ - offerId?: string | null; - - /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ - violations?: Array; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is the base response type of the getListingViolations method. */ - export interface PagedComplianceViolationCollection { - - /** - * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI of the getListingViolations call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ - next?: string | null; - - /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ - prev?: string | null; - - /** - * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ - listingViolations?: Array; - } - - - /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ - export interface SuppressViolationRequest { - - /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ - complianceType?: string | null; - - /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ - listingId?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * Get listing_violation_summary - * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. - * @return {void} Success - */ - GetListingViolationsSummary(compliance_type: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. - * Get listing_violation - * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. - * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) - * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. - * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 - * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} - * @return {void} Success - */ - GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. - * Post suppress_listing_violation - * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. - * @return {void} - */ - SuppressViolation(requestBody: SuppressViolationRequest): Observable> { - return this.http.post(this.baseUri + 'suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** This type is used by the aspectsRecommendation container, which is returned if eBay has found a listing with missing or invalid item aspects (ASPECTS_ADOPTION compliance type). */ + export interface AspectRecommendations { + + /** The name of the item aspect for which eBay has a recommendation. In many cases, the same item aspect(s) that are returned under the violationData array for ASPECTS_ADOPTION listing violations are also returned here Note: This name is always localized for the specified marketplace. */ + localizedAspectName?: string | null; + + /** One or more valid values for the corresponding item aspect (in localizedAspectName) are returned here. These suggested values for the item aspect depend on the listing category and on the information specified in the listing. Sellers should confirm accuracy of the values before applying them to the listing. Please use getItemAspectsForCategory in the Taxonomy API or GetCategorySpecifics in the Trading API to get a comprehensive list of required and recommended aspects for a given category and a list of supported aspect values for each. */ + suggestedValues?: Array; + } + + + /** This type is used by each listing violation that is returned under the violations container. */ + export interface ComplianceDetail { + + /** This value states the nature of the listing violation. A reasonCode value is returned for each listing violation, and each compliance type can have several reason codes and related messages. The reasonCode values vary by compliance type. The reason codes for each compliance type are summarized below. Aspects adoption The reason codes for ASPECTS_ADOPTION compliance indicate that for the given violation, aspects listed in the violationData container are either missing from the listing or they have invalid values. The reason codes specify whether the violation is for required aspects or recommended (preferred) aspects. MISSING_OR_INVALID_REQUIRED_ASPECTS MISSING_OR_INVALID_PREFERRED_ASPECTS HTTPS The reason codes for HTTPS compliance identify where in the listing the violation occurs. For HTTPS policy violations, the seller will just need to remove the HTTP link (or update to HTTPS) from the listing details or product details: NON_SECURE_HTTP_LINK_IN_LISTING NON_SECURE_HTTP_LINK_IN_PRODUCT Non-eBay links The reason codes for OUTSIDE_EBAY_BUYING_AND_SELLING compliance identify the specific type of data (e.g., telephone number) that violated the policy. For each of these violations, the seller will just need to revise the listing, removing this information: UNAPPROVED_DOMAIN_WEBLINK_IN_LISTING PHONE_NUMBER_IN_LISTING EMAIL_ADDRESS_IN_LISTING Product adoption Product Adoption is not enforced at this time. Product adoption conformance Product Adoption is not enforced at this time. Returns policy The only RETURNS_POLICY reason code is UNSUPPORTED_RETURNS_PERIOD. The seller will have to revise their listing (or return business policy) with a supported return period for the site and category. The GetCategoryFeatures call of the Trading API can be used to verify the supported return periods for a particular category. For most eBay categories, the minimum return period that can be stated in a Returns Policy is 14 days for domestic and international sales, but some categories require a minimum 30-day return period. */ + reasonCode?: string | null; + + /** This field provides a textual summary of the listing violation. A message field is returned for each listing violation. This message will vary widely based on the compliance type and corresponding reason code. */ + message?: string | null; + + /** This type is used to identify the product variation that has the listing violation. */ + variation?: VariationDetails; + + /** This container provides more information about the listing violation, if applicable. The type of information that appears here will vary based on the compliance type and type of violation. For example, for ASPECTS_ADOPTION violations, this container lists the missing aspect(s) or aspect(s) with invalid values. */ + violationData?: Array; + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + correctiveRecommendations?: CorrectiveRecommendations; + + /** The enumeration value returned in this field indicates if the listing violation is considered to be OUT_OF_COMPLIANCE with an eBay listing policy, or the listing is considered to be AT_RISK of becoming non-compliant against an eBay listing policy. Generally, OUT_OF_COMPLIANCE policy violations can prevent the seller from revising a listing until the underlying violation(s) can be remedied. When the compliance state is AT_RISK, the seller is not blocked from revising the listing, but the seller should correct the violation to prevent the listing from being blocked for revisions in the future. Note: This field is returned for most violations, but not all. In the case that this field is not returned, it can be assumed that the state of the listing violation is OUT_OF_COMPLIANCE. For implementation help, refer to eBay API documentation */ + complianceState?: string | null; + } + + + /** This type is used to identify the product variation that has the listing violation. */ + export interface VariationDetails { + + /** The seller-defined SKU value of the variation within the multiple-variation listing with the violation{s). This field is only returned if a seller-defined SKU value is defined for the variation. SKU values are optional in listing except when creating listings using the Inventory API. */ + sku?: string | null; + + /** An array of one or more variation aspects that define a variation within a multiple-variation listing. The aspect{s) returned here define the individual variation, because these aspects will differ for each variation. Common varying aspects include color and size. */ + variationAspects?: Array; + } + + + /** This type is used to provide a name-value pair, including the identifying aspects of a product variation through the variationAspectscontainer. */ + export interface NameValueList { + + /** This is the name of the variation aspect, or the name of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + name?: string | null; + + /** This is the value of the variation aspect (in name field), or the value of the category of information that is returned through the name-value pair. The type of information that appears here will vary based on the compliance type and type of violation. */ + value?: string | null; + } + + + /** This type is used by the correctiveRecommendations container, which is returned if eBay has suggestions for how to correct the given violation. */ + export interface CorrectiveRecommendations { + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + productRecommendation?: ProductRecommendation; + + /** This container is returned for ASPECTS_ADOPTION violations if eBay has found one or more item aspect name-value pairs that may be appropriate for the seller's product. In many cases, the missing or invalid item aspect(s) shown under the corresponding violationData array, will also show up under this array with suggested value(s). */ + aspectRecommendations?: Array; + } + + + /** This type is used by the productRecommendation container, which is returned if eBay has found an eBay catalog product that may be a match for the product (or product variation) that has a listing violation. Note: eBay catalog product adoption is not enforced at this time, so product adoption violations are no longer returned. Due to this fact, this type and productRecommendation container are not currently applicable. */ + export interface ProductRecommendation { + + /** This field will return the eBay Product ID {ePID) of an eBay Catalog product that eBay recommends that the seller use to make their listing compliant. Note: Product Adoption is not enforced at this time. Product Adoption violations are no longer returned. */ + epid?: string | null; + } + + + /** This type is the base type for the getListingViolationsSummary response. The violationSummaries container contains an array of policy violation counts for each unique eBay marketplace and compliance type violation. */ + export interface ComplianceSummary { + + /** This container is an array of one or more policy violation counts. A policy violation count is returned for each unique eBay marketplace and compliance type violation. As long as there is at least one non-compliant listing for the specified compliance type(s), this container will be returned. If no non-compliant listings are found for the specified compliance type(s), an HTTP status code of 204 No Content is returned, and there is no response body. */ + violationSummaries?: Array; + } + + + /** This type is used by each unique eBay marketplace and compliance type combination that is returned in the getListingViolationsSummary response to indicate the total number of listing violations in regards to that eBay marketplace and compliance type. */ + export interface ComplianceSummaryInfo { + + /** This enumeration value indicates the type of compliance. See ComplianceTypeEnum for more information on each compliance type. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** This enumeration value indicates the eBay marketplace where the listing violations exist. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This integer value indicates the number of eBay listings that are currently violating the compliance type indicated in the complianceType field, for the eBay marketplace indicated in the marketplaceId field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + listingCount?: number | null; + } + + + /** This type is used by each listing violation that is returned under the listingViolations container. */ + export interface ComplianceViolation { + + /** This enumeration value indicates the compliance type of listing violation. See ComplianceTypeEnum for more information on each compliance type. This will always be returned for each listing violation that is found. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the eBay listing that currently has the corresponding listing violation{s). This field will always be returned for each listing that has one or more violations. */ + listingId?: string | null; + + /** The seller-defined SKU value of the product in the listing with the violation{s). This field is only returned if defined in the listing. SKU values are optional in listings except when creating listings using the Inventory API model. */ + sku?: string | null; + + /** Note: This field is for future use, and will not be returned, even for listings created through the Inventory API. The unique identifier of the offer. This field is only applicable and returned for listings that were created through the Inventory API. To convert an Inventory Item object into an eBay listing, an Offer object must be created and published. */ + offerId?: string | null; + + /** This container consists of an array of one or more listing violations applicable to the eBay listing specified in the listingId field. This array is returned for each eBay listing that has one or more violations. For each returned violation, the fields that are returned and the details that are given will depend on the listing violation. */ + violations?: Array; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is the base response type of the getListingViolations method. */ + export interface PagedComplianceViolationCollection { + + /** + * This integer value shows the offset of the current page of results. The offset value controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting collection of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. Default: 0 {zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI of the getListingViolations call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The total number of listing violations in the result set. If this value is higher than the limit value, there are multiple pages in the result set to view. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** The getListingViolations call URI to use to view the next page of the result set. For example, the following URI returns listing violations 21 thru 30 from the collection of policy violations: path/listing_violation?limit=10&offset=20 This field is only returned if an additional page of listing violations exists. */ + next?: string | null; + + /** The getListingViolations call URI to use to view the previous page of the result set. For example, the following URI returns listing violations 1 thru 10 from the collection of policy violations: path/listing_violation?limit=10&offset=0 This field is only returned if an previous page of listing violations exists. */ + prev?: string | null; + + /** + * The maximum number of listing violations returned per page of the result set. The limit and offset query parameters are used to control the pagination of the output. Note: If this is the last or only page in the result set, it may contain fewer listing violations than the limit value. To determine the number of pages in the result set, divide this value into the value of total and round up to the next integer. Default: 50 Max: 200 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of listing violations that match the criteria in the call request, including pagination control {if set). As long as there is at least one listing violation that matches the input criteria, this container will be returned. If no listing violations are found for the seller, an HTTP status code of 204 No Content is returned, and there is no response body. */ + listingViolations?: Array; + } + + + /** This is the base request type of the suppressViolation method, and is used to identify the listing violation that the seller wishes to suppress. */ + export interface SuppressViolationRequest { + + /** The compliance type of the listing violation to suppress is specified in this field. The compliance type for each listing violation is found in the complianceType field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so ASPECTS_ADOPTION is currently the only supported value for this field. For implementation help, refer to eBay API documentation */ + complianceType?: string | null; + + /** The unique identifier of the listing with the violation(s) is specified in this field. The unique identifier of the listing with the listing violation(s) is found in the listingId field under the listingViolations array in a getListingViolations response. Note: At this time, the suppressViolation method is only used to suppress aspect adoption listing violations in the 'at-risk' state, so the listing specified in this field should be a listing with an ASPECTS_ADOPTION violation in the 'at-risk' state. */ + listingId?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This call returns listing violation counts for a seller. A user can pass in one or more compliance types through the compliance_type query parameter. See ComplianceTypeEnum for more information on the supported listing compliance types. Listing violations are returned for multiple marketplaces if the seller sells on multiple eBay marketplaces. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * Get listing_violation_summary + * @param {string} compliance_type A user passes in one or more compliance type values through this query parameter. See ComplianceTypeEnum for more information on the supported compliance types that can be passed in here. If more than one compliance type value is used, delimit these values with a comma. If no compliance type values are passed in, the listing count for all compliance types will be returned. Note: Only a canned response, with counts for all listing compliance types, is returned in the Sandbox environment. Due to this limitation, the compliance_type query parameter (if used) will not have an effect on the response. + * @return {void} Success + */ + GetListingViolationsSummary(compliance_type: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'listing_violation_summary?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call returns specific listing violations for the supported listing compliance types. Only one compliance type can be passed in per call, and the response will include all the listing violations for this compliance type, and listing violations are grouped together by eBay listing ID. See ComplianceTypeEnum for more information on the supported listing compliance types. This method also has pagination control. Note: A maximum of 2000 listing violations will be returned in a result set. If the seller has more than 2000 listing violations, some/all of those listing violations must be corrected before additional listing violations will be retrieved. The user should pay attention to the total value in the response. If this value is '2000', it is possible that the seller has more than 2000 listing violations, but this field maxes out at 2000. Note: In a future release of this API, the seller will be able to pass in a specific eBay listing ID as a query parameter to see if this specific listing has any violations. Note: Only mocked non-compliant listing data will be returned for this call in the Sandbox environment, and not specific to the seller. However, the user can still use this mock data to experiment with the compliance type filters and pagination control. + * Get listing_violation + * @param {string} compliance_type A seller uses this query parameter to retrieve listing violations of a specific compliance type. Only one compliance type value should be passed in here. See ComplianceTypeEnum for more information on the compliance types that can be passed in here. If the listing_id query parameter is used, the compliance_type query parameter {if passed in) will be ignored. This is because all of a listing's policy violations {each compliance type) will be returned if a listing_id is provided. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Note: The listing_id query parameter is not yet available for use, so the seller does not have the ability to retrieve listing violations for one or more specific listings. Until the listing_id query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. + * @param {string} offset The integer value input into this field controls the first listing violation in the result set that will be displayed at the top of the response. The offset and limit query parameters are used to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the resulting set of violations. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 0 {zero) + * @param {string} listing_id Note: This query parameter is not yet supported for the Compliance API. Please note that until this query parameter becomes available, the compliance_type query parameter is required with each getListingViolations call. This query parameter is used if the user wants to view all listing violations for one or more eBay listings. The string value passed into this field is the unique identifier of the listing, sometimes referred to as the Item ID. Either the listing_id or a compliance_type query parameter must be used, and if the seller only wants to view listing violations of a specific compliance type, both of these parameters can be used. Up to 50 listing IDs can be specified with this query parameter, and each unique listing ID is separated with a comma. + * @param {string} limit This query parameter is used if the user wants to set a limit on the number of listing violations that are returned on one page of the result set. This parameter is used in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves listing violations 11 thru 20 from the collection of listing violations that match the value set in the compliance_type parameter. Note: This feature employs a zero-based index, where the first item in the list has an offset of 0. If the listing_id parameter is included in the request, this parameter will be ignored. Default: 100 Maximum: 200 + * @param {string} filter This filter allows a user to retrieve only listings that are currently out of compliance, or only listings that are at risk of becoming out of compliance. Although other filters may be added in the future, complianceState is the only supported filter type at this time. The two compliance 'states' are OUT_OF_COMPLIANCE and AT_RISK. Below is an example of how to set up this compliance state filter. Notice that the filter type and filter value are separated with a colon (:) character, and the filter value is wrapped with curly brackets. filter=complianceState:{OUT_OF_COMPLIANCE} + * @return {void} Success + */ + GetListingViolations(compliance_type: string | null | undefined, offset: string | null | undefined, listing_id: string | null | undefined, limit: string | null | undefined, filter: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'listing_violation?compliance_type=' + (compliance_type == null ? '' : encodeURIComponent(compliance_type)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&filter=' + (filter == null ? '' : encodeURIComponent(filter)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call suppresses a listing violation for a specific listing. Only listing violations in the AT_RISK state (returned in the violations.complianceState field of the getListingViolations call) can be suppressed. Note: At this time, the suppressViolation call only supports the suppressing of ASPECTS_ADOPTION listing violations in the AT_RISK state. In the future, it is possible that this method can be used to suppress other listing violation types. A successful call returns a http status code of 204 Success. There is no response payload. If the call is not successful, an error code will be returned stating the issue. + * Post suppress_listing_violation + * @param {SuppressViolationRequest} requestBody This type is the base request type of the SuppressViolation method. + * @return {void} + */ + SuppressViolation(requestBody: SuppressViolationRequest): Observable> { + return this.http.post(this.baseUri + 'suppress_listing_violation', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_finances.txt b/Tests/SwagTsTests/NG2Results/sell_finances.ts similarity index 99% rename from Tests/SwagTsTests/NG2Results/sell_finances.txt rename to Tests/SwagTsTests/NG2Results/sell_finances.ts index a6f3ffcd..7e2fbf3f 100644 --- a/Tests/SwagTsTests/NG2Results/sell_finances.txt +++ b/Tests/SwagTsTests/NG2Results/sell_finances.ts @@ -1,393 +1,393 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - export interface Amount { - - /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ - value?: string | null; - } - - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - export interface Buyer { - - /** The eBay user ID of the order's buyer. */ - username?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ - export interface Payout { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ - payoutDate?: string | null; - - /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ - payoutId?: string | null; - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - payoutInstrument?: PayoutInstrument; - - /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ - payoutStatus?: string | null; - - /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ - payoutStatusDescription?: string | null; - - /** - * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ - export interface PayoutInstrument { - - /** This string value is the last four digits of the seller's account number. */ - accountLastFourDigits?: string | null; - - /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ - instrumentType?: string | null; - - /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ - nickname?: string | null; - } - - - /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ - export interface PayoutSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** - * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - payoutCount?: number | null; - - /** - * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - transactionCount?: number | null; - } - - - /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ - export interface Payouts { - - /** The URI of the getPayouts call request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ - payouts?: Array; - - /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ - export interface SellerFundsSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - availableFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - fundsOnHold?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - processingFunds?: Amount; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - totalFunds?: Amount; - } - - - /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ - export interface Transaction { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - amount?: Amount; - - /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ - bookingEntry?: string | null; - - /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ - buyer?: Buyer; - - /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ - orderId?: string | null; - - /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ - payoutId?: string | null; - - /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ - salesRecordReference?: string | null; - - /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ - transactionDate?: string | null; - - /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ - transactionId?: string | null; - - /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ - transactionMemo?: string | null; - - /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ - transactionStatus?: string | null; - - /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ - transactionType?: string | null; - } - - - /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ - export interface TransactionSummaryResponse { - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - creditAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ - creditBookingEntry?: string | null; - - /** - * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - creditCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - disputeAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ - disputeBookingEntry?: string | null; - - /** - * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - disputeCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - onHoldAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ - onHoldBookingEntry?: string | null; - - /** - * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - onHoldCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - refundAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ - refundBookingEntry?: string | null; - - /** - * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - refundCount?: number | null; - - /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ - shippingLabelAmount?: Amount; - - /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ - shippingLabelBookingEntry?: string | null; - - /** - * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - shippingLabelCount?: number | null; - } - - - /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ - export interface Transactions { - - /** The URI of the getTransactions method request that produced the current page of the result set. */ - href?: string | null; - - /** - * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ - next?: string | null; - - /** - * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ - prev?: string | null; - - /** - * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ - transactions?: Array; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. - * Get payout/{payout_Id} - * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. - * @return {Payout} Success - */ - GetPayout(payout_Id: string): Observable { - return this.http.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}); - } - - /** - * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. - * Get payout - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) - * @return {Payouts} Success - */ - GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. - * Get payout_summary - * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {PayoutSummaryResponse} Success - */ - GetPayoutSummary(filter: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. - * Get transaction - * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html - * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 - * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) - * @return {Transactions} Success - */ - GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). - * Get transaction_summary - * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html - * @return {TransactionSummaryResponse} Success - */ - GetTransactionSummary(filter: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. - * Get seller_funds_summary - * @return {SellerFundsSummaryResponse} Success - */ - GetSellerFundsSummary(): Observable { - return this.http.get(this.baseUri + 'seller_funds_summary', {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + export interface Amount { + + /** A three-letter ISO 4217 code that indicates the currency of the amount in the value field. This field is always returned with the amount container. Default: The currency of the authenticated user's country. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. This field is always returned with the amount container. */ + value?: string | null; + } + + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + export interface Buyer { + + /** The eBay user ID of the order's buyer. */ + username?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** This type is used to express the details of one seller payout that is returned with the getPayout or getPayouts methods. */ + export interface Payout { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** This timestamp indicates when the seller payout began processing. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. This field is still returned even if the payout was pending but failed (payoutStatus value shows RETRYABLE_FAILED or TERMINAL_FAILED). */ + payoutDate?: string | null; + + /** The unique identifier of the seller payout. This identifier is generated once eBay begins processing the payout to the seller's bank account. */ + payoutId?: string | null; + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + payoutInstrument?: PayoutInstrument; + + /** This enumeration value indicates the current status of the seller payout. For a successful payout, the value returned will be SUCCEEDED. See the PayoutStatusEnum type for more details on each payout status value. For implementation help, refer to eBay API documentation */ + payoutStatus?: string | null; + + /** This field provides more details about the current status of payout. The description returned here will correspond with enumeration value returned in the payoutStatus field. The following shows what description text might appear based on the different payoutStatus values: INITIATED: Preparing to send SUCCEEDED: Funds sent REVERSED: Waiting to retry : Money rejected by seller's bank RETRYABLE_FAILED: Waiting to retry TERMINAL_FAILED: Payout failed */ + payoutStatusDescription?: string | null; + + /** + * This integer value indicates the number of monetary transactions (all orders, refunds, and credits, etc.) that have occurred with the corresponding payout. Its value should always be at least 1, since there is at least one order per seller payout. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type provides details about the seller's account that received (or is scheduled to receive) a payout. */ + export interface PayoutInstrument { + + /** This string value is the last four digits of the seller's account number. */ + accountLastFourDigits?: string | null; + + /** This string value indicates the type of account that received the payout. At this time, seller payouts can only be distributed to bank acounts, so the string value returned in this field will always be BankAccount. */ + instrumentType?: string | null; + + /** This string value is a seller-provided nickname that the seller uses to represent the bank account. */ + nickname?: string | null; + } + + + /** This type is the base response type of the getPayoutSummary method, and contains the total count of seller payouts (that match the input criteria), the total count of monetary transactions (order payment, buyer refunds, or seller credits) associated with those payouts, and the total value of those seller payouts. */ + export interface PayoutSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** + * This integer value indicates the total count of payouts to the seller that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + payoutCount?: number | null; + + /** + * This integer value indicates the total count of monetary transactions (order payments, buyer refunds, and seller credits) associated with the payouts that match the input criteria. This field is always returned, even if there are no payouts that match the input criteria (its value will show 0). If there is at least one payout that matches the input criteria, the value in this field will be at least 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + transactionCount?: number | null; + } + + + /** This type is the base response type of the getPayouts method, and contains an array of one or more payouts (that match the input criteria), the total count of payouts in the response, and various pagination data for the results set. */ + export interface Payouts { + + /** The URI of the getPayouts call request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of payouts that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer payouts than the limit value. To determine the number of pages in a result set, divide the total value (total number of payouts matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total payouts) and the limit value was 50 (show 50 payouts per page), the total number of pages in the result set is three, so the seller would have to make three separate getPayouts calls to view all payouts matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getPayouts call URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the call retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** An array of one or more payouts that match the input criteria. Details for each payout include the unique identifier of the payout, the status of the payout, the amount of the payout, and the number of monetary transactions associated with the payout. */ + payouts?: Array; + + /** The getPayouts call URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total number of payouts in the results set based on the current input criteria. Based on the total number of payouts that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the response payload of the getSellerFundsSummary method. All of the funds returned in getSellerFundsSummary are funds that have not yet been paid to the seller through a seller payout. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. */ + export interface SellerFundsSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + availableFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + fundsOnHold?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + processingFunds?: Amount; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + totalFunds?: Amount; + } + + + /** This type is used to express the details of one of the following monetary transactions: a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, or a credit issued by eBay to the seller's account. */ + export interface Transaction { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + amount?: Amount; + + /** The enumeration value returned in this field indicates if the monetary transaction amount is a (CREDIT) or a (DEBIT) to the seller's account. Typically, the SALE and CREDIT transaction types are credits to the seller's account, and the REFUND, DISPUTE, and SHIPPING_LABEL transaction types are debits to the seller's account. For implementation help, refer to eBay API documentation */ + bookingEntry?: string | null; + + /** This type is used to express details about the buyer associated with an order. At this time, the only field in this type is the eBay user ID of the buyer, but more fields may get added at a later date. */ + buyer?: Buyer; + + /** The unique identifier of the order associated with the monetary transaction. Note: eBay rolled out a new Order ID format in June 2019. Until April 2020, the legacy APIs still support both the old and new order ID format, but only the new order ID format is supported in REST-based APIs. */ + orderId?: string | null; + + /** The unique identifier of the seller payout associated with the monetary transaction. This identifier is generated once eBay begins processing the payout for the corresponding order. This field will not be returned if eBay has not yet begun processing the payout for an order. */ + payoutId?: string | null; + + /** The Sales Record Number associated with a sales order. Sales Record Numbers are Selling Manager/Selling Manager Pro identifiers that are created at order checkout. Note: For all orders originating after February 1, 2020, a value of 0 will be returned in this field. The Sales Record Number field has also been removed from Seller Hub. Instead of salesRecordReference, depend on orderId instead as the identifier of the order. The salesRecordReference field has been scheduled for deprecation, and a date for when this field will no longer be returned at all will be announced soon. */ + salesRecordReference?: string | null; + + /** This timestamp indicates when the monetary transaction (order purchase, buyer refund, seller credit) occurred. The following format is used: YYYY-MM-DDTHH:MM:SS.SSSZ. For example, 2015-08-04T19:09:02.768Z. */ + transactionDate?: string | null; + + /** The unique identifier of the monetary transaction. A monetary transaction can be a sales order, an order refund to the buyer, a credit to the seller's account, a debit to the seller for the purchase of a shipping label, or a transaction where eBay recouped money from the seller if the seller lost a buyer-initiated payment dispute. */ + transactionId?: string | null; + + /** This field provides more details on a shipping label transaction, such as a purchase, a refund, or a price adjustment to the cost of the shipping label. This field is only returned if applicable/available. Currently, this field is only used for shipping label transactions, but it is possible that it will be used for other transaction types in the future. */ + transactionMemo?: string | null; + + /** This enumeration value indicates the current status of the seller payout associated with the monetary transaction. See the TransactionStatusEnum type for more information on the different states. For implementation help, refer to eBay API documentation */ + transactionStatus?: string | null; + + /** This enumeration value indicates whether the monetary transaction is a buyer's payment for an order, a refund to the buyer for a returned item or cancelled order, a credit issued by eBay to the seller's account, a payment dispute between the buyer and seller, or where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers. For implementation help, refer to eBay API documentation */ + transactionType?: string | null; + } + + + /** This type is the base response type of the getTransactionSummary method, and based on the filters that are used in the getTransactionSummary call URI, the response may include total count and amount of the seller's sales and credits, total count and amount of buyer refunds, and total count and amount of seller payment holds. */ + export interface TransactionSummaryResponse { + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + creditAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the creditAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT. For implementation help, refer to eBay API documentation */ + creditBookingEntry?: string | null; + + /** + * This integer value indicates the total number of the seller's sales and/or credits that match the input criteria. Note: Unless the transactionType filter is used in the request to retrieve a specific type of monetary transaction (sale, buyer refund, or seller credit), the creditCount and creditAmount fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to either REFUND, DISPUTE, or SHIPPING_LABEL. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + creditCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + disputeAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the disputeAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, but its possible that CREDIT could be returned if the seller contested one or more payment disputes and won the dispute. For implementation help, refer to eBay API documentation */ + disputeBookingEntry?: string | null; + + /** + * This integer value indicates the total number of payment disputes that have been initiated by one or more buyers. Only the orders that match the input criteria are considered. The Payment Disputes methods in the Fulfillment API can be used by the seller to retrieve more information about any payment disputes. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than DISPUTE. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + disputeCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + onHoldAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the onHoldAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be CREDIT, since on-hold funds should eventually be released as part of a payout to the seller once the hold is cleared. For implementation help, refer to eBay API documentation */ + onHoldBookingEntry?: string | null; + + /** + * This integer value indicates the total number of order sales where the associated funds are on hold. Only the orders that match the input criteria are considered. This field is generally returned, even if 0, but it will not be returned if a transactionStatus filter is used, and its value is set to any value other than FUNDS_ON_HOLD. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + onHoldCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + refundAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the refundAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT since this a refund from the seller to the buyer. For implementation help, refer to eBay API documentation */ + refundBookingEntry?: string | null; + + /** + * This integer value indicates the total number of buyer refunds that match the input criteria. This field is generally returned, even if 0, but it will not be returned if a transactionType filter is used, and its value is set to any value other than REFUND. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + refundCount?: number | null; + + /** This type is used to express the dollar value and currency used for any transaction retrieved with the Finances API, including an order total, a seller payout, a buyer refund, or a seller credit. */ + shippingLabelAmount?: Amount; + + /** The enumeration value indicates whether the dollar amount in the shippingLabelAmount field is a charge (debit) to the seller or a credit. Typically, the enumeration value returned here will be DEBIT, as eBay will charge the seller when eBay shipping labels are purchased, but it can be CREDIT if the seller was refunded for a shipping label or was possibly overcharged for a shipping label. For implementation help, refer to eBay API documentation */ + shippingLabelBookingEntry?: string | null; + + /** + * This is the total number of eBay shipping labels purchased by the seller. The count returned here may depend on the specified input criteria. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + shippingLabelCount?: number | null; + } + + + /** This is the base response type of the getTransactions method. The getTransactions response includes details on one or more monetary transactions that match the input criteria, as well as pagination data. */ + export interface Transactions { + + /** The URI of the getTransactions method request that produced the current page of the result set. */ + href?: string | null; + + /** + * The maximum number of monetary transactions that may be returned per page of the result set. The limit value can be passed in as a query parameter, or if omitted, its value defaults to 20. Note: If this is the last or only page of the result set, the page may contain fewer monetary transactions than the limit value. To determine the number of pages in a result set, divide the total value (total number of monetary transactions matching input criteria) by this limit value, and then round up to the next integer. For example, if the total value was 120 (120 total monetary transactions) and the limit value was 50 (show 50 monetary transactions per page), the total number of pages in the result set is three, so the seller would have to make three separate getTransactions calls to view all monetary transactions matching the input criteria. Maximum: 200 Default: 20 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The getTransactions method URI to use if you wish to view the next page of the result set. This field is only returned if there is a next page of results to view based on the current input criteria. */ + next?: string | null; + + /** + * This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves monetary transactions 31 thru 40 from the resulting collection of monetary transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The getTransactions method URI to use if you wish to view the previous page of the result set. This field is only returned if there is a previous page of results to view based on the current input criteria. */ + prev?: string | null; + + /** + * This integer value is the total amount of monetary transactions in the result set based on the current input criteria. Based on the total number of monetary transactions that match the criteria, and on the limit and offset values, there may be additional pages in the results set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** An array of one or more monetary transactions that match the input criteria. Details for each monetary transaction may include the unique identifier of the order associated with the monetary transaction, the status of the transaction, the amount of the order, the order's buyer, and the unique identifier of the payout (if a payout has been initiated/issued for the order). */ + transactions?: Array; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method retrieves details on a specific seller payout. The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub. + * Get payout/{payout_Id} + * @param {string} payout_Id The unique identfier of the payout is passed in as a path parameter at the end of the call URI. The getPayouts method can be used to retrieve the unique identifier of a payout, or the user can check Seller Hub to get the payout ID. + * @return {Payout} Success + */ + GetPayout(payout_Id: string): Observable { + return this.http.get(this.baseUri + 'payout/' + (payout_Id == null ? '' : encodeURIComponent(payout_Id)), {}); + } + + /** + * This method is used to retrieve the details of one or more seller payouts. By using the filter query parameter, users can retrieve payouts processed within a specific date range, and/or they can retrieve payouts in a specific state. There are also pagination and sort query parameters that allow users to control the payouts that are returned in the response. If no payouts match the input criteria, an empty payload is returned. + * Get payout + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, all recent payouts in all states are returned: payoutDate: search for payouts within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: search for payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: search for successful payouts. RETRYABLE_FAILED: search for payouts that failed, but ones which will be tried again. TERMINAL_FAILED: search for payouts that failed, and ones that will not be tried again. REVERSED: search for payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, payouts must satisfy both criteria to be returned. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort By default, payouts that match the input criteria are sorted in ascending order according to the payout date (oldest payouts returned first). To view payouts in descending order instead (most recent payouts first), you would include the sort query parameter, and then set the value of its field parameter to payoutDate. Below is the proper syntax to use if filtering by a date range in descending order: https://apiz.ebay.com/sell/finances/v1/payout?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z]&sort=payoutDate Payouts can only be sorted according to payout date, and can not be sorted by payout status. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of payouts to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves payouts 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first payout returned on the current page has in the results set. So, if you wanted to view the 11th payout of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves payouts 31 thru 40 from the resulting collection of payouts. Note: This feature employs a zero-based list, where the first payout in the results set has an offset value of 0. Default: 0 (zero) + * @return {Payouts} Success + */ + GetPayouts(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'payout?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method is used to retrieve cumulative values for payouts in a particular state, or all states. The metadata in the response includes total payouts, the total number of monetary transactions (sales, refunds, credits) associated with those payouts, and the total dollar value of all payouts. If the filter query parameter is used to filter by payout status, only one payout status value may be used. If the filter query parameter is not used to filter by a specific payout status, cumulative values for payouts in all states are returned. The user can also use the filter query parameter to specify a date range, and then only payouts that were processed within that date range are considered. + * Get payout_summary + * @param {string} filter The two filter types that can be used here are discussed below. One or both of these filter types can be used. If none of these filters are used, the data returned in the response will reflect payouts, in all states, processed within the last 90 days. payoutDate: consider payouts processed within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutDate:[2018-12-17T00:00:01.000Z..2018-12-24T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. payoutStatus: consider only the payouts in a particular state. Only one payout state can be specified with this filter. The supported payoutStatus values are as follows: INITIATED: search for payouts that have been initiated but not processed. SUCCEEDED: consider only successful payouts. RETRYABLE_FAILED: consider only payouts that failed, but ones which will be tried again. TERMINAL_FAILED: consider only payouts that failed, and ones that will not be tried again. REVERSED: consider only payouts that were reversed. Below is the proper syntax to use if filtering by payout status: https://apiz.ebay.com/sell/finances/v1/payout_summary?filter=payoutStatus:{SUCCEEDED} If both the payoutDate and payoutStatus filters are used, only the payouts that satisfy both criteria are considered in the results. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {PayoutSummaryResponse} Success + */ + GetPayoutSummary(filter: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'payout_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method allows a seller to retrieve one or monetary transactions. In this case, 'monetary transactions' include sales orders, buyer refunds, seller credits, buyer-initiated payment disputes, and eBay shipping label purchases. There are numerous input filters available for use, including filters to retrieve specific types of monetary transactions, to retrieve monetary transactions processed within a specific date range, or to retrieve monetary transactions in a specific state. See the filter field for more information on each filter, and how each one is used. There are also pagination and sort query parameters that allow users to further control the monetary transactions that are returned in the response. If no monetary transactions match the input criteria, an http status code of 204 No Content is returned with no response payload. + * Get transaction + * @param {string} filter Numerous filters are available for the getTransactions method, and these filters are discussed below. One or more of these filter types can be used. If none of these filters are used, all monetary transactions from the last 90 days are returned: transactionDate: search for monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: search for a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionType:{SALE} transactionStatus: this filter type is only applicable for sales orders, and allows the user to filter seller payouts in a particular state. The supported transactionStatus values are as follows: PAYOUT: this indicates that the proceeds from the corresponding sales order has been paid out to the seller's account. FUNDS_PROCESSING: this indicates that the funds for the corresponding monetary transaction are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: this indicates that the proceeds from the corresponding sales order are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: this indicates that the proceeds from the corresponding sales order are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use if filtering by transaction status: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionStatus:{PAYOUT} buyerUsername: the eBay user ID of the buyer involved in the monetary transaction. Only monetary transactions involving this buyer are returned. Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction?filter=buyerUsername:{buyer1234} salesRecordReference: the unique Selling Manager identifier of the order involved in the monetary transaction. Only monetary transactions involving this Selling Manager Sales Record ID are returned. Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: the unique identifier of a seller payout. This value is auto-generated by eBay once the seller payout is set to be processed. Only monetary transactions involving this Payout ID are returned. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the sales order defined by the identifier is returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @param {string} sort Sorting is not yet available for the getTransactions method. By default, monetary transactions that match the input criteria are sorted in descending order according to the transaction date. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/SortField.html + * @param {string} limit The number of monetary transactions to return per page of the result set. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the method retrieves monetary transactions 11 thru 20 from the result set. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. If an orderId, transactionId, or payoutId filter is included in the request, any limit value will be ignored. Maximum: 200 Default: 20 + * @param {string} offset This integer value indicates the actual position that the first monetary transaction returned on the current page has in the results set. So, if you wanted to view the 11th monetary transaction of the result set, you would set the offset value in the request to 10. In the request, you can use the offset parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 30 and limit is set to 10, the method retrieves transactions 31 thru 40 from the resulting collection of transactions. Note: This feature employs a zero-based list, where the first item in the list has an offset of 0. Default: 0 (zero) + * @return {Transactions} Success + */ + GetTransactions(filter: string | null | undefined, sort: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'transaction?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method is used to retrieve cumulative values for five types of monetary transactions (order sales, seller credits, buyer refunds, buyer-initiated payment disputes, and eBay shipping label purchases). If applicable, the number of payment holds and the amount of the holds are also returned. See the description for the filter query parameter for more information on the available filters. Note: Unless the transactionType filter is used to retrieve a specific type of monetary transaction (sale, buyer refund, seller credit, payment dispute, shipping label), the creditCount and creditAmount response fields account for both order sales and seller credits (the count and value is not distinguished between the two monetary transaction types). + * Get transaction_summary + * @param {string} filter Numerous filters are available for the getTransactionSummary method, and these filters are discussed below. One or more of these filter types can be used. The transactionStatus filter must be used. All other filters are optional. transactionStatus: the data returned in the response will only pertain to the seller payout status set here. The supported transactionStatus values are as follows: PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) have been paid out to the seller's bank account. FUNDS_PROCESSING: only consider monetary transactions where the proceeds from the sales order(s) are currently being processed. FUNDS_AVAILABLE_FOR_PAYOUT: only consider monetary transactions where the proceeds from the sales order(s) are available for a seller payout, but processing has not yet begun. FUNDS_ON_HOLD: only consider monetary transactions where the proceeds from the sales order(s) are currently being held by eBay, and are not yet available for a seller payout.Below is the proper syntax to use when setting up the transactionStatus filter: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionStatus:{PAYOUT} transactionDate: only consider monetary transactions that occurred within a specific range of dates. The date format to use is YYYY-MM-DDTHH:MM:SS.SSSZ. Below is the proper syntax to use if filtering by a date range: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionDate:[2018-10-23T00:00:01.000Z..2018-11-09T00:00:01.000Z] Alternatively, the user could omit the ending date, and the date range would include the starting date and up to 90 days past that date, or the current date if the starting date is less than 90 days in the past. transactionType: only consider a specific type of monetary transaction. The supported transactionType values are as follows: SALE: a sales order. REFUND: a refund to the buyer after an order cancellation or return. CREDIT: a credit issued by eBay to the seller's account. DISPUTE: a monetary transaction associated with a payment dispute between buyer and seller. SHIPPING_LABEL: a monetary transaction where eBay is billing the seller for an eBay shipping label. Note that the shipping label functionality will initially only be available to a select number of sellers.Below is the proper syntax to use if filtering by a monetary transaction type: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionType:{SALE} buyerUsername: only consider monetary transactions involving a specific buyer (specified with the buyer's eBay user ID). Below is the proper syntax to use if filtering by a specific eBay buyer: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=buyerUsername:{buyer1234} salesRecordReference: only consider monetary transactions corresponding to a specific order (identified with a Selling Manager order identifier). Below is the proper syntax to use if filtering by a specific Selling Manager Sales Record ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=salesRecordReference:{123} Note: For all orders originating after February 1, 2020, a value of 0 will be returned in the salesRecordReference field. So, this filter will only be useful to retrieve orders than occurred before this date.. payoutId: only consider monetary transactions related to a specific seller payout (identified with a Payout ID). This value is auto-generated by eBay once the seller payout is set to be processed. Below is the proper syntax to use if filtering by a specific Payout ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=payoutId:{5000106638} transactionId: the unique identifier of a monetary transaction. For a sales order, the orderId filter should be used instead. Only the monetary transaction(s) associated with this transactionId value are returned. Below is the proper syntax to use if filtering by a specific transaction ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=transactionId:{03-03620-33763} orderId: the unique identifier of a sales order. For any other monetary transaction, the, the transactionId filter should be used instead. Only the monetary transaction(s) associated with this orderId value are returned. Below is the proper syntax to use if filtering by a specific order ID: https://apiz.ebay.com/sell/finances/v1/transaction_summary?filter=orderId:{03-03620-33763} For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/finances/types/FilterField.html + * @return {TransactionSummaryResponse} Success + */ + GetTransactionSummary(filter: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'transaction_summary?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method retrieves all pending funds that have not yet been distibuted through a seller payout. There are no input parameters for this method. The response payload includes available funds, funds being processed, funds on hold, and also an aggregate count of all three of these categories. If there are no funds that are pending, on hold, or being processed for the seller's account, no response payload is returned, and an http status code of 204 - No Content is returned instead. + * Get seller_funds_summary + * @return {SellerFundsSummaryResponse} Success + */ + GetSellerFundsSummary(): Observable { + return this.http.get(this.baseUri + 'seller_funds_summary', {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_inventory.txt b/Tests/SwagTsTests/NG2Results/sell_inventory.ts similarity index 99% rename from Tests/SwagTsTests/NG2Results/sell_inventory.txt rename to Tests/SwagTsTests/NG2Results/sell_inventory.ts index 8adc58a1..c48b0ddc 100644 --- a/Tests/SwagTsTests/NG2Results/sell_inventory.txt +++ b/Tests/SwagTsTests/NG2Results/sell_inventory.ts @@ -1,1825 +1,1825 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** This type is used to define the physical address of an inventory location. */ - export interface Address { - - /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine1?: string | null; - - /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ - addressLine2?: string | null; - - /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ - city?: string | null; - - /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ - country?: string | null; - - /** The county in which the address resides. This field is returned if defined for an inventory location. */ - county?: string | null; - - /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ - postalCode?: string | null; - - /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ - stateOrProvince?: string | null; - } - - - /** This type is used to express a dollar value and the applicable currency. */ - export interface Amount { - - /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ - currency?: string | null; - - /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ - value?: string | null; - } - - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - export interface Availability { - - /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - pickupAtLocationAvailability?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - } - - - /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ - export interface PickupAtLocationAvailability { - - /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ - availabilityType?: string | null; - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - fulfillmentTime?: TimeDuration; - - /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ - merchantLocationKey?: string | null; - - /** - * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ - export interface TimeDuration { - - /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - export interface ShipToLocationAvailability { - - /** - * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ - export interface BaseResponse { - - /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ - warnings?: Array; - } - - - /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ - export interface Error { - - /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ - category?: string | null; - - /** The name of the domain in which the error or warning occurred. */ - domain?: string | null; - - /** - * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ - longMessage?: string | null; - - /** A description of the condition that caused the error or warning. */ - message?: string | null; - - /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ - outputRefIds?: Array; - - /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. */ - subdomain?: string | null; - } - - - /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ - export interface ErrorParameter { - - /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ - name?: string | null; - - /** This is the actual value that was passed in for the element specified in the name field. */ - value?: string | null; - } - - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - export interface BestOffer { - - /** This type is used to express a dollar value and the applicable currency. */ - autoAcceptPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - autoDeclinePrice?: Amount; - - /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ - bestOfferEnabled?: boolean | null; - } - - - /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ - export interface BulkEbayOfferDetailsWithKeys { - - /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ - requests?: Array; - } - - - /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ - export interface EbayOfferDetailsWithKeys { - - /** - * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - - /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ - donationPercentage?: string | null; - } - - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - export interface ListingPolicies { - - /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ - bestOfferTerms?: BestOffer; - - /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - eBayPlusIfEligible?: boolean | null; - - /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - fulfillmentPolicyId?: string | null; - - /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - paymentPolicyId?: string | null; - - /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ - returnPolicyId?: string | null; - - /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ - shippingCostOverrides?: Array; - } - - - /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ - export interface ShippingCostOverride { - - /** This type is used to express a dollar value and the applicable currency. */ - additionalShippingCost?: Amount; - - /** - * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - priority?: number | null; - - /** This type is used to express a dollar value and the applicable currency. */ - shippingCost?: Amount; - - /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ - shippingServiceType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - surcharge?: Amount; - } - - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - export interface PricingSummary { - - /** This type is used to express a dollar value and the applicable currency. */ - minimumAdvertisedPrice?: Amount; - - /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - originallySoldForRetailPriceOn?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - originalRetailPrice?: Amount; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - - /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ - pricingVisibility?: string | null; - } - - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - export interface Tax { - - /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ - applyTax?: boolean | null; - - /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ - thirdPartyTaxCategory?: string | null; - - /** - * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. - * Type: double - */ - vatPercentage?: number | null; - } - - - /** This type is used by the base request of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItem { - - /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ - requests?: Array; - } - - - /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ - export interface GetInventoryItem { - - /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkGetInventoryItem method. */ - export interface BulkGetInventoryItemResponse { - - /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ - export interface GetInventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ - errors?: Array; - - /** This type is used to provide details about each retrieved inventory item record. */ - inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ - warnings?: Array; - } - - - /** This type is used to provide details about each retrieved inventory item record. */ - export interface InventoryItemWithSkuLocaleGroupKeys { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface PackageWeightAndSize { - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - dimensions?: Dimension; - - /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ - packageType?: string | null; - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - weight?: Weight; - } - - - /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Dimension { - - /** - * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - height?: number | null; - - /** - * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - length?: number | null; - - /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } - * Type: double - */ - width?: number | null; - } - - - /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - export interface Weight { - - /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } - * Type: double - */ - value?: number | null; - } - - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - export interface Product { - - /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ - aspects?: Array; - - /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ - brand?: string | null; - - /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ - description?: string | null; - - /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ - ean?: Array; - - /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ - epid?: string | null; - - /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ - imageUrls?: Array; - - /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ - isbn?: Array; - - /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ - mpn?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ - title?: string | null; - - /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ - upc?: Array; - } - - - /** The base request of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItem { - - /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ - requests?: Array; - } - - - /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ - export interface InventoryItemWithSkuLocale { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ - export interface BulkInventoryItemResponse { - - /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ - export interface InventoryItemResponse { - - /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ - errors?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base container of the bulkMigrateListings request payload. */ - export interface BulkMigrateListing { - - /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ - requests?: Array; - } - - - /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ - export interface MigrateListing { - - /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ - listingId?: string | null; - } - - - /** This type is used by the response payload of the bulkMigrateListings call. */ - export interface BulkMigrateListingResponse { - - /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ - responses?: Array; - } - - - /** This type is used to display the results of each listing that the seller attempted to migrate. */ - export interface MigrateListingResponse { - - /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ - errors?: Array; - - /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ - inventoryItemGroupKey?: string | null; - - /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ - inventoryItems?: Array; - - /** The unique identifier of the eBay listing that the seller attempted to migrate. */ - listingId?: string | null; - - /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** - * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ - warnings?: Array; - } - - - /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ - export interface InventoryItemListing { - - /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ - offerId?: string | null; - - /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ - sku?: string | null; - } - - - /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ - export interface BulkOffer { - - /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ - requests?: Array; - } - - - /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ - export interface OfferKeyWithId { - - /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ - offerId?: string | null; - } - - - /** This type is used by the base response of the bulkCreateOffer method. */ - export interface BulkOfferResponse { - - /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ - responses?: Array; - } - - - /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ - export interface OfferSkuResponse { - - /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ - errors?: Array; - - /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ - offerId?: string | null; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ - sku?: string | null; - - /** - * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ - warnings?: Array; - } - - - /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - export interface BulkPriceQuantity { - - /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ - requests?: Array; - } - - - /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ - export interface PriceQuantity { - - /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ - offers?: Array; - - /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ - shipToLocationAvailability?: ShipToLocationAvailability; - - /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ - sku?: string | null; - } - - - /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ - export interface OfferPriceQuantity { - - /** - * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ - offerId?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - price?: Amount; - } - - - /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - export interface BulkPriceQuantityResponse { - - /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ - responses?: Array; - } - - - /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ - export interface PriceQuantityResponse { - - /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ - errors?: Array; - - /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ - offerId?: string | null; - - /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ - sku?: string | null; - - /** - * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ - warnings?: Array; - } - - - /** This type is used by the base response of the bulkPublishOffer method. */ - export interface BulkPublishResponse { - - /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ - responses?: Array; - } - - - /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ - export interface OfferResponseWithListingId { - - /** This container will be returned if there were one or more errors associated with publishing the offer. */ - errors?: Array; - - /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ - listingId?: string | null; - - /** The unique identifier of the offer that the seller published (or attempted to publish). */ - offerId?: string | null; - - /** - * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - - /** This container will be returned if there were one or more warnings associated with publishing the offer. */ - warnings?: Array; - } - - - /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ - export interface Compatibility { - - /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ - compatibleProducts?: Array; - - /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ - sku?: string | null; - } - - - /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ - export interface CompatibleProduct { - - /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ - compatibilityProperties?: Array; - - /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ - notes?: string | null; - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - productFamilyProperties?: ProductFamilyProperties; - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - productIdentifier?: ProductIdentifier; - } - - - /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ - export interface NameValueList { - - /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ - name?: string | null; - - /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ - value?: string | null; - } - - - /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ - export interface ProductFamilyProperties { - - /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ - engine?: string | null; - - /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ - make?: string | null; - - /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ - model?: string | null; - - /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ - trim?: string | null; - - /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ - year?: string | null; - } - - - /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ - export interface ProductIdentifier { - - /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ - epid?: string | null; - - /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ - gtin?: string | null; - - /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ - ktype?: string | null; - } - - - /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ - export interface EbayOfferDetailsWithAll { - - /** - * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - listing?: ListingDetails; - - /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ - merchantLocationKey?: string | null; - - /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ - offerId?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ - sku?: string | null; - - /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ - status?: string | null; - - /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ - export interface ListingDetails { - - /** The unique identifier of the eBay listing that is associated with the published offer. */ - listingId?: string | null; - - /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ - listingStatus?: string | null; - - /** - * This integer value indicates the quantity of the product that has been sold for the published offer. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - soldQuantity?: number | null; - } - - - /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ - export interface EbayOfferDetailsWithId { - - /** - * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - availableQuantity?: number | null; - - /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ - categoryId?: string | null; - - /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - - /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ - listingDescription?: string | null; - - /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ - listingDuration?: string | null; - - /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ - listingPolicies?: ListingPolicies; - - /** - * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - lotSize?: number | null; - - /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ - pricingSummary?: PricingSummary; - - /** - * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantityLimitPerBuyer?: number | null; - - /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ - storeCategoryNames?: Array; - - /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ - tax?: Tax; - } - - - /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ - export interface Fee { - - /** This type is used to express a dollar value and the applicable currency. */ - amount?: Amount; - - /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - feeType?: string | null; - - /** This type is used to express a dollar value and the applicable currency. */ - promotionalDiscount?: Amount; - } - - - /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ - export interface FeeSummary { - - /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ - fees?: Array; - - /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response payload for the getListingFees call. */ - export interface FeesSummaryResponse { - - /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ - feeSummaries?: Array; - } - - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - export interface GeoCoordinates { - - /** - * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - latitude?: number | null; - - /** - * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. - * Type: double - */ - longitude?: number | null; - } - - - /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ - export interface Interval { - - /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - close?: string | null; - - /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ - open?: string | null; - } - - - /** This type is used to provide detailed information about an inventory item. */ - export interface InventoryItem { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ - conditionDescription?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - } - - - /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ - export interface InventoryItemGroup { - - /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ - aspects?: Array; - - /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ - description?: string | null; - - /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ - imageUrls?: Array; - - /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ - inventoryItemGroupKey?: string | null; - - /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ - subtitle?: string | null; - - /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ - title?: string | null; - - /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ - variantSKUs?: Array; - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - variesBy?: VariesBy; - } - - - /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ - export interface VariesBy { - - /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ - aspectsImageVariesBy?: Array; - - /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ - specifications?: Array; - } - - - /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ - export interface Specification { - - /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ - name?: string | null; - - /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ - values?: Array; - } - - export interface InventoryItemWithSkuLocaleGroupid { - - /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ - availability?: Availability; - - /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ - conditionDescription?: string | null; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ - groupIds?: Array; - - /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ - inventoryItemGroupKeys?: Array; - - /** This field is for future use only. For implementation help, refer to eBay API documentation */ - locale?: string | null; - - /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ - packageWeightAndSize?: PackageWeightAndSize; - - /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ - product?: Product; - - /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ - sku?: string | null; - } - - - /** This type is used by the base response payload of getInventoryItems call. */ - export interface InventoryItems { - - /** This is the URL to the current page of inventory items. */ - href?: string | null; - - /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ - inventoryItems?: Array; - - /** - * This integer value is the number of inventory items that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ - next?: string | null; - - /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ - prev?: string | null; - - /** - * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ - export interface InventoryLocation { - - /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ - locationInstructions?: string | null; - - /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ - locationWebUrl?: string | null; - - /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ - name?: string | null; - - /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ - operatingHours?: Array; - - /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ - phone?: string | null; - - /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ - specialHours?: Array; - } - - - /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ - export interface OperatingHours { - - /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ - dayOfWeekEnum?: string | null; - - /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ - intervals?: Array; - } - - - /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ - export interface SpecialHours { - - /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ - date?: string | null; - - /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ - intervals?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ - export interface InventoryLocationFull { - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - location?: LocationDetails; - - /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ - locationInstructions?: string | null; - - /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ - locationTypes?: Array; - - /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ - phone?: string | null; - - /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ - specialHours?: Array; - } - - - /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ - export interface LocationDetails { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - } - - - /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ - export interface InventoryLocationResponse { - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - location?: Location; - - /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ - locationAdditionalInformation?: string | null; - - /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ - locationInstructions?: string | null; - - /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ - locationTypes?: Array; - - /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ - locationWebUrl?: string | null; - - /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ - merchantLocationKey?: string | null; - - /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ - merchantLocationStatus?: string | null; - - /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ - name?: string | null; - - /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ - operatingHours?: Array; - - /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ - phone?: string | null; - - /** This container shows the special operating hours for a store location on a specific date or dates. */ - specialHours?: Array; - } - - - /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ - export interface Location { - - /** This type is used to define the physical address of an inventory location. */ - address?: Address; - - /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ - geoCoordinates?: GeoCoordinates; - - /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ - locationId?: string | null; - } - - - /** This type is used by the base response payload for the getInventoryLocations call. */ - export interface LocationResponse { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** An array of one or more of the merchant's inventory locations. */ - locations?: Array; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the base request payload of the getListingFees call. */ - export interface OfferKeysWithId { - - /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ - offers?: Array; - } - - - /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ - export interface OfferResponse { - - /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ - offerId?: string | null; - - /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ - warnings?: Array; - } - - - /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ - export interface Offers { - - /** This is the URL to the current page of offers. */ - href?: string | null; - - /** - * This integer value is the number of offers that will be displayed on each results page. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ - next?: string | null; - - /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ - offers?: Array; - - /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ - prev?: string | null; - - /** - * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - size?: number | null; - - /** - * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ - export interface PublishByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ - export interface PublishResponse { - - /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ - listingId?: string | null; - - /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ - warnings?: Array; - } - - - /** This type is used to show the version number and instance of the service or API. */ - export interface Version { - - /** This type is used to show the version number and instance of the service or API. */ - instance?: Version; - - /** The version number of the service or API. */ - version?: string | null; - } - - - /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ - export interface WithdrawByInventoryItemGroupRequest { - - /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ - inventoryItemGroupKey?: string | null; - - /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - } - - - /** The base response of the withdrawOffer call. */ - export interface WithdrawResponse { - - /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ - listingId?: string | null; - - /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ - warnings?: Array; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 - * @return {InventoryLocationResponse} Success - */ - GetInventoryLocation(merchantLocationKey: string): Observable { - return this.http.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}); - } - - /** - * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 - * @param {InventoryLocationFull} requestBody Inventory Location details - * @return {void} - */ - CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Observable> { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. - * Delete location/{merchantLocationKey} - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 - * @return {void} - */ - DeleteInventoryLocation(merchantLocationKey: string): Observable> { - return this.http.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/disable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 - * @return {string} Success - */ - DisableInventoryLocation(merchantLocationKey: string): Observable { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, { responseType: 'text' }); - } - - /** - * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Post location/{merchantLocationKey}/enable - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 - * @return {string} Success - */ - EnableInventoryLocation(merchantLocationKey: string): Observable { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, { responseType: 'text' }); - } - - /** - * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. - * Get location - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 - * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {LocationResponse} Success - */ - GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. - * Post location/{merchantLocationKey}/update_location_details - * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 - * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). - * @return {void} - */ - UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Observable> { - return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Get inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. - * @return {InventoryItemWithSkuLocaleGroupid} Success - */ - GetInventoryItem(sku: string): Observable { - return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. - * Put inventory_item/{sku} - * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. - * @param {InventoryItem} requestBody Details of the inventory item record. - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Observable { - return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Delete inventory_item/{sku} - * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. - * @return {void} - */ - DeleteInventoryItem(sku: string): Observable> { - return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. - * Get inventory_item - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {InventoryItems} Success - */ - GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Post bulk_update_price_quantity - * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace - * @return {BulkPriceQuantityResponse} Success - */ - BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Observable { - return this.http.post(this.baseUri + 'bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. - * Post bulk_create_or_replace_inventory_item - * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkInventoryItemResponse} Success - */ - BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Observable { - return this.http.post(this.baseUri + 'bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). - * Post bulk_get_inventory_item - * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale - * @return {BulkGetInventoryItemResponse} Success - */ - BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Observable { - return this.http.post(this.baseUri + 'bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Get inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {Compatibility} Success - */ - GetProductCompatibility(sku: string): Observable { - return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}); - } - - /** - * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @param {Compatibility} requestBody Details of the compatibility - * @return {BaseResponse} Success - */ - CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Observable { - return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. - * Delete inventory_item/{sku}/product_compatibility - * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product - * @return {void} - */ - DeleteProductCompatibility(sku: string): Observable> { - return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer - * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. - * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. - * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. - * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. - * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. - * @return {Offers} Success - */ - GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. - * Post offer - * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {void} - */ - CreateOffer(requestBody: EbayOfferDetailsWithKeys): Observable> { - return this.http.post(this.baseUri + 'offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. - * Get offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is to be retrieved. - * @return {EbayOfferDetailsWithAll} Success - */ - GetOffer(offerId: string): Observable { - return this.http.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}); - } - - /** - * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put offer/{offerId} - * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. - * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel - * @return {OfferResponse} Success - */ - UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Observable { - return this.http.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. - * Delete offer/{offerId} - * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. - * @return {void} - */ - DeleteOffer(offerId: string): Observable> { - return this.http.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post offer/{offerId}/publish/ - * @param {string} offerId The unique identifier of the offer that is to be published. - * @return {PublishResponse} Success - */ - PublishOffer(offerId: string): Observable { - return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}); - } - - /** - * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. - * Post offer/publish_by_inventory_item_group/ - * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. - * @return {PublishResponse} Success - */ - PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Observable { - return this.http.post(this.baseUri + 'offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. - * Post offer/withdraw_by_inventory_item_group - * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. - * @return {void} - */ - WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Observable> { - return this.http.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. - * Post offer/get_listing_fees - * @param {OfferKeysWithId} requestBody List of offers that needs fee information - * @return {FeesSummaryResponse} Success - */ - GetListingFees(requestBody: OfferKeysWithId): Observable { - return this.http.post(this.baseUri + 'offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. - * Post bulk_create_offer - * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel - * @return {BulkOfferResponse} Success - */ - BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Observable { - return this.http.post(this.baseUri + 'bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. - * Post bulk_publish_offer - * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. - * @return {BulkPublishResponse} Success - */ - BulkPublishOffer(requestBody: BulkOffer): Observable { - return this.http.post(this.baseUri + 'bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. - * Post offer/{offerId}/withdraw - * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. - * @return {WithdrawResponse} Success - */ - WithdrawOffer(offerId: string): Observable { - return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}); - } - - /** - * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. - * Get inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. - * @return {InventoryItemGroup} Success - */ - GetInventoryItemGroup(inventoryItemGroupKey: string): Observable { - return this.http.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}); - } - - /** - * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. - * Put inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. - * @param {InventoryItemGroup} requestBody Details of the inventory Item Group - * @return {BaseResponse} Success - */ - CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Observable { - return this.http.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This call deletes the inventory item group for a given inventoryItemGroupKey value. - * Delete inventory_item_group/{inventoryItemGroupKey} - * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. - * @return {void} - */ - DeleteInventoryItemGroup(inventoryItemGroupKey: string): Observable> { - return this.http.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. - * Post bulk_migrate_listing - * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory - * @return {BulkMigrateListingResponse} Success - */ - BulkMigrateListing(requestBody: BulkMigrateListing): Observable { - return this.http.post(this.baseUri + 'bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** This type is used to define the physical address of an inventory location. */ + export interface Address { + + /** The first line of a street address. This field is required for store inventory locations that will be holding In-Store Pickup inventory. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine1?: string | null; + + /** The second line of a street address. This field can be used for additional address information, such as a suite or apartment number. A street address is not required if the inventory location is not holding In-Store Pickup Inventory. This field will be returned if defined for an inventory location. Max length: 128 */ + addressLine2?: string | null; + + /** The city in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the city is just derived from this postal/zip code. This field is returned if defined for an inventory location. Max length: 128 */ + city?: string | null; + + /** The country in which the address resides, represented as two-letter ISO 3166 country code. For example, US represents the United States, and DE represents Germany. Max length: 2 For implementation help, refer to eBay API documentation */ + country?: string | null; + + /** The county in which the address resides. This field is returned if defined for an inventory location. */ + county?: string | null; + + /** The postal/zip code of the address. eBay uses postal codes to surface In-Store Pickup items within the vicinity of a buyer's location, and it also user postal codes (origin and destination) to estimate shipping costs when the seller uses calculated shipping. A city/stateOrProvince pair can be used instead of a postalCode value, and then the postal code is just derived from the city and state/province. This field is returned if defined for an inventory location. Max length: 16 */ + postalCode?: string | null; + + /** The state/province in which the inventory location resides. This field is required for store inventory locations that will be holding In-Store Pickup inventory. For warehouse locations, this field is technically optional, as a postalCode can be used instead of city/stateOrProvince pair, and then the state or province is just derived from this postal/zip code. Max length: 128 */ + stateOrProvince?: string | null; + } + + + /** This type is used to express a dollar value and the applicable currency. */ + export interface Amount { + + /** A three-digit string value respresenting the type of currency being used. Both the value and currency fields are required/always returned when expressing prices. See the CurrencyCodeEnum type for the full list of currencies and their corresponding three-digit string values. */ + currency?: string | null; + + /** A string representation of a dollar value expressed in the currency specified in the currency field. Both the value and currency fields are required/always returned when expressing prices. */ + value?: string | null; + } + + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + export interface Availability { + + /** This container consists of an array of one or more of the merchant's physical store locations where the inventory item is available for In-Store Pickup orders. The merchant's location, the quantity available, and the fulfillment time (how soon the item will be ready for pickup after the order takes place) are all in this container. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + pickupAtLocationAvailability?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + } + + + /** This type is used to specify/indicate the quantity of the inventory item that is available for an In-Store Pickup order at the merchant's physical store (specified by the merchantLocationKey field). */ + export interface PickupAtLocationAvailability { + + /** The enumeration value in this field indicates the availability status of the inventory item at the merchant's physical store specified by the pickupAtLocationAvailability.merchantLocationKey field. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. See AvailabilityTypeEnum for more information about how/when you use each enumeration value. For implementation help, refer to eBay API documentation */ + availabilityType?: string | null; + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + fulfillmentTime?: TimeDuration; + + /** The unique identifier of a merchant's store where the In-Store Pickup inventory item is currently located, or where inventory will be sent to. If the merchant's store is currently awaiting for inventory, the availabilityType value should be SHIP_TO_STORE. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. Max length: 36 */ + merchantLocationKey?: string | null; + + /** + * This integer value indicates the quantity of the inventory item that is available for In-Store Pickup at the store identified by the merchantLocationKey value. The value of quantity should be an integer value greater than 0, unless the inventory item is out of stock. This field is required if the pickupAtLocationAvailability container is used, and is always returned with the pickupAtLocationAvailability container. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This type is used by the fulfillmentTime container of the PickupAtLocationAvailability type to specify how soon orders will be ready for In-Store pickup after the purchase has occurred. */ + export interface TimeDuration { + + /** This enumeration value indicates the time unit used to specify the fulfillment time, such as HOUR. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The integer value in this field, along with the time unit in the unit field, will indicate how soon after an In-Store Pickup purchase can the buyer pick up the item at the designated store location. If the value of this field is 4, and the value of the unit field is HOUR, then the fulfillment time for the In-Store Pickup order is four hours, which means that the buyer will be able to pick up the item at the store four hours after the transaction took place. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + export interface ShipToLocationAvailability { + + /** + * This container is used to set the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. This container is not immediately required, but 'ship-to-home' quantity must be set before an offer of the inventory item can be published. If an existing inventory item is being updated, and the 'ship-to-home' quantity already exists for the inventory item record, this container should be included again, even if the value is not changing, or the available quantity data will be lost. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** This is the base response of the createOrReplaceInventoryItem, createOrReplaceInventoryItemGroup, and createOrReplaceProductCompatibility calls. A response payload will only be returned for these three calls if one or more errors or warnings occur with the call. */ + export interface BaseResponse { + + /** This container will be returned in a call response payload if one or more warnings or errors are triggered when an Inventory API call is made. This container will contain detailed information about the error or warning. */ + warnings?: Array; + } + + + /** This type is used to express detailed information on errors and warnings that may occur with a call request. */ + export interface Error { + + /** This string value indicates the error category. There are three categories of errors: request errors, application errors, and system errors. */ + category?: string | null; + + /** The name of the domain in which the error or warning occurred. */ + domain?: string | null; + + /** + * A unique code that identifies the particular error or warning that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of one or more reference IDs which identify the specific request element(s) most closely associated to the error or warning, if any. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning, and information on what to do to correct the problem. */ + longMessage?: string | null; + + /** A description of the condition that caused the error or warning. */ + message?: string | null; + + /** An array of one or more reference IDs which identify the specific response element(s) most closely associated to the error or warning, if any. */ + outputRefIds?: Array; + + /** Various warning and error messages return one or more variables that contain contextual information about the error or waring. This is often the field or value that triggered the error or warning. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. */ + subdomain?: string | null; + } + + + /** This type is used to indicate the parameter field/value that caused an issue with the call request. */ + export interface ErrorParameter { + + /** This type contains the name and value of an input parameter that contributed to a specific error or warning condition. */ + name?: string | null; + + /** This is the actual value that was passed in for the element specified in the name field. */ + value?: string | null; + } + + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + export interface BestOffer { + + /** This type is used to express a dollar value and the applicable currency. */ + autoAcceptPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + autoDeclinePrice?: Amount; + + /** This field indicates whether or not the Best Offer feature is enabled for the listing. A seller can enable the Best Offer feature for a listing as long as the category supports the Best Offer feature. The seller includes this field and sets its value to true to enable Best Offer feature. */ + bestOfferEnabled?: boolean | null; + } + + + /** This type is used by the base request of the bulkCreateOffer method, which is used to create up to 25 new offers. */ + export interface BulkEbayOfferDetailsWithKeys { + + /** The details of each offer that is being created is passed in under this container. Up to 25 offers can be created with one bulkCreateOffer call. */ + requests?: Array; + } + + + /** This type provides details of an offer, and is used by the base request payload of the createOffer and bulkCreateOffer methods. */ + export interface EbayOfferDetailsWithKeys { + + /** + * This integer value sets the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. Quantity must be set to 1 or more in order for the inventory item to be purchasable, but this field is not necessarily required, even for published offers, if the general quantity of the inventory item has already been set in the inventory item record. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item will be listed under. This field is not immediately required upon creating an offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE, as the Inventory API only supports fixed-price listings at this time. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site for which the offer will be made available. See MarketplaceEnum for the list of supported enumeration values. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + + /** This field is the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. */ + donationPercentage?: string | null; + } + + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + export interface ListingPolicies { + + /** This type is used by the bestOfferTerms container, which is used if the seller would like to support the Best Offer feature on their listing. */ + bestOfferTerms?: BestOffer; + + /** This field is included in an offer and set to true if a Top-Rated seller is opted in to the eBay Plus program. With the eBay Plus program, qualified sellers must commit to next-day delivery of the item, and the buyers must have an eBay Plus subscription to be eligible to receive the benefits of this program, which are free, next-day delivery, as well as free returns. Currently, this program is only available on the Germany and Australian sites. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + eBayPlusIfEligible?: boolean | null; + + /** This unique identifier indicates the fulfillment listing policy that will be used once an offer is published and converted to an eBay listing. This fulfillment listing policy will set all fulfillment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the fulfillment listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. The seller may also want to review the shipping service costs in the fulfillment policy, and that seller might decide to override the shipping costs for one or more shipping service options by using the shippingCostOverrides container. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getFulfillmentPolicies call. There are also calls in the Account API to retrieve a fulfillment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + fulfillmentPolicyId?: string | null; + + /** This unique identifier indicates the payment listing policy that will be used once an offer is published and converted to an eBay listing. This payment listing policy will set all payment-related settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the payment listing policy before assigning it to the offer, as the following must be true for the payment listing policy to be compatible with the offer: The marketplaceId value should reflect where the offer is being published The immediatePay field value must be set to true since Inventory API offers only support immediate payment The only specified payment method should be 'PayPal', since immediate payment requires 'PayPal'Listing policies can be created and managed in My eBay or with the Account API. To get a list of all payment policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getPaymentPolicies call. There are also calls in the Account API to retrieve a payment policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + paymentPolicyId?: string | null; + + /** This unique identifier indicates the return listing policy that will be used once an offer is published and converted to an eBay listing. This return listing policy will set all return policy settings for the eBay listing. Listing policies are not immediately required for offers, but are required before an offer can be published. The seller should review the return listing policy before assigning it to the offer to make sure it is compatible with the inventory item and the offer settings. Listing policies can be created and managed in My eBay or with the Account API. To get a list of all return policies associated with a seller's account on a specific eBay Marketplace, use the Account API's getReturnPolicies call. There are also calls in the Account API to retrieve a return policy by policy ID or policy name. This field will be returned in the getOffer and getOffers calls if set for the offer. */ + returnPolicyId?: string | null; + + /** This container is used if the seller wishes to override the shipping costs or surcharge for one or more domestic or international shipping service options defined in the fulfillment listing policy. To override the costs of a specific domestic or international shipping service option, the seller must know the priority/order of that shipping service in the fulfillment listing policy. The name of a shipping service option can be found in the shippingOptions.shippingServices.shippingServiceCode field of the fulfillment policy, and the priority/order of that shipping service option is found in the shippingOptions.shippingServices.sortOrderId field. Both of these values can be retrieved by searching for that fulfillment policy with the getFulfillmentPolicies or getFulfillmentPolicyByName calls of the Account API. The shippingCostOverrides.priority value should match the shippingOptions.shippingServices.sortOrderId in order to override the shipping costs for that shipping service option. The seller must also ensure that the shippingServiceType value is set to DOMESTIC to override a domestic shipping service option, or to INTERNATIONAL to override an international shipping service option. A separate ShippingCostOverrides node is needed for each shipping service option whose costs are being overridden. All defined fields of the shippingCostOverrides container should be included, even if the shipping costs and surcharge values are not changing. The shippingCostOverrides container is returned in the getOffer and getOffers calls if one or more shipping cost overrides are being applied to the fulfillment policy. */ + shippingCostOverrides?: Array; + } + + + /** This type is used if the seller wants to override the shipping costs or surcharge associated with a specific domestic or international shipping service option defined in the fulfillment listing policy that is being applied toward the offer. The shipping-related costs that can be overridden include the shipping cost to ship one item, the shipping cost to ship each additional item (if multiple quantity are purchased), and the shipping surcharge applied to the shipping service option. */ + export interface ShippingCostOverride { + + /** This type is used to express a dollar value and the applicable currency. */ + additionalShippingCost?: Amount; + + /** + * The integer value input into this field, along with the shippingServiceType value, sets which domestic or international shipping service option in the fulfillment policy will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + priority?: number | null; + + /** This type is used to express a dollar value and the applicable currency. */ + shippingCost?: Amount; + + /** This enumerated value indicates whether the shipping service specified in the priority field is a domestic or an international shipping service option. To override the shipping costs for a specific domestic shipping service in the fulfillment listing policy, this field should be set to DOMESTIC, and to override the shipping costs for each international shipping service, this field should be set to INTERNATIONAL. This value, along with priority value, sets which domestic or international shipping service option in the fulfillment policy that will be modified with updated shipping costs. Specifically, the shippingCostOverrides.shippingServiceType value in a createOffer or updateOffer call must match the shippingOptions.optionType value in a fulfillment listing policy, and the shippingCostOverrides.priority value in a createOffer or updateOffer call must match the shippingOptions.shippingServices.sortOrderId value in a fulfillment listing policy. This field is always required when overriding the shipping costs of a shipping service option, and will be always be returned for each shipping service option whose costs are being overridden. For implementation help, refer to eBay API documentation */ + shippingServiceType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + surcharge?: Amount; + } + + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + export interface PricingSummary { + + /** This type is used to express a dollar value and the applicable currency. */ + minimumAdvertisedPrice?: Amount; + + /** This field is needed if the Strikethrough Pricing (STP) feature will be used in the offer. This field indicates that the product was sold for the price in the originalRetailPrice field on an eBay site, or sold for that price by a third-party retailer. When using the createOffer or updateOffer calls, the seller will pass in a value of ON_EBAY to indicate that the product was sold for the originalRetailPrice on an eBay site, or the seller will pass in a value of OFF_EBAY to indicate that the product was sold for the originalRetailPrice through a third-party retailer. This field and the originalRetailPrice field are only applicable if the seller and listing are eligible to use the Strikethrough Pricing feature, a feature which is limited to the US (core site and Motors), UK, Germany, Canada (English and French versions), France, Italy, and Spain sites. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + originallySoldForRetailPriceOn?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + originalRetailPrice?: Amount; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + + /** This field is needed if the Minimum Advertised Price (MAP) feature will be used in the offer. This field is only applicable if an eligible US seller is using the Minimum Advertised Price (MAP) feature and a minimumAdvertisedPrice has been specified. The value set in this field will determine whether the MAP price is shown to a prospective buyer prior to checkout through a pop-up window accessed from the View Item page, or if the MAP price is not shown until the checkout flow after the buyer has already committed to buying the item. To show the MAP price prior to checkout, the seller will set this value to PRE_CHECKOUT. To show the MAP price after the buyer already commits to buy the item, the seller will set this value to DURING_CHECKOUT. This field will be ignored if the seller and/or the listing is not eligible for the MAP feature. This field will be returned if set for the offer. For implementation help, refer to eBay API documentation */ + pricingVisibility?: string | null; + } + + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + export interface Tax { + + /** This field will be included and set to true if the seller would like to reference their account-level Sales Tax Table to calculate sales tax for an order. A seller's Sales Tax Table can be created and managed manually in My eBay's Payment Preferences. This Sales Tax Table contains all tax jurisdictions for the seller's country (individual states and territories in US), and the seller can set the sales tax rate for these individual tax jurisdictions. The Trading API has a SetTaxTable call to add/modify sales tax rates for one or more tax jurisdictions, and a GetTaxTable call that will retrieve all tax jurisdictions and related data, such as the sales tax rate (if defined) and a boolean field to indicate if sales tax is applied to shipping and handling costs. The Account API has a getSalesTaxTable call to retrieve all tax jurisdictions that have a defined sales tax rate, a getSalesTaxTableEntry call to retrieve a sales tax rate for a specific tax jurisdiction, a createSalesTaxTableEntry call to set/modify a sales tax rate for a specific tax jurisdiction, and a deleteSalesTaxTableEntry call to remove a sales tax rate from a specific tax jurisdiction. Note that a seller can enable the use of a sales tax table, but if a sales tax rate is not specified for the buyer's state/tax jurisdiction, sales tax will not be applied to the order. If a thirdPartyTaxCategory value is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. See the Using a tax table help page for more information on setting up and using a sales tax table. */ + applyTax?: boolean | null; + + /** The tax exception category code. If this field is used, sales tax will also apply to a service/fee, and not just the item price. This is to be used only by sellers who have opted into sales tax being calculated by a sales tax calculation vendor. If you are interested in becoming a tax calculation vendor partner with eBay, contact developer-relations@ebay.com. One supported value for this field is WASTE_RECYCLING_FEE. If this field is used, the applyTax field must also be used and set to true This field will be returned if set for the offer. */ + thirdPartyTaxCategory?: string | null; + + /** + * This value is the Value Add Tax (VAT) rate for the item, if any. When a VAT percentage is specified, the item's VAT information appears on the listing's View Item page. In addition, the seller can choose to print an invoice that includes the item's net price, VAT percent, VAT amount, and total price. Since VAT rates vary depending on the item and on the user's country of residence, a seller is responsible for entering the correct VAT rate; it is not calculated by eBay. To use VAT, a seller must be a business seller with a VAT-ID registered with eBay, and must be listing the item on a VAT-enabled site. Max applicable length is 6 characters, including the decimal (e.g., 12.345). The scale is 3 decimal places. (If you pass in 12.3456, eBay may round up the value to 12.346). This field will be returned if set for the offer. + * Type: double + */ + vatPercentage?: number | null; + } + + + /** This type is used by the base request of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItem { + + /** The seller passes in multiple SKU values under this container to retrieve multiple inventory item records. Up to 25 inventory item records can be retrieved at one time. */ + requests?: Array; + } + + + /** The seller-defined Stock-Keeping Unit (SKU) of each inventory item that the user wants to retrieve is passed in the request of the bulkGetInventoryItem method. */ + export interface GetInventoryItem { + + /** An array of SKU values are passed in under the sku container to retrieve up to 25 inventory item records. */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkGetInventoryItem method. */ + export interface BulkGetInventoryItemResponse { + + /** This is the base container of the bulkGetInventoryItem response. The results of each attempted inventory item retrieval is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkGetInventoryItem method to give the status of each inventory item record that the user tried to retrieve. */ + export interface GetInventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with retrieving the inventory item record. */ + errors?: Array; + + /** This type is used to provide details about each retrieved inventory item record. */ + inventoryItem?: InventoryItemWithSkuLocaleGroupKeys; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of retrieving the inventory item record for the inventory item specified in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with retrieving the inventory item record. */ + warnings?: Array; + } + + + /** This type is used to provide details about each retrieved inventory item record. */ + export interface InventoryItemWithSkuLocaleGroupKeys { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another.Max length: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface PackageWeightAndSize { + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + dimensions?: Dimension; + + /** This enumeration value indicates the type of shipping package used to ship the inventory item. The supported values for this field can be found in the PackageTypeEnum type. This field will be returned if the package type is set for the inventory item. For implementation help, refer to eBay API documentation */ + packageType?: string | null; + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + weight?: Weight; + } + + + /** This type is used to specify the dimensions (and the unit used to measure those dimensions) of a shipping package. The dimensions container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Dimension { + + /** + * The actual height (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + height?: number | null; + + /** + * The actual length (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + length?: number | null; + + /** The unit of measurement used to specify the dimensions of a shipping package. All fields of the dimensions container are required if package dimensions are specified. If the English system of measurement is being used, the applicable values for dimension units are FEET and INCH. If the metric system of measurement is being used, the applicable values for weight units are METER and CENTIMETER. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual width (in the measurement unit specified in the unit field) of the shipping package. All fields of the dimensions container are required if package dimensions are specified. If a shipping package measured 21.5 inches in length, 15.0 inches in width, and 12.0 inches in height, the dimensions container would look as follows: "dimensions": { "length": 21.5, "width": 15.0, "height": 12.0, "unit": "INCH" } + * Type: double + */ + width?: number | null; + } + + + /** This type is used to specify the weight (and the unit used to measure that weight) of a shipping package. The weight container is conditionally required if the seller will be offering calculated shipping rates to determine shipping cost, or is using flat-rate costs, but charging a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + export interface Weight { + + /** The unit of measurement used to specify the weight of a shipping package. Both the unit and value fields are required if the weight container is used. If the English system of measurement is being used, the applicable values for weight units are POUND and OUNCE. If the metric system of measurement is being used, the applicable values for weight units are KILOGRAM and GRAM. The metric system is used by most countries outside of the US. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * The actual weight (in the measurement unit specified in the unit field) of the shipping package. Both the unit and value fields are required if the weight container is used. If a shipping package weighed 20.5 ounces, the container would look as follows: "weight": { "value": 20.5, "unit": "OUNCE" } + * Type: double + */ + value?: number | null; + } + + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + export interface Product { + + /** This is an array of item specific pairs that provide more information about the product and might make it easier for buyers to find. To view required/recommended product aspects/item specifics names (and corresponding values) for a specific eBay category, sellers can use the GetCategorySpecifics call of the Trading API. Alternatively, sellers can view similar items on eBay.com in the same category to get an idea of what other sellers are using for product aspects/item specifics. Sellers also have the option of specifying an eBay Product ID (ePID) or optionally, a Global Trade Item Number (GTIN) through the corresponding fields in the product container in an attempt to find a product match in the eBay Catalog. If a match is found based on the ePID or GTIN value, the product aspects that are defined for the eBay Catalog product will automatically get picked up by the newly created/updated inventory item. Below is an example of the proper JSON syntax to use when manually inputting item specifics: "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] } Note that inventory items that will become part of an inventory item group and multiple-variation listing should have the same attributes that are defined for the inventory item group. This container will be returned if one or more item specific pairs are defined for the inventory item. Max Length for Aspect Name: 40 Max Length for Aspect Value: 50 */ + aspects?: Array; + + /** The brand of the product. This field is often paired with the mpn field to identify a specific product by Manufacture Part Number. This field is conditionally required if the eBay category requires a Manufacturer Part Number (MPN) value. If eBay is able to find a product match in the eBay Catalog when an eBay Product ID (ePID) or GTIN value (UPC, ISBN, or EAN) is supplied, all product details of that eBay Catalog product is picked up by the inventory item record (including brand) if the createOrUpdateInventoryItem call is successful. This field is returned if defined for an inventory item. If a brand was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the brand field. Max Length: 65 */ + brand?: string | null; + + /** The description of the product. The description of an existing inventory item can be added or modified with a createOrReplaceInventoryItem call. The description of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. Note that this field is optional but recommended. If a listingDescription field is omitted when creating and publishing a single-variation offer, the text in this field will be used instead. If neither the product.description field for the inventory item nor the listingDescription field for the offer exist, the publishOffer call will fail. If the inventory item will be part of an inventory item group/multiple-variation listing, this field should definitely be used to specify how the corresponding product variation is different (e.g. This is the green, extra-large version of the shirt). However, in the case of an inventory item group, the text in the description field of the inventory item group will become the listing description of the actual eBay listing instead of the text in this field. Basic HTML tags are supported, including the following tags: <b> <strong> <br> <ol> <ul> <li> Table tags including <table>, <tr>, <td>, <th>, <thead>, <tfoot>, <tbody>, <caption>, <colgroup>, and <col>A seller can not use any active content in their listing description. Active content includes animation or video via JavaScript, Flash, plug-ins, or form actions. This field is returned if defined for an inventory item. If one of the GTIN types (e.g. UPC) was passed in when the inventory item was created/modified and a product match was found in the eBay catalog, product description is one of the details that gets picked up from the catalog product. Max Length: 4000 */ + description?: string | null; + + /** The European Article Number/International Article Number (EAN) for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified EAN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an EAN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the ean field. */ + ean?: Array; + + /** The eBay Product Identifier (ePID) for the product. This field can be used to directly identify an eBay Catalog product. Based on its specified ePID value, eBay will search for the product in the eBay Catalog, and if a match is found, the inventory item is automatically populated with available product details such as product title, product description, product aspects, and a link to any stock image that exists for the catalog product. In an attempt to find a eBay Catalog product match, an ePID value is always preferred over the other product identifiers, since it is possible that one GTIN value can be associated with multiple eBay Catalog products, and if multiple products are found, product details will not be picked up by the Inventory Item object. This field is returned if defined for an inventory item. */ + epid?: string | null; + + /** An array of one or more links to images for the product. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before an offer can be published, at least one image must exist for the inventory item. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. A link to a stock image for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This container will always be returned for an inventory item that is part of a published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory items that are not a part of a published offer. */ + imageUrls?: Array; + + /** The International Standard Book Number (ISBN) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified ISBN value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If an ISBN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the isbn field. */ + isbn?: Array; + + /** The Manufacturer Part Number (MPN) of a product. This field is paired with the brand field to identify a product. Some eBay categories require MPN values. The GetCategorySpecifics call of the Trading API can be used to see if a category requires an MPN. The MPN value for a product may automatically be populated for an inventory item if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. This field is returned if defined for an inventory item. If an MPN was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the mpn field. Max Length: 65 */ + mpn?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. The subtitle of an existing inventory item can added, modified, or removed with a createOrReplaceInventoryItem call. Note that the same subtitle text should be used for each inventory item that will be part of an inventory item group, and ultimately become one product variation within a multiple-variation listing. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of an inventory item can be added or modified with a createOrReplaceInventoryItem call. Although not immediately required, a title will be needed before an offer with the inventory item is published. The title of an inventory item is automatically populated if the seller specifies an eBay Product ID (ePID) or a Global Trade Item Number (GTIN) and eBay is able to find a matching product in the eBay Catalog. If the inventory item will become part of a single-variation offer, and the listing is not a product-based listing, the text in this field will become the actual listing title for the published offer. However, if the inventory item will become part of a multiple-variation offer, the text in title field of the inventory item group entity will actually become the listing title for the published offer instead, although a title can still be provided for the inventory item, and it will actually become the title of the variation. This field will always be returned for an inventory item that is part of a published offer since a published offer will always have a listing title, but this field will only be returned if defined for inventory items that are not a part of a published offer. Max Length: 80 */ + title?: string | null; + + /** The Universal Product Code (UPC) value for the product. Although an ePID value is preferred when trying to find a product match in the eBay Catalog, this field can also be used in an attempt to find a product match in the eBay Catalog. If a product match is found in the eBay Catalog, the inventory item is automatically populated with available product details such as a title, a product description, product aspects (including the specified UPC value), and a link to any stock image that exists for the catalog product. This field is returned if defined for an inventory item. If a UPC was passed in as an item specific name-value pair through the aspects array in a createOrReplaceInventoryItem call, this value is also picked up by the upc field. */ + upc?: Array; + } + + + /** The base request of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItem { + + /** The details of each inventory item that is being created or updated is passed in under this container. Up to 25 inventory item records can be created and/or updated with one bulkCreateOrReplaceInventoryItem call. */ + requests?: Array; + } + + + /** This type is used to define/modify each inventory item record that is being created and/or updated with the bulkCreateOrReplaceInventoryItem method. Up to 25 inventory item records can be created and/or updated with one call. */ + export interface InventoryItemWithSkuLocale { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem, bulkGetInventoryItem, and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** This is the seller-defined SKU value of the product that will be listed on the eBay site (specified in the marketplaceId field). Only one offer (in unpublished or published state) may exist for each sku/marketplaceId/format combination. This field is required. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOrReplaceInventoryItem method. */ + export interface BulkInventoryItemResponse { + + /** This is the base container of the bulkCreateOrReplaceInventoryItem response. The results of each attempted inventory item creation/update is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the response of the bulkCreateOrReplaceInventoryItem method to indicate the success or failure of creating and/or updating each inventory item record. The sku value in this type identifies each inventory item record. */ + export interface InventoryItemResponse { + + /** This container will be returned if there were one or more errors associated with the creation or update to the inventory item record. */ + errors?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of creating or updating the inventory item record for the inventory item indicated in the sku field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with the creation or update to the inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base container of the bulkMigrateListings request payload. */ + export interface BulkMigrateListing { + + /** This is the base container of the bulkMigrateListings request payload. One to five eBay listings will be included under this container. */ + requests?: Array; + } + + + /** This type is used to specify one to five eBay listings that will be migrated to the new Inventory model. */ + export interface MigrateListing { + + /** The unique identifier of the eBay listing to migrate to the new Inventory model. In the Trading API, this field is known as the ItemID. Up to five unique eBay listings may be specified here in separate listingId fields. The seller should make sure that each of these listings meet the requirements that are stated at the top of this Call Reference page. */ + listingId?: string | null; + } + + + /** This type is used by the response payload of the bulkMigrateListings call. */ + export interface BulkMigrateListingResponse { + + /** This is the base container of the response payload of the bulkMigrateListings call. The results of each attempted listing migration is captured under this container. */ + responses?: Array; + } + + + /** This type is used to display the results of each listing that the seller attempted to migrate. */ + export interface MigrateListingResponse { + + /** If one or more errors occur with the attempt to migrate the listing, this container will be returned with detailed information on each error. */ + errors?: Array; + + /** This field will only be returned for a multiple-variation listing that the seller attempted to migrate. Its value is auto-generated by eBay. For a multiple-variation listing that is successfully migrated to the new Inventory model, eBay automatically creates an inventory item group object for the listing, and the seller will be able to retrieve and manage that new inventory item group object by using the value in this field. */ + inventoryItemGroupKey?: string | null; + + /** This container exists of an array of SKU values and offer IDs. For single-variation listings, this will only be one SKU value and one offer ID (if listing was successfully migrated), but multiple SKU values and offer IDs will be returned for multiple-variation listings. */ + inventoryItems?: Array; + + /** The unique identifier of the eBay listing that the seller attempted to migrate. */ + listingId?: string | null; + + /** This is the unique identifier of the eBay Marketplace where the listing resides. The value fo the eBay US site will be EBAY_US. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** + * This field is returned for each listing that the seller attempted to migrate. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** If one or more warnings occur with the attempt to migrate the listing, this container will be returned with detailed information on each warning. It is possible that a listing can be successfully migrated even if a warning occurs. */ + warnings?: Array; + } + + + /** This type is used by the inventoryItems container that is returned in the response of the bulkMigrateListing call. Up to five sku/offerId pairs may be returned under the inventoryItems container, dependent on how many eBay listings the seller is attempting to migrate to the inventory model. */ + export interface InventoryItemListing { + + /** Upon a successful migration of a listing, eBay auto-generates this unique identifier, and this offer ID value will be used to retrieve and manage the newly-created offer object. This value will only be generated and returned if the eBay listing is migrated successfully. */ + offerId?: string | null; + + /** This is the seller-defined SKU value associated with the item(s) in a listing. This same SKU value will be used to retrieve and manage the newly-created inventory item object if the listing migration is successful. This SKU value will get returned even if the migration is not successful. */ + sku?: string | null; + } + + + /** This type is used by the base request of the bulkPublishOffer method, which is used to publish up to 25 different offers. */ + export interface BulkOffer { + + /** This container is used to pass in an array of offers to publish. Up to 25 offers can be published with one bulkPublishOffer method. */ + requests?: Array; + } + + + /** This type is used by the getListingFees call to indicate the unpublished offer(s) for which expected listing fees will be retrieved. The user passes in one or more offerId values (a maximum of 250). See the Standard selling fees help page for more information on listing fees. */ + export interface OfferKeyWithId { + + /** The unique identifier of an unpublished offer for which expected listing fees will be retrieved. One to 250 offerId values can be passed in to the offers container for one getListingFees call. Errors will occur if offerId values representing published offers are passed in. */ + offerId?: string | null; + } + + + /** This type is used by the base response of the bulkCreateOffer method. */ + export interface BulkOfferResponse { + + /** This is the base container of the bulkCreateOffer response. The results of each attempted offer creation is captured under this container. */ + responses?: Array; + } + + + /** This type is used by the bulkCreateOffer response to show the status of each offer that the seller attempted to create with the bulkCreateOffer method. For each offer that is created successfully, the returned statusCode value should be 200, and a unique offerId should be created for each offer. If any issues occur with the creation of any offers, errors and/or warnings containers will be returned. */ + export interface OfferSkuResponse { + + /** This container will be returned at the offer level, and will contain one or more errors if any occurred with the attempted creation of the corresponding offer. */ + errors?: Array; + + /** This enumeration value indicates the listing format of the offer. The Inventory API currently only supports fixed-price listings, so the enumeration value returned here is always FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This enumeration value is the unique identifier of the eBay marketplace for which the offer will be made available. This enumeration value should be the same for all offers since the bulkCreateOffer method can only be used to create offers for one eBay marketplace at a time. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the newly-created offer. This identifier should be automatically created by eBay if the creation of the offer was successful. It is not returned if the creation of the offer was not successful. In which case, the user may want to scan the corresponding errors and/or warnings container to see what the issue may be. */ + offerId?: string | null; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The sku value is required for each product offer that the seller is trying to create, and it is always returned to identified the product that is associated with the offer. */ + sku?: string | null; + + /** + * The integer value returned in this field is the http status code. If an offer is created successfully, the value returned in this field should be 200. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkCreateOffer method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned at the offer level, and will contain one or more warnings if any occurred with the attempted creation of the corresponding offer. Note that it is possible that an offer can be created successfully even if one or more warnings are triggered. */ + warnings?: Array; + } + + + /** This type is used by the base request payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call allows the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + export interface BulkPriceQuantity { + + /** This container is used by the seller to update the total 'ship-to-home' quantity of one or more inventory items (up to 25) and/or to update the price and/or quantity of one or more specific published offers. */ + requests?: Array; + } + + + /** This type is used to update the total "ship-to-home" quantity for one or more inventory items and/or to update the price and/or quantity of one or more specific offers associated with one or more inventory items. */ + export interface PriceQuantity { + + /** This container is needed if the seller is updating the price and/or quantity of one or more published offers, and a successful call will actually update the active eBay listing with the revised price and/or available quantity. This call is not designed to work with unpublished offers. For unpublished offers, the seller should use the updateOffer call to update the available quantity and/or price. If the seller is also using the shipToLocationAvailability container and sku field to update the total 'ship-to-home' quantity of the inventory item, the SKU value associated with the corresponding offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. A separate (OfferPriceQuantity) node is required for each offer being updated. */ + offers?: Array; + + /** This type is used to specify the total 'ship-to-home' quantity of the inventory item that will be available for purchase through one or more published offers. */ + shipToLocationAvailability?: ShipToLocationAvailability; + + /** This is the seller-defined SKU value of the inventory item whose total 'ship-to-home' quantity will be updated. This field is only required when the seller is updating the total quantity of an inventory item using the shipToLocationAvailability container. If the seller is updating the price and/or quantity of one or more specific offers, one or more offerId values are used instead, and the sku value is not needed. If the seller wants to update the price and/or quantity of one or more offers, and also wants to update the total 'ship-to-home' quantity of the corresponding inventory item, the SKU value associated with the offerId value(s) must be the same as the corresponding sku value that is passed in, or an error will occur. Max Length: 50 */ + sku?: string | null; + } + + + /** This type is used by the offers container in a Bulk Update Price and Quantity call to update the current price and/or quantity of one or more offers associated with a specific inventory item. */ + export interface OfferPriceQuantity { + + /** + * This field is used if the seller wants to modify the current quantity of the inventory item that will be available for purchase in the offer (identified by the corresponding offerId value). Either the availableQuantity field or the price container is required, but not necessarily both. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** This field is the unique identifier of the offer. If an offers container is used to update one or more offers associated to a specific inventory item, the offerId value is required in order to identify the offer to update with a modified price and/or quantity. The seller can run a getOffers call (passing in the correct SKU value as a query parameter) to retrieve offerId values for offers associated with the SKU. */ + offerId?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + price?: Amount; + } + + + /** This type is use by the base response payload of the bulkUpdatePriceQuantity call. The bulkUpdatePriceQuantity call response will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + export interface BulkPriceQuantityResponse { + + /** This container will return an HTTP status code, offer ID, and SKU value for each offer/inventory item being updated, as well as an errors and/or warnings container if any errors or warnings are triggered while trying to update those offers/inventory items. */ + responses?: Array; + } + + + /** This type is used to display the result for each offer and/or inventory item that the seller attempted to update with a bulkUpdatePriceQuantity call. If any errors or warnings occur, the error/warning data is returned at the offer/inventory item level. */ + export interface PriceQuantityResponse { + + /** This array will be returned if there were one or more errors associated with the update to the offer or inventory item record. */ + errors?: Array; + + /** The unique identifier of the offer that was updated. This field will not be returned in situations where the seller is only updating the total 'ship-to-home' quantity of an inventory item record. */ + offerId?: string | null; + + /** This is the seller-defined SKU value of the product. This field is returned whether the seller attempted to update an offer with the SKU value or just attempted to update the total 'ship-to-home' quantity of an inventory item record. Max Length: 50 */ + sku?: string | null; + + /** + * The value returned in this container will indicate the status of the attempt to update the price and/or quantity of the offer (specified in the corresponding offerId field) or the attempt to update the total 'ship-to-home' quantity of an inventory item (specified in the corresponding sku field). For a completely successful update of an offer or inventory item record, a value of 200 will appear in this field. A user can view the HTTP status codes section for information on other status codes that may be returned with the bulkUpdatePriceQuantity method. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This array will be returned if there were one or more warnings associated with the update to the offer or inventory item record. */ + warnings?: Array; + } + + + /** This type is used by the base response of the bulkPublishOffer method. */ + export interface BulkPublishResponse { + + /** A node is returned under the responses container to indicate the success or failure of each offer that the seller was attempting to publish. */ + responses?: Array; + } + + + /** This type is used to indicate the status of each offer that the user attempted to publish. If an offer is successfully published, an eBay listing ID (also known as an Item ID) is returned. If there is an issue publishing the offer and creating the new eBay listing, the information about why the listing failed should be returned in the errors and/or warnings containers. */ + export interface OfferResponseWithListingId { + + /** This container will be returned if there were one or more errors associated with publishing the offer. */ + errors?: Array; + + /** The unique identifier of the newly-created eBay listing. This field is only returned if the seller successfully published the offer and created the new eBay listing. */ + listingId?: string | null; + + /** The unique identifier of the offer that the seller published (or attempted to publish). */ + offerId?: string | null; + + /** + * The HTTP status code returned in this field indicates the success or failure of publishing the offer specified in the offerId field. See the HTTP status codes table to see which each status code indicates. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + + /** This container will be returned if there were one or more warnings associated with publishing the offer. */ + warnings?: Array; + } + + + /** This type is used by the createOrReplaceProductCompatibility call to associate compatible vehicles to an inventory item. This type is also used by the base response of the getProductCompatibility call. */ + export interface Compatibility { + + /** This container consists of an array of motor vehicles (defined by make, model, year, trim, engine) that are compatible with the motor vehicle part or accessory specified by the SKU value. */ + compatibleProducts?: Array; + + /** This is the seller-defined SKU value of the inventory item that will be associated with the compatible vehicles. This field is not applicable to the createOrReplaceProductCompatibility call, but it is always returned with the getProductCompatibility call. For the createOrReplaceProductCompatibility call, the SKU value for the inventory item is actually passed in as part of the call URI, and not in the request payload. */ + sku?: string | null; + } + + + /** This type is used to specify/indicate the motor vehicles that are compatible with the corresponding inventory item. */ + export interface CompatibleProduct { + + /** This container consists of an array of motor vehicles that are compatible with the motor vehicle part or accessory specified by the SKU value in the call URI. Each motor vehicle is defined through a separate set of name/value pairs. In the name field, the vehicle aspect (such as 'make', 'model', 'year', 'trim', or 'engine') will be identified, and the value field will be used to identify the value of each aspect. The getCompatibilityProperties method of the Taxonomy API can be used to retrieve applicable vehicle aspect names for a specified category, and the getCompatibilityPropertyValues method of the Taxonomy API can be used to retrieve possible values for these same vehicle aspect names. Below is an example of identifying one motor vehicle using the compatibilityProperties container: "compatibilityProperties" : [   {    "name" : "make",    "value" : "Subaru"   },   {    "name" : "model",    "value" : "GL"   },   {    "name" : "year",    "value" : "1983"   },   {    "name" : "trim",    "value" : "Base Wagon 4-Door"   },   {    "name" : "engine",    "value" : "1.8L Turbocharged"   } ] Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. Note: The productFamilyProperties container is in the process of being deprecated and will no longer be supported in February of 2021, so if you are a new user of createOrReplaceProductCompatibility, you should use the compatibilityProperties container instead, and if you are already integrated and using the productFamilyProperties container, you should make plans to migrate to compatibilityProperties. The productFamilyProperties and compatibilityProperties containers may not be used together or the call will fail. */ + compatibilityProperties?: Array; + + /** This field is optionally used by the seller to input any notes pertaining to the compatible vehicle list being defined. The seller might use this field to specify the placement of the part on a vehicle or other applicable information. This field will only be returned if specified by the seller. Max Length: 500 */ + notes?: string | null; + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + productFamilyProperties?: ProductFamilyProperties; + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + productIdentifier?: ProductIdentifier; + } + + + /** This type is used by the compatibilityProperties container to identify a motor vehicle using name/value pairs. */ + export interface NameValueList { + + /** This string value identifies the motor vehicle aspect, such as 'make', 'model', 'year', 'trim', and 'engine'. Typically, the make, model, and year of the motor vehicle are always required, with the trim and engine being necessary sometimes, but it will be dependent on the part or accessory, and on the vehicle class. */ + name?: string | null; + + /** This string value identifies the motor vehicle aspect specified in the corresponding name field. For example, if the name field is 'make', this field may be 'Toyota', or if the name field is 'model', this field may be 'Camry'. */ + value?: string | null; + } + + + /** This type is used to specify the details of a motor vehicle that is compatible with the inventory item specified through the SKU value in the call URI. */ + export interface ProductFamilyProperties { + + /** This field indicates the specifications of the engine, including its size, block type, and fuel type. An example is 2.7L V6 gas DOHC naturally aspirated. This field is conditionally required, but should be supplied if known/applicable. */ + engine?: string | null; + + /** This field indicates the make of the vehicle (e.g. Toyota). This field is always required to identify a motor vehicle. */ + make?: string | null; + + /** This field indicates the model of the vehicle (e.g. Camry). This field is always required to identify a motor vehicle. */ + model?: string | null; + + /** This field indicates the trim of the vehicle (e.g. 2-door Coupe). This field is conditionally required, but should be supplied if known/applicable. */ + trim?: string | null; + + /** This field indicates the year of the vehicle (e.g. 2016). This field is always required to identify a motor vehicle. */ + year?: string | null; + } + + + /** This type is used to identify a motor vehicle that is compatible with the corresponding inventory item (the SKU that is passed in as part of the call URI). The motor vehicle can be identified through an eBay Product ID or a K-Type value. The gtin field (for inputting Global Trade Item Numbers) is for future use only. If a motor vehicle is found in the eBay product catalog, the motor vehicle properties (engine, make, model, trim, and year) will automatically get picked up for that motor vehicle. Note: Currently, parts compatibility is only applicable for motor vehicles, but it is possible that the Product Compatibility feature is expanded to other (non-vehicle) products in the future. */ + export interface ProductIdentifier { + + /** This field can be used if the seller already knows the eBay catalog product ID (ePID) associated with the motor vehicle that is to be added to the compatible product list. If this eBay catalog product ID is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. */ + epid?: string | null; + + /** This field can be used if the seller knows the Global Trade Item Number for the motor vehicle that is to be added to the compatible product list. If this GTIN value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim will automatically get picked up for that motor vehicle. Note: This field is for future use. */ + gtin?: string | null; + + /** This field can be used if the seller knows the K Type Number for the motor vehicle that is to be added to the compatible product list. If this K Type value is found in the eBay product catalog, the motor vehicle properties (e.g. make, model, year, engine, and trim) will automatically get picked up for that motor vehicle. Only the DE, UK, and AU sites support the use of K Type Numbers. */ + ktype?: string | null; + } + + + /** This type provides details of an offer, and is used by the response payloads of the getOffer and the getOffers calls. */ + export interface EbayOfferDetailsWithAll { + + /** + * This integer value indicates the quantity of the inventory item (specified by the sku value) that will be available for purchase by buyers shopping on the eBay site specified in the marketplaceId field. For unpublished offers where the available quantity has yet to be set, the availableQuantity value is set to 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the primary eBay category that the inventory item is listed under. This field is always returned for published offers, but is only returned if set for unpublished offers. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** This enumerated value indicates the listing format of the offer. Currently, the only supported value for this field is FIXED_PRICE. For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + listing?: ListingDetails; + + /** The description of the eBay listing that is part of the unpublished or published offer. This field is always returned for published offers, but is only returned if set for unpublished offers. Max Length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** This field indicates the number of days that the listing will be active. 'GTC' (Good 'til Cancelled) listings are automatically renewed each calendar month until the seller decides to end the listing. Note: This field is always returned and its value is always GTC since the Inventory API currently only supports fixed-price listings, and the only supported listing duration for fixed-price listings is 'GTC'. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable and returned if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value in this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** This enumeration value is the unique identifier of the eBay site on which the offer is available, or will be made available. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it can not be modified. To get more information about this inventory location, the getInventoryLocation call can be used, passing in this value at the end of the call URI. This field is always returned for published offers, but is only returned if set for unpublished offers. Max length: 36 */ + merchantLocationKey?: string | null; + + /** The unique identifier of the offer. This identifier is used in many offer-related calls, and it is also used in the bulkUpdatePriceQuantity call. */ + offerId?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity of an inventory item per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceed the quantity in this field. So, if this field's value is 5, each buyer may purchase a quantity of the inventory item between one and five, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This is the seller-defined SKU value of the product in the offer. Max Length: 50 */ + sku?: string | null; + + /** The enumeration value in this field specifies the status of the offer - either PUBLISHED or UNPUBLISHED. For implementation help, refer to eBay API documentation */ + status?: string | null; + + /** This container is returned if the seller chose to place the inventory item into one or two eBay store categories that the seller has set up for their eBay store. The string value(s) in this container will be the full path(s) to the eBay store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used by the listing container in the getOffer and getOffers calls to provide the eBay listing ID, the listing status, and quantity sold for the offer. The listing container is only returned for published offers, and is not returned for unpublished offers. */ + export interface ListingDetails { + + /** The unique identifier of the eBay listing that is associated with the published offer. */ + listingId?: string | null; + + /** The enumeration value returned in this field indicates the status of the listing that is associated with the published offer. For implementation help, refer to eBay API documentation */ + listingStatus?: string | null; + + /** + * This integer value indicates the quantity of the product that has been sold for the published offer. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + soldQuantity?: number | null; + } + + + /** This type provides details of an offer, and is used by the base request payload of the updateOffer call. Every field that is currently set with the unpublished/published offer must also be passed into the updateOffer call, even those fields whose values are not changing. Note that for published offers, a successful updateOffer call will actually update the active eBay listing with whatever changes were made. */ + export interface EbayOfferDetailsWithId { + + /** + * This integer value sets the quantity of the inventory item that will be available through the offer. Quantity must be set to 1 or more in order for the inventory item to be purchasable. This value should not be more than the quantity that is specified for the inventory item record. If this field exists for the current unpublished or published offer, it should be provided again in the updateOffer call, even if the value is not changing. If this particular field is omitted in an updateOffer call, the general available quantity set for the inventory item record may be used instead, and this may not be accurate if the inventory item is being sold across multiple marketplaces. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + availableQuantity?: number | null; + + /** The unique identifier of the eBay category that the inventory item is/will be listed under. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Sellers can use the getCategorySuggestions method of the Taxonomy API or the GetSuggestedCategories call of the Trading API to retrieve suggested category ID values. The seller passes in a query string like "iPhone 6", and category ID values for suggested categories are returned in the response. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the eBay category is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. The eBay category of an active eBay listing cannot be changed once the listing has one or more sales, or if the listing is scheduled to end in less than 12 hours. */ + categoryId?: string | null; + + /** This type is used to identify the charitable organization associated with the listing, and the percentage of the sale proceeds that the charitable organization will receive for each sale generated by the listing. In order to receive a percentage of the sales proceeds, the charitable organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + + /** The text in this field is (published offers), or will become (unpublished offers) the description of the eBay listing. This field is not immediately required for an unpublished offer, but will be required before publishing the offer. Note that if the listingDescription field was omitted in the createOffer call for the offer, the offer entity should have picked up the text provided in the product.description field of the inventory item record, or if the inventory item is part of a group, the offer entity should have picked up the text provided in the description field of the inventory item group record. HTML tags and markup can be used in listing descriptions, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. If this field exists for the current unpublished offer, it should be provided again in the updateOffer call, even if the text is not changing. For a published offer (aka active eBay listing), this field must be provided or an error may occur. Max length: 500000 (which includes HTML markup/tags) */ + listingDescription?: string | null; + + /** Note: This field is not necessary (and has no effect) since 'GTC' (Good 'til Cancelled) is the only supported listing duration, and the listingDuration value gets set to GTC by default. This field indicates the number of days that the seller wants the listing to be active. 'GTC' listings are automatically renewed each calendar month until the seller decides to end the listing. For implementation help, refer to eBay API documentation */ + listingDuration?: string | null; + + /** This type is used to identify the payment, return, and fulfillment listing policies that will be, or are associated with the listing. Every published offer must have a payment, return, and fulfillment listing policy associated with it. This type is also used to override the shipping costs of one or more shipping service options that are associated with the fulfillment policy, to enable eBay Plus eligibility for a listing, or to enable the Best Offer feature on the listing. */ + listingPolicies?: ListingPolicies; + + /** + * This field is only applicable if the listing is a lot listing. A lot listing is a listing that has multiple quantity of the same product. An example would be a set of four identical car tires. The integer value passed into this field is the number of identical items being sold through the lot listing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + lotSize?: number | null; + + /** The unique identifier of a merchant's inventory location (where the inventory item in the offer is located). A merchantLocationKey value is established when the merchant creates an inventory location using the createInventoryLocation call. To get more information about inventory locations, the getInventoryLocation call can be used. This field is not initially required upon first creating an offer, but will become required before an offer can be published. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This type is used to specify the listing price for the product and settings for the Minimum Advertised Price and Strikethrough Pricing features. The price field must be supplied before an offer is published, but a seller may create an offer without supplying a price initially. The Minimum Advertised Price feature is only available on the US site. Strikethrough Pricing is available on the US, eBay Motors, UK, Germany, Canada (English and French), France, Italy, and Spain sites. */ + pricingSummary?: PricingSummary; + + /** + * This field is only applicable and set if the seller wishes to set a restriction on the purchase quantity per seller. If this field is set by the seller for the offer, then each distinct buyer may purchase up to, but not exceeding the quantity specified for this field. So, if this field's value is 5, each buyer may purchase between one to five of these products, and the purchases can occur in one multiple-quantity purchase, or over multiple transactions. If a buyer attempts to purchase one or more of these products, and the cumulative quantity will take the buyer beyond the quantity limit, that buyer will be blocked from that purchase. If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the value is not changing. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantityLimitPerBuyer?: number | null; + + /** This container is used if the seller would like to place the inventory item into one or two store categories that the seller has set up for their eBay store. The string value(s) passed in to this container will be the full path(s) to the store categories, as shown below: "storeCategoryNames": [ "/Fashion/Men/Shirts", "/Fashion/Men/Accessories" ], If this field currently exists for an unpublished or published offer, it should be provided again in an updateOffer call, even if the eBay categories are not changing. */ + storeCategoryNames?: Array; + + /** This type is used to enable the use of a sales tax table, to pass in a tax exception category code, or to specify a VAT percentage. */ + tax?: Tax; + } + + + /** This type is used to express expected listing fees that the seller may incur for one or more unpublished offers, as well as any eBay-related promotional discounts being applied toward a specific fee. These fees are the expected cumulative fees per eBay marketplace (which is indicated in the marketplaceId field). */ + export interface Fee { + + /** This type is used to express a dollar value and the applicable currency. */ + amount?: Amount; + + /** The value returned in this field indicates the type of listing fee that the seller may incur if one or more unpublished offers (offers are specified in the call request) are published on the marketplace specified in the marketplaceId field. Applicable listing fees will often include things such as InsertionFee or SubtitleFee, but many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + feeType?: string | null; + + /** This type is used to express a dollar value and the applicable currency. */ + promotionalDiscount?: Amount; + } + + + /** This type is used to display the expected listing fees for each unpublished offer specified in the request of the getListingFees call. */ + export interface FeeSummary { + + /** This container is an array of listing fees that can be expected to be applied to an offer on the specified eBay marketplace (marketplaceId value). Many fee types will get returned even when they are 0.0. See the Standard selling fees help page for more information on listing fees. */ + fees?: Array; + + /** This is the unique identifier of the eBay site for which listing fees for the offer are applicable. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response payload for the getListingFees call. */ + export interface FeesSummaryResponse { + + /** This container consists of an array of one or more listing fees that the seller can expect to pay for unpublished offers specified in the call request. Many fee types will get returned even when they are 0.0. */ + feeSummaries?: Array; + } + + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + export interface GeoCoordinates { + + /** + * The latitude (North-South) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + latitude?: number | null; + + /** + * The longitude (East-West) component of the geographic coordinate. This field is required if a geoCoordinates container is used. This field is returned if geographical coordinates are set for the inventory location. + * Type: double + */ + longitude?: number | null; + } + + + /** This type is used by the intervals container to define the opening and closing times of a store's working day. Local time (in Military format) is used, with the following format: hh:mm:ss. */ + export interface Interval { + + /** The close value is actually the time that the store closes. Local time (in Military format) is used. So, if a store closed at 8 PM local time, the close time would look like the following: 20:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + close?: string | null; + + /** The open value is actually the time that the store opens. Local time (in Military format) is used. So, if a store opens at 9 AM local time, the close time would look like the following: 09:00:00. This field is conditionally required if the intervals container is used to specify working hours or special hours for a store. This field is returned if set for the store location. */ + open?: string | null; + } + + + /** This type is used to provide detailed information about an inventory item. */ + export interface InventoryItem { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. A condition value is optional up until the seller is ready to publish an offer with the SKU, at which time it becomes required. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of a used inventory item, or an inventory item whose condition value is not NEW, LIKE_NEW, NEW_OTHER, or NEW_WITH_DEFECTS. The conditionDescription field is available for all eBay categories. If the conditionDescription field is used with an item in one of the new conditions (mentioned in previous paragraph), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the used item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. This field is not always required, but is required if an inventory item is being updated and a condition description already exists for that inventory item. This field is returned in the getInventoryItem and getInventoryItems calls if a condition description was provided for a used inventory item. Max Length: 1000. */ + conditionDescription?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + } + + + /** This type is used by the base request payload of the createOrReplaceInventoryItemGroup call and the base response payload of the getInventoryItemGroup call. */ + export interface InventoryItemGroup { + + /** This container consists of an array of aspects that are shared by all product variations within the inventory item group. Common aspects for the inventory item group are not immediately required upon creating an inventory item group, but these aspects will be required before the first offer of the group is published. Common aspects for a men's t-shirt might be pattern and sleeve length. See the example below to get an idea of the JSON syntax that is used to specify common aspects: "aspects": { "pattern": ["solid"], "sleeves": ["short"] }This container is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. */ + aspects?: Array; + + /** The description of the inventory item group. This description should fully describe the product and the variations of the product that are available in the inventory item group, since this description will ultimately become the listing description once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this description will ultimately become the listing description in a multiple-variation listing, the seller should omit the listingDescription field when creating the offers for each variation. If they include the listingDescription field for the individual offer(s) in an item group, the text in that field for a published offer will overwrite the text provided in this description field for the inventory item group. HTML tags and markup can be used in this field, but each character counts toward the max length limit. Note: To ensure that their short listing description is optimized when viewed on mobile devices, sellers should strongly consider using eBay's View Item description summary feature when listing their items. Keep in mind that the 'short' listing description is what prospective buyers first see when they view the listing on a mobile device. The 'full' listing description is also available to mobile users when they click on the short listing description, but the full description is not automatically optimized for viewing in mobile devices, and many users won't even drill down to the full description. Using HTML div and span tag attributes, this feature allows sellers to customize and fully control the short listing description that is displayed to prospective buyers when viewing the listing on a mobile device. The short listing description on mobile devices is limited to 800 characters, and whenever the full listing description (provided in this field, in UI, or seller tool) exceeds this limit, eBay uses a special algorithm to derive the best possible short listing description within the 800-character limit. However, due to some short listing description content being removed, it is definitely not ideal for the seller, and could lead to a bad buyer experience and possibly to a Significantly not as described (SNAD) case, since the buyer may not get complete details on the item when viewing the short listing description. See the eBay help page for more details on using the HTML div and span tags. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 500000 (which includes HTML markup/tags) */ + description?: string | null; + + /** An array of one or more links to images for the inventory item group. URLs must use the "HTTPS" protocol. Images can be self-hosted by the seller, or sellers can use the UploadSiteHostedPictures call of the Trading API to upload images to an eBay Picture Server. If successful, the response of the UploadSiteHostedPictures call will contain a full URL to the image on an eBay Picture Server. This is the URL that will be passed in through the imageUrls array. Before any offer can be published, at least one image must exist for the offer. Links to images can either be passed in through this imageUrls container, or they can be passed in through the product.imageUrls container when creating each inventory item in the group. If the variesBy.aspectsImageVariesBy field is used to specify the main product aspect where the variations vary, the links to the images must be passed in through this imageUrls container, and there should be a picture for each variation. So, if the variesBy.aspectsImageVariesBy field is set to Color, a link should be included to an image demonstrating each available color in the group. Most eBay sites support up to 12 pictures free of charge, and eBay Motors listings can have up to 24 pictures. This container will always be returned for an inventory item group that has at least one published offer since a published offer will always have at least one picture, but this container will only be returned if defined for inventory item groups that have yet to have any published offers. */ + imageUrls?: Array; + + /** This is the unique identifier of the inventory item group. This identifier is created by the seller when an inventory item group is created. This field is only applicable to the getInventoryItemGroup call and not to the createOrReplaceInventoryItemGroup call. In the createOrReplaceInventoryItemGroup call, the inventoryItemGroupKey value is passed into the end of the call URI instead. */ + inventoryItemGroupKey?: string | null; + + /** A subtitle is an optional listing feature that allows the seller to provide more information about the product, possibly including keywords that may assist with search results. An additional listing fee will be charged to the seller if a subtitle is used. For more information on using listing subtitles on the US site, see the Adding a subtitle to your listings help page. Note: Since this subtitle will ultimately become the subtitle in a multiple-variation listing, the seller should not include the subtitle field when creating the inventory items that are members of the group. If they do include the subtitle field in an inventory item record, the text in that field will overwrite the text provided in this subtitle field for each inventory item in the group that is published. This field will only be returned if set for an inventory item. Max Length: 55 */ + subtitle?: string | null; + + /** The title of the inventory item group. This title will ultimately become the listing title once the first offer of the group is published. This field is not initially required when first creating an inventory item group, but will be required before the first offer of the group is published. Note: Since this title will ultimately become the listing title in a multiple-variation listing, the seller should omit the title field when creating the inventory items that are members of the group. If they do include the title field in an inventory item record, the text in that field will overwrite the text provided in this title field for each inventory item in the group that is published. This field is always returned if one or more offers associated with the inventory item group have been published, and is only returned if set for an inventory item group if that group has yet to have any offers published. Max Length: 80 */ + title?: string | null; + + /** This required container is used to assign individual inventory items to the inventory item group. Multiple SKU values are passed in to this container. If updating an existing inventory item group, the seller should make sure that all member SKU values are passed in, as long as the seller wants that SKU to remain in the group. It is also possible to add or remove SKUs with a createOrReplaceInventoryItemGroup call. If the seller wants to remove a SKU from the group, that seller will just omit that SKU value from this container to remove that inventory item/SKU from the inventory item group and any published, multiple-variation listing. However, a variation cannot be removed from the group if that variation has one or more sales for that listing. A workaround for this is to set that variation's quantity to 0 and it will be 'grayed out' in the View Item page. This container is always returned. */ + variantSKUs?: Array; + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + variesBy?: VariesBy; + } + + + /** This type is used to specify the product aspect(s) where individual items of the group vary, as well as a list of the available variations of those aspects. */ + export interface VariesBy { + + /** This container is used if the seller wants to include multiple images to demonstrate how variations within a multiple-variation listing differ. In this string field, the seller will specify the product aspect where the variations of the inventory item group vary, such as color. If Color is specified in this field, Color must also be one of the specifications.name values, and all available colors must appear in the corresponding specifications.values array. If the aspectsImageVariesBy container is used, links to images of each variation should be specified through the imageUrls container of the inventory item group, or the seller can choose to include those links to images in each inventory item record for the inventory items in the group. */ + aspectsImageVariesBy?: Array; + + /** This container consists of an array of one or more product aspects where each variation differs, and values for each of those product aspects. This container is not immediately required, but will be required before the first offer of the inventory item group is published. If a product aspect is specified in the aspectsImageVariesBy container, this product aspect (along with all variations of that product aspect) must be included in the specifications container. Before offers related to the inventory item group are published, the product aspects and values specified through the specifications container should be in synch with the name-value pairs specified through the product.aspects containers of the inventory items contained in the group. For example, if Color and Size are in this specifications container, each inventory item of the group should also have Color and Size as aspect names in their inventory item records. This container is always returned if one or more offers associated with the inventory item group have been published. For inventory item groups that have yet to have any published offers, this container is only returned if set. */ + specifications?: Array; + } + + + /** This type is used to specify product aspects for which variations within an inventory item group vary, and the order in which they appear in the listing. For example, t-shirts in an inventory item group may be available in multiple sizes and colors. */ + export interface Specification { + + /** This is the name of product variation aspect. Typically, for clothing, typical aspect names are "Size" and "Color". Product variation aspects are not required immediately upon creating an inventory item group, but these aspects will be required before a multiple-variation listing containing this inventory item group is published. For each product variation aspect that is specified through the specifications container, one name value is required and two or more variations of this aspect are required through the values array. Note: Each member of the inventory item group should have these same aspect names specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 40 */ + name?: string | null; + + /** This is an array of values pertaining to the corresponding product variation aspect (specified in the name field). Below is a sample of how these values will appear under a specifications container: "specifications": [{ "name": "Size", "values": ["Small", "Medium", "Large"] }, { "name": "Color", "values": ["Blue", "White", "Red"] }] Note: Each member of the inventory item group should have these same aspect names, and each individual inventory item should have each variation of the product aspect values specified through the product.aspects container when the inventory item is created with the createOrReplaceInventoryItem or bulkCreateOrReplaceInventoryItem call. Max Length: 50 */ + values?: Array; + } + + export interface InventoryItemWithSkuLocaleGroupid { + + /** This type is used to specify the quantity of the inventory item that is available for purchase if the item will be shipped to the buyer, and the quantity of the inventory item that is available for In-Store Pickup at one or more of the merchant's physical stores. In-Store Pickup is only available to large merchants selling on the US, UK, Germany, and Australia sites. */ + availability?: Availability; + + /** This enumeration value indicates the condition of the item. Supported item condition values will vary by eBay site and category. To see which item condition values that a particular eBay category supports, use the getItemConditionPolicies method of the Metadata API. This method returns condition ID values that map to the enumeration values defined in the ConditionEnum type. The Item condition ID and name values topic in the Selling Integration Guide has a table that maps condition ID values to ConditionEnum values. The getItemConditionPolicies call reference page has more information. Since the condition of an inventory item must be specified before being published in an offer, this field is always returned in the 'Get' calls for SKUs that are part of a published offer. If a SKU is not part of a published offer, this container will only be returned if set for the inventory item. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** This string field is used by the seller to more clearly describe the condition of used items, or items that are not 'Brand New', 'New with tags', or 'New in box'. The ConditionDescription field is available for all categories. If the ConditionDescription field is used with an item in a new condition (Condition IDs 1000-1499), eBay will simply ignore this field if included, and eBay will return a warning message to the user. This field should only be used to further clarify the condition of the used item. It should not be used for branding, promotions, shipping, returns, payment or other information unrelated to the condition of the item. Make sure that the condition value, condition description, listing description, and the item's pictures do not contradict one another. Max length/: 1000. */ + conditionDescription?: string | null; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item group(s). This array is not returned if the inventory item is not associated with any inventory item groups. */ + groupIds?: Array; + + /** This array is returned if the inventory item is associated with any inventory item group(s). The value(s) returned in this array are the unique identifier(s) of the inventory item's variation in a multiple-variation listing. This array is not returned if the inventory item is not associated with any inventory item groups. */ + inventoryItemGroupKeys?: Array; + + /** This field is for future use only. For implementation help, refer to eBay API documentation */ + locale?: string | null; + + /** This type is used to indicate the package type, weight, and dimensions of the shipping package. Package weight and dimensions are required when calculated shipping rates are used, and weight alone is required when flat-rate shipping is used, but with a weight surcharge. See the Calculated shipping help page for more information on calculated shipping. */ + packageWeightAndSize?: PackageWeightAndSize; + + /** This type is used to define the product details, such as a title, a product description, product aspects/item specifics, and links to images for the product. Optionally, in a createOrReplaceInventoryItem call, a seller can pass in an eBay Product Identifier (ePID) or a Global Trade Item Number (GTIN) value, such as an EAN, an ISBN, a UPC, to identify a product to be matched with a product in the eBay Catalog. The information in this type is also returned in the getInventoryItem, getInventoryItems, and bulkGetInventoryItem calls if defined. */ + product?: Product; + + /** The seller-defined Stock-Keeping Unit (SKU) of the inventory item. The seller should have a unique SKU value for every product that they sell. */ + sku?: string | null; + } + + + /** This type is used by the base response payload of getInventoryItems call. */ + export interface InventoryItems { + + /** This is the URL to the current page of inventory items. */ + href?: string | null; + + /** This container is an array of one or more inventory items, with detailed information on each inventory item. */ + inventoryItems?: Array; + + /** + * This integer value is the number of inventory items that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of inventory items. This field will only be returned if there are additional inventory items to view. */ + next?: string | null; + + /** This is the URL to the previous page of inventory items. This field will only be returned if there are previous inventory items to view. */ + prev?: string | null; + + /** + * This integer value indicates the total number of pages of results that are available. This number will depend on the total number of inventory items available for viewing, and on the limit value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of inventory items that exist for the seller's account. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all inventory items. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the updateInventoryLocation call to update operating hours, special hours, phone number, and other minor details of an inventory location. */ + export interface InventoryLocation { + + /** This text field is used by the merchant to provide/update additional information about an inventory location. Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide/update special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). Whatever text is passed in this field will replace the current text string defined for this field. If the text will not change, the same text should be passed in once again. Max length: 1000 */ + locationInstructions?: string | null; + + /** This text field is used by the merchant to provide/update the Website address (URL) associated with the inventory location. The URL that is passed in this field will replace any other URL that may be defined for this field. Max length: 512 */ + locationWebUrl?: string | null; + + /** This text field is used by the merchant to update the name of the inventory location. This name should be a human-friendly name as it will be in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omitted this field in the createInventoryLocation call, it is required for an updateInventoryLocation call. The name that is passed in this field will replace any other name that may be defined for this field. */ + name?: string | null; + + /** This container is used to provide/update the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. Note that if operating hours are already set for an inventory location for a specific day of the week, whatever is set through an updateInventoryLocation call will override those existing hours. */ + operatingHours?: Array; + + /** This text field is used by the merchant to provide/update the phone number for the inventory location. The phone number that is passed in this field will replace any other phone number that may be defined for this field. Max length: 36 */ + phone?: string | null; + + /** This container is used to provide/update the special operating hours for a store location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. If special hours have already been set up for an inventory location, specifying special hours through an updateInventoryLocation call will only add to the list, unless the date(s) used are the same special date(s) already set up, in which case, the special hours set up through the updateInventoryLocation call will override the existing special hours. */ + specialHours?: Array; + } + + + /** This type is used to express the regular operating hours of a merchant's store during the days of the week. */ + export interface OperatingHours { + + /** A dayOfWeekEnum value is required for each day of the week that the store location has regular operating hours. This field is returned if operating hours are defined for the store location. For implementation help, refer to eBay API documentation */ + dayOfWeekEnum?: string | null; + + /** This container is used to define the opening and closing times of a store's working day (defined in the dayOfWeekEnum field). An intervals container is needed for each day of the week that the store location is open. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed This container is returned if operating hours are defined for the store location. */ + intervals?: Array; + } + + + /** This type is used to express the special operating hours of a store location on a specific date. A specialHours container is needed when the store's opening hours on a specific date are different than the normal operating hours on that particular day of the week. */ + export interface SpecialHours { + + /** A date value is required for each specific date that the store location has special operating hours. The timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-04T07:09:00.000Z This field is returned if set for the store location. */ + date?: string | null; + + /** This container is used to define the opening and closing times of a store on a specific date (defined in the date field). An intervals container is needed for each specific date that the store has special operating hours. These special operating hours on the specific date override the normal operating hours for the specific day of the week. If a store location closes for lunch (or any other period during the day) and then reopens, multiple open and close pairs are needed. This container is returned if set for the store location. */ + intervals?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide details on the inventory location, including the location's name, physical address, operating hours, special hours, phone number and other details of an inventory location. */ + export interface InventoryLocationFull { + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + location?: LocationDetails; + + /** This text field is used by the merchant to provide additional information about an inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is generally used by the merchant to provide special pickup instructions for a store inventory location. Although this field is optional, it is recommended that merchants provide this field to create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field is not included in the call request payload, eBay will use the default pickup instructions contained in the merchant's profile (if available). */ + locationInstructions?: string | null; + + /** This container is used to define the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. If this container is omitted, the location type of the inventory location will default to WAREHOUSE. See StoreTypeEnum for the supported values. Default: WAREHOUSE */ + locationTypes?: Array; + + /** This text field is used by the merchant to provide the Website address (URL) associated with the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** This field is used to indicate whether the inventory location will be enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). If this field is omitted, a successful createInventoryLocation call will automatically enable the inventory location. A merchant may want to create a new inventory location but leave it as disabled if the inventory location is not yet ready for active inventory. Once the inventory location is ready, the merchant can use the enableInventoryLocation call to enable an inventory location that is in a disabled state. See StatusEnum for the supported values. Default: ENABLED For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. A name is not required for warehouse inventory locations. For store inventory locations, this field is not immediately required, but will be required before an offer enabled with the In-Store Pickup or Click and Collect capability can be published. So, if the seller omits this field in a createInventoryLocation call, it becomes required for an updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** Although not technically required, this container is highly recommended to be used to specify operating hours for a store inventory location. This container is used to express the regular operating hours for a store location during each day of the week. A dayOfWeekEnum field and an intervals container will be needed for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** Although not technically required, this field is highly recommended to be used to specify the phone number for a store inventory location. Max length: 36 */ + phone?: string | null; + + /** This container is used to express the special operating hours for a store inventory location on a specific date, such as a holiday. The special hours specified for the specific date will override the normal operating hours for that particular day of the week. */ + specialHours?: Array; + } + + + /** This type is used by the createInventoryLocation call to provide an full or partial address of an inventory location. */ + export interface LocationDetails { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + } + + + /** This type is used by the base response of the getInventoryLocation and getInventoryLocations calls. These responses provide details about inventory location(s) defined for the merchant's account. */ + export interface InventoryLocationResponse { + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + location?: Location; + + /** This text field provides additional information about an inventory location. This field is returned if it is set for the inventory location. Max length: 256 */ + locationAdditionalInformation?: string | null; + + /** This text field is used by the merchant to provide special pickup instructions for the store location. This field can help create a pleasant and easy pickup experience for In-Store Pickup and Click and Collect orders. If this field was not set up through a createInventoryLocation or a updateInventoryLocation call, eBay will use the default pickup instructions contained in the merchant's profile. Max length: 1000 */ + locationInstructions?: string | null; + + /** This container defines the function of the inventory location. Typically, an inventory location will serve as a store or a warehouse, but in some cases, an inventory location may be both. The location type of an inventory location defaults to WAREHOUSE if a location type is not specified when a merchant creates an inventory location. */ + locationTypes?: Array; + + /** This text field shows the Website address (URL) associated with the inventory location. This field is returned if defined for the inventory location. Max length: 512 */ + locationWebUrl?: string | null; + + /** The unique identifier of the inventory location. This identifier is set up by the merchant when the inventory location is first created with the createInventoryLocation call. Once this value is set for an inventory location, it cannot be modified. Max length: 36 */ + merchantLocationKey?: string | null; + + /** This field indicates whether the inventory location is enabled (inventory can be loaded to location) or disabled (inventory can not be loaded to location). The merchant can use the enableInventoryLocation call to enable an inventory location in disabled status, or the disableInventoryLocation call to disable an inventory location in enabled status. For implementation help, refer to eBay API documentation */ + merchantLocationStatus?: string | null; + + /** The name of the inventory location. This name should be a human-friendly name as it will be displayed in In-Store Pickup and Click and Collect listings. For store inventory locations, this field is not required for the createInventoryLocation call, but a store inventory location must have a defined name value before an In-Store Pickup and Click and Collect enabled offer is published. So, if the seller omits this field in the createInventoryLocation call, it will have to be added later through a updateInventoryLocation call. Max length: 1000 */ + name?: string | null; + + /** This container shows the regular operating hours for a store location during the days of the week. A dayOfWeekEnum field and an intervals container is shown for each day of the week that the store location is open. */ + operatingHours?: Array; + + /** The phone number for an inventory location. This field will typically only be set and returned for store locations. Max length: 36 */ + phone?: string | null; + + /** This container shows the special operating hours for a store location on a specific date or dates. */ + specialHours?: Array; + } + + + /** A complex type that is used to provide the physical address of a location, and it geo-coordinates. */ + export interface Location { + + /** This type is used to define the physical address of an inventory location. */ + address?: Address; + + /** This type is used to express the Global Positioning System (GPS) latitude and longitude coordinates of an inventory location. */ + geoCoordinates?: GeoCoordinates; + + /** A unique eBay-assigned ID for the location. Note: This field should not be confused with the seller-defined merchantLocationKey value. It is the merchantLocationKey value which is used to identify an inventory location when working with inventory location API calls. The locationId value is only used internally by eBay. */ + locationId?: string | null; + } + + + /** This type is used by the base response payload for the getInventoryLocations call. */ + export interface LocationResponse { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** An array of one or more of the merchant's inventory locations. */ + locations?: Array; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value is set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items are found, this field is returned with a value of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the base request payload of the getListingFees call. */ + export interface OfferKeysWithId { + + /** This container is used to identify one or more (up to 250)unpublished offers for which expected listing fees will be retrieved. The user passes one or more offerId values (maximum of 250) in to this container to identify the unpublished offers in which to retrieve expected listing fees. This call is only applicable for offers in the unpublished state. The call response gives aggregate fee amounts per eBay marketplace, and does not give fee information at the individual offer level. */ + offers?: Array; + } + + + /** This type is used by the response payload of the createOffer and updateOffer calls, and contains the unique identifier for the offer if the offer is successfully created/updated, as well as any errors and/or warnings that may have been triggered by the call. */ + export interface OfferResponse { + + /** The unique identifier of the offer that was just created with a createOffer call, or just updated with an updateOffer call. It is not returned if the createOffer call fails to create an offer. This identifier will be needed for many offer-related calls. */ + offerId?: string | null; + + /** This container will contain an array of errors and/or warnings when a call is made, and errors and/or warnings occur. */ + warnings?: Array; + } + + + /** This type is used by the base response of the getOffers call, and it is an array of one or more of the seller's offers, along with pagination data. */ + export interface Offers { + + /** This is the URL to the current page of offers. */ + href?: string | null; + + /** + * This integer value is the number of offers that will be displayed on each results page. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** This is the URL to the next page of offers. This field will only be returned if there are additional offers to view. */ + next?: string | null; + + /** This container is an array of one or more of the seller's offers for the SKU value that is passed in through the required sku query parameter. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the getOffers call will only return one offer. Max Occurs: 25 */ + offers?: Array; + + /** This is the URL to the previous page of offers. This field will only be returned if there are previous offers to view. */ + prev?: string | null; + + /** + * This integer value indicates the number of offers being displayed on the current page of results. This number will generally be the same as the limit value if there are additional pages of results to view. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + size?: number | null; + + /** + * This integer value is the total number of offers that exist for the specified SKU value. Based on this number and on the limit value, the seller may have to toggle through multiple pages to view all offers. Note: Currently, the Inventory API does not support the same SKU across multiple eBay marketplaces, so the Get Offers call will only return one offer, so this value should always be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type is used by the request payload of the publishByInventoryItemGroup call. The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. */ + export interface PublishByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. All unpublished offers associated with this inventory item group will be published as a multiple-variation listing if the publishByInventoryItemGroup call is successful. The inventoryItemGroupKey identifier is automatically generated by eBay once an inventory item group is created. To retrieve an inventoryItemGroupKey value, you can use the getInventoryItem call to retrieve an inventory item that is known to be in the inventory item group to publish, and then look for the inventory item group identifier under the groupIds container in the response of that call. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site on which the multiple-variation listing will be published. The marketPlaceId enumeration values are found in MarketplaceIdEnum. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** This type is used by the base response payload of the publishOffer and publishOfferByInventoryItemGroup calls. */ + export interface PublishResponse { + + /** The unique identifier of the newly created eBay listing. This field is returned if the single offer (if publishOffer call was used) or group of offers in an inventory item group (if publishOfferByInventoryItemGroup call was used) was successfully converted into an eBay listing. */ + listingId?: string | null; + + /** This container will contain an array of errors and/or warnings if any occur when a publishOffer or publishOfferByInventoryItemGroup call is made. */ + warnings?: Array; + } + + + /** This type is used to show the version number and instance of the service or API. */ + export interface Version { + + /** This type is used to show the version number and instance of the service or API. */ + instance?: Version; + + /** The version number of the service or API. */ + version?: string | null; + } + + + /** This type is used by the base request of the WithdrawByInventoryItemGroup method, which is used to end a multiple-variation listing. */ + export interface WithdrawByInventoryItemGroupRequest { + + /** This is the unique identifier of the inventory item group. This identifier is automatically generated by eBay once an inventory item group is created. This field is required. */ + inventoryItemGroupKey?: string | null; + + /** This is the unique identifier of the eBay site for which the offer will be made available. The marketPlaceId enumeration values are found in MarketplaceIdEnum. This field is required. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + } + + + /** The base response of the withdrawOffer call. */ + export interface WithdrawResponse { + + /** The unique identifier of the eBay listing associated with the offer that was withdrawn. This field will not be returned if the eBay listing was not successfully ended. */ + listingId?: string | null; + + /** This container will be returned if there were one or more warnings associated with the attempt to withdraw the offer. */ + warnings?: Array; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This call retrieves all defined details of the inventory location that is specified by the merchantLocationKey path parameter. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to specify the inventory location to retrieve. Max length: 36 + * @return {InventoryLocationResponse} Success + */ + GetInventoryLocation(merchantLocationKey: string): Observable { + return this.http.get(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), {}); + } + + /** + * Use this call to create a new inventory location. In order to create and publish an offer (and create an eBay listing), a seller must have at least one inventory location, as every offer must be associated with a location. Upon first creating an inventory location, only a seller-defined location identifier and a physical location is required, and once set, these values can not be changed. The unique identifier value (merchantLocationKey) is passed in at the end of the call URI. This merchantLocationKey value will be used in other Inventory Location calls to identify the inventory location to perform an action against. At this time, location types are either warehouse or store. Warehouse locations are used for traditional shipping, and store locations are generally used by US merchants selling products through the In-Store Pickup program, or used by UK, Australian, and German merchants selling products through the Click and Collect program. A full address is required for store inventory locations. However, for warehouse inventory locations, a full street address is not needed, but the city, state/province, and country of the location must be provided. Note that all inventory locations are "enabled" by default when they are created, and you must specifically disable them (by passing in a value of DISABLED in the merchantLocationStatus field) if you want them to be set to the disabled state. The seller's inventory cannot be loaded to inventory locations in the disabled state. In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the createInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique, merchant-defined key (ID) for an inventory location. This unique identifier, or key, is used in other Inventory API calls to identify an inventory location. Max length: 36 + * @param {InventoryLocationFull} requestBody Inventory Location details + * @return {void} + */ + CreateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocationFull): Observable> { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call deletes the inventory location that is specified in the merchantLocationKey path parameter. Note that deleting a location will not affect any active eBay listings associated with the deleted location, but the seller will not be able modify the offers associated with the inventory location once it is deleted. The authorization HTTP header is the only required request header for this call. Unless one or more errors and/or warnings occur with the call, there is no response payload for this call. A successful call will return an HTTP status value of 200 OK. + * Delete location/{merchantLocationKey} + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in at the end of the call URI to indicate the inventory location to be deleted. Max length: 36 + * @return {void} + */ + DeleteInventoryLocation(merchantLocationKey: string): Observable> { + return this.http.delete(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call disables the inventory location that is specified in the merchantLocationKey path parameter. Sellers can not load/modify inventory to disabled inventory locations. Note that disabling an inventory location will not affect any active eBay listings associated with the disabled location, but the seller will not be able modify the offers associated with a disabled inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/disable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to disable the specified inventory location. Max length: 36 + * @return {string} Success + */ + DisableInventoryLocation(merchantLocationKey: string): Observable { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/disable', null, { responseType: 'text' }); + } + + /** + * This call enables a disabled inventory location that is specified in the merchantLocationKey path parameter. Once a disabled inventory location is enabled, sellers can start loading/modifying inventory to that inventory location. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Post location/{merchantLocationKey}/enable + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in through the call URI to specify the disabled inventory location to enable. Max length: 36 + * @return {string} Success + */ + EnableInventoryLocation(merchantLocationKey: string): Observable { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/enable', null, { responseType: 'text' }); + } + + /** + * This call retrieves all defined details for every inventory location associated with the seller's account. There are no required parameters for this call and no request payload. However, there are two optional query parameters, limit and offset. The limit query parameter sets the maximum number of inventory locations returned on one page of data, and the offset query parameter specifies the page of data to return. These query parameters are discussed more in the URI parameters table below. The authorization HTTP header is the only required request header for this call. A successful call will return an HTTP status value of 200 OK. + * Get location + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1 + * @param {string} offset Specifies the number of locations to skip in the result set before returning the first location in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {LocationResponse} Success + */ + GetInventoryLocations(limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'location?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * Use this call to update non-physical location details for an existing inventory location. Specify the inventory location you want to update using the merchantLocationKey path parameter. You can update the following text-based fields: name, phone, locationWebUrl, locationInstructions and locationAdditionalInformation. Whatever text is passed in for these fields in an updateInventoryLocation call will replace the current text strings defined for these fields. For store inventory locations, the operating hours and/or the special hours can also be updated. The merchant location key, the physical location of the store, and its geo-location coordinates can not be updated with an updateInventoryLocation call In addition to the authorization header, which is required for all eBay REST API calls, the following table includes another request header that is mandatory for the updateInventoryLocation call, and two other request headers that are optional: Header Description Required? Applicable Values Accept Describes the response encoding, as required by the caller. Currently, the interfaces require payloads formatted in JSON, and JSON is the default. No application/json Content-Language Use this header to control the language that is used for any returned errors or warnings in the call response. No en-US Content-Type The MIME type of the body of the request. Must be JSON. Yes application/json Unless one or more errors and/or warnings occurs with the call, there is no response payload for this call. A successful call will return an HTTP status value of 204 No Content. + * Post location/{merchantLocationKey}/update_location_details + * @param {string} merchantLocationKey A unique merchant-defined key (ID) for an inventory location. This value is passed in the call URI to indicate the inventory location to be updated. Max length: 36 + * @param {InventoryLocation} requestBody The inventory location details to be updated (other than the address and geo co-ordinates). + * @return {void} + */ + UpdateInventoryLocation(merchantLocationKey: string, requestBody: InventoryLocation): Observable> { + return this.http.post(this.baseUri + 'location/' + (merchantLocationKey == null ? '' : encodeURIComponent(merchantLocationKey)) + '/update_location_details', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves the inventory item record for a given SKU. The SKU value is passed in at the end of the call URI. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Get inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to retrieve. Max length: 50. + * @return {InventoryItemWithSkuLocaleGroupid} Success + */ + GetInventoryItem(sku: string): Observable { + return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), {}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call creates a new inventory item record or replaces an existing inventory item record. It is up to sellers whether they want to create a complete inventory item record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItem call, and then make one or more additional createOrReplaceInventoryItem calls to complete all required fields for the inventory item record and prepare it for publishing. Upon first creating an inventory item record, only the SKU value in the call path is required. In the case of replacing an existing inventory item record, the createOrReplaceInventoryItem call will do a complete replacement of the existing inventory item record, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a getInventoryItem call to retrieve the full inventory item record and see all of its current values/settings before attempting to update the record. And if changes are made to an inventory item that is part of one or more active eBay listings, a successful call will automatically update these eBay listings. The key information that is set with the createOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. This SKU value is passed in at the end of the call URI Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update numerous inventory item records with one call (up to 25 at a time), the bulkCreateOrReplaceInventoryItem method can be used. + * Put inventory_item/{sku} + * @param {string} sku The seller-defined SKU value for the inventory item is required whether the seller is creating a new inventory item, or updating an existing inventory item. This SKU value is passed in at the end of the call URI. SKU values must be unique across the seller's inventory. Max length: 50. + * @param {InventoryItem} requestBody Details of the inventory item record. + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItem(sku: string, requestBody: InventoryItem): Observable { + return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to delete an inventory item record associated with a specified SKU. A successful call will not only delete that inventory item record, but will also have the following effects: Delete any and all unpublished offers associated with that SKU; Delete any and all single-variation eBay listings associated with that SKU; Automatically remove that SKU from a multiple-variation listing and remove that SKU from any and all inventory item groups in which that SKU was a member. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Delete inventory_item/{sku} + * @param {string} sku This is the seller-defined SKU value of the product whose inventory item record you wish to delete. Max length: 50. + * @return {void} + */ + DeleteInventoryItem(sku: string): Observable> { + return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves all inventory item records defined for the seller's account. The limit query parameter allows the seller to control how many records are returned per page, and the offset query parameter is used to retrieve a specific page of records. The seller can make multiple calls to scan through multiple pages of records. There is no request payload for this call. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve numerous inventory item records by SKU value with one call (up to 25 at a time), the bulkGetInventoryItem method can be used. + * Get inventory_item + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be an integer from 1 to 100. If this query parameter is not set, up to 100 records will be returned on each page of results. Min: 1, Max: 100 + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {InventoryItems} Success + */ + GetInventoryItems(limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'inventory_item?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This call is used by the seller to update the total ship-to-home quantity of one inventory item, and/or to update the price and/or quantity of one or more offers associated with one inventory item. Up to 25 offers associated with an inventory item may be updated with one bulkUpdatePriceQuantity call. Only one SKU (one product) can be updated per call. The getOffers call can be used to retrieve all offers associated with a SKU. The seller will just pass in the correct SKU value through the sku query parameter. To update an offer, the offerId value is required, and this value is returned in the getOffers call response. It is also useful to know which offers are unpublished and which ones are published. To get this status, look for the status value in the getOffers call response. Offers in the published state are live eBay listings, and these listings will be revised with a successful bulkUpdatePriceQuantity call. An issue will occur if duplicate offerId values are passed through the same offers container, or if one or more of the specified offers are associated with different products/SKUs. Note: For multiple-variation listings, it is recommended that the bulkUpdatePriceQuantity call be used to update price and quantity information for each SKU within that multiple-variation listing instead of using createOrReplaceInventoryItem calls to update the price and quantity for each SKU. Just remember that only one SKU (one product variation) can be updated per call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Post bulk_update_price_quantity + * @param {BulkPriceQuantity} requestBody Price and allocation details for the given SKU and Marketplace + * @return {BulkPriceQuantityResponse} Success + */ + BulkUpdatePriceQuantity(requestBody: BulkPriceQuantity): Observable { + return this.http.post(this.baseUri + 'bulk_update_price_quantity', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call can be used to create and/or update up to 25 new inventory item records. It is up to sellers whether they want to create a complete inventory item records right from the start, or sellers can provide only some information with the initial bulkCreateOrReplaceInventoryItem call, and then make one or more additional bulkCreateOrReplaceInventoryItem calls to complete all required fields for the inventory item records and prepare for publishing. Upon first creating inventory item records, only the SKU values are required. In the case of updating existing inventory item records, the bulkCreateOrReplaceInventoryItem call will do a complete replacement of the existing inventory item records, so all fields that are currently defined for the inventory item record are required in that update action, regardless of whether their values changed. So, when replacing/updating an inventory item record, it is advised that the seller run a 'Get' call to retrieve the full details of the inventory item records and see all of its current values/settings before attempting to update the records. Any changes that are made to inventory item records that are part of one or more active eBay listings, a successful call will automatically update these active listings. The key information that is set with the bulkCreateOrReplaceInventoryItem call include: Seller-defined SKU value for the product. Each seller product, including products within an item inventory group, must have their own SKU value. Condition of the item Product details, including any product identifier(s), such as a UPC, ISBN, EAN, or Brand/Manufacturer Part Number pair, a product description, a product title, product/item aspects, and links to images. eBay will use any supplied eBay Product ID (ePID) or a GTIN (UPC, ISBN, or EAN) and attempt to match those identifiers to a product in the eBay Catalog, and if a product match is found, the product details for the inventory item will automatically be populated. Quantity of the inventory item that is available for purchase Package weight and dimensions, which is required if the seller will be offering calculated shipping options. The package weight will also be required if the seller will be providing flat-rate shipping services, but charging a weight surcharge. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOrReplaceInventoryItem call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create or update a single inventory item record, the createOrReplaceInventoryItem method can be used. + * Post bulk_create_or_replace_inventory_item + * @param {BulkInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkInventoryItemResponse} Success + */ + BulkCreateOrReplaceInventoryItem(requestBody: BulkInventoryItem): Observable { + return this.http.post(this.baseUri + 'bulk_create_or_replace_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call retrieves up to 25 inventory item records. The SKU value of each inventory item record to retrieve is specified in the request payload. The authorization header is the only required HTTP header for this call, and it is required for all Inventory API calls. See the HTTP request headers section for more information. For those who prefer to retrieve only one inventory item record by SKU value, , the getInventoryItem method can be used. To retrieve all inventory item records defined on the seller's account, the getInventoryItems method can be used (with pagination control if desired). + * Post bulk_get_inventory_item + * @param {BulkGetInventoryItem} requestBody Details of the inventories with sku and locale + * @return {BulkGetInventoryItemResponse} Success + */ + BulkGetInventoryItem(requestBody: BulkGetInventoryItem): Observable { + return this.http.post(this.baseUri + 'bulk_get_inventory_item', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used by the seller to retrieve the list of products that are compatible with the inventory item. The SKU value for the inventory item is passed into the call URI, and a successful call with return the compatible vehicle list associated with this inventory item. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Get inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {Compatibility} Success + */ + GetProductCompatibility(sku: string): Observable { + return this.http.get(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', {}); + } + + /** + * This call is used by the seller to create or replace a list of products that are compatible with the inventory item. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceProductCompatibility call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @param {Compatibility} requestBody Details of the compatibility + * @return {BaseResponse} Success + */ + CreateOrReplaceProductCompatibility(sku: string, requestBody: Compatibility): Observable { + return this.http.put(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used by the seller to delete the list of products that are compatible with the inventory item that is associated with the compatible product list. The inventory item is identified with a SKU value in the URI. Product compatibility is currently only applicable to motor vehicle parts and accessory categories, but more categories may be supported in the future. + * Delete inventory_item/{sku}/product_compatibility + * @param {string} sku A SKU (stock keeping unit) is an unique identifier defined by a seller for a product + * @return {void} + */ + DeleteProductCompatibility(sku: string): Observable> { + return this.http.delete(this.baseUri + 'inventory_item/' + (sku == null ? '' : encodeURIComponent(sku)) + '/product_compatibility', { observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves all existing offers for the specified SKU value. The seller has the option of limiting the offers that are retrieved to a specific eBay marketplace, or to a listing format. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, and the only supported listing format is fixed-price, so the marketplace_id and format query parameters currently do not have any practical use for this call. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer + * @param {string} sku The seller-defined SKU value is passed in as a query parameter. All offers associated with this product are returned in the response. Max length: 50. + * @param {string} marketplace_id The unique identifier of the eBay marketplace. This query parameter will be passed in if the seller only wants to see the product's offers on a specific eBay marketplace. Note: At this time, the same SKU value can not be offered across multiple eBay marketplaces, so the marketplace_id query parameter currently does not have any practical use for this call. + * @param {string} format This enumeration value sets the listing format for the offer. This query parameter will be passed in if the seller only wants to see offers in this specified listing format. Note: At this time, the only supported listing format is fixed-price, so the format query parameter currently does not have any practical use for this call. + * @param {string} limit The value passed in this query parameter sets the maximum number of records to return per page of data. Although this field is a string, the value passed in this field should be a positive integer value. If this query parameter is not set, up to 100 records will be returned on each page of results. + * @param {string} offset The value passed in this query parameter sets the page number to retrieve. Although this field is a string, the value passed in this field should be a integer value equal to or greater than 0. The first page of records has a value of 0, the second page of records has a value of 1, and so on. If this query parameter is not set, its value defaults to 0, and the first page of records is returned. + * @return {Offers} Success + */ + GetOffers(sku: string | null | undefined, marketplace_id: string | null | undefined, format: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'offer?sku=' + (sku == null ? '' : encodeURIComponent(sku)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&format=' + (format == null ? '' : encodeURIComponent(format)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This call creates an offer for a specific inventory item on a specific eBay marketplace. It is up to the sellers whether they want to create a complete offer (with all necessary details) right from the start, or sellers can provide only some information with the initial createOffer call, and then make one or more subsequent updateOffer calls to complete the offer and prepare to publish the offer. Upon first creating an offer, the following fields are required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before an offer can be published are highlighted below. These settings are either set with createOffer, or they can be set with a subsequent updateOffer call: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, a unique offerId value is returned in the response. This value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run the publishOffer call to convert the offer to an active eBay listing. In addition to the authorization header, which is required for all eBay REST API calls, the createOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create multiple offers (up to 25 at a time) with one call, the bulkCreateOffer method can be used. + * Post offer + * @param {EbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {void} + */ + CreateOffer(requestBody: EbayOfferDetailsWithKeys): Observable> { + return this.http.post(this.baseUri + 'offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves a specific published or unpublished offer. The unique identifier of the offer (offerId) is passed in at the end of the call URI. The authorization header is the only required HTTP header for this call. See the HTTP request headers section for more information. + * Get offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is to be retrieved. + * @return {EbayOfferDetailsWithAll} Success + */ + GetOffer(offerId: string): Observable { + return this.http.get(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), {}); + } + + /** + * This call updates an existing offer. An existing offer may be in published state (active eBay listing), or in an unpublished state and yet to be published with the publishOffer call. The unique identifier (offerId) for the offer to update is passed in at the end of the call URI. The updateOffer call does a complete replacement of the existing offer object, so all fields that make up the current offer object are required, regardless of whether their values changed. Other information that is required before an unpublished offer can be published or before a published offer can be revised include: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings For published offers, the listingDescription field is also required to update the offer/eBay listing. For unpublished offers, this field is not necessarily required unless it is already set for the unpublished offer. In addition to the authorization header, which is required for all eBay REST API calls, the updateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put offer/{offerId} + * @param {string} offerId The unique identifier of the offer that is being updated. This identifier is passed in at the end of the call URI. + * @param {EbayOfferDetailsWithId} requestBody Details of the offer for the channel + * @return {OfferResponse} Success + */ + UpdateOffer(offerId: string, requestBody: EbayOfferDetailsWithId): Observable { + return this.http.put(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * If used against an unpublished offer, this call will permanently delete that offer. In the case of a published offer (or live eBay listing), a successful call will either end the single-variation listing associated with the offer, or it will remove that product variation from the eBay listing and also automatically remove that product variation from the inventory item group. In the case of a multiple-variation listing, the deleteOffer will not remove the product variation from the listing if that variation has one or more sales. If that product variation has one or more sales, the seller can alternately just set the available quantity of that product variation to 0, so it is not available in the eBay search or View Item page, and then the seller can remove that product variation from the inventory item group at a later time. + * Delete offer/{offerId} + * @param {string} offerId The unique identifier of the offer to delete. The unique identifier of the offer (offerId) is passed in at the end of the call URI. + * @return {void} + */ + DeleteOffer(offerId: string): Observable> { + return this.http.delete(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call is used to convert an unpublished offer into a published offer, or live eBay listing. The unique identifier of the offer (offerId) is passed in at the end of the call URI. For those who prefer to publish multiple offers (up to 25 at a time) with one call, the bulkPublishOffer method can be used. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post offer/{offerId}/publish/ + * @param {string} offerId The unique identifier of the offer that is to be published. + * @return {PublishResponse} Success + */ + PublishOffer(offerId: string): Observable { + return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/publish/', null, {}); + } + + /** + * Note: Please note that any eBay listing created using the Inventory API cannot be revised or relisted using the Trading API calls. This call is used to convert all unpublished offers associated with an inventory item group into an active, multiple-variation listing. The unique identifier of the inventory item group (inventoryItemGroupKey) is passed in the request payload. All inventory items and their corresponding offers in the inventory item group must be valid (meet all requirements) for the publishOfferByInventoryItemGroup call to be completely successful. For any inventory items in the group that are missing required data or have no corresponding offers, the publishOfferByInventoryItemGroup will create a new multiple-variation listing, but any inventory items with missing required data/offers will not be in the newly-created listing. If any inventory items in the group to be published have invalid data, or one or more of the inventory items have conflicting data with one another, the publishOfferByInventoryItemGroup call will fail. Be sure to check for any error or warning messages in the call response for any applicable information about one or more inventory items/offers having issues. + * Post offer/publish_by_inventory_item_group/ + * @param {PublishByInventoryItemGroupRequest} requestBody The identifier of the inventory item group to publish and the eBay marketplace where the listing will be published is needed in the request payload. + * @return {PublishResponse} Success + */ + PublishOfferByInventoryItemGroup(requestBody: PublishByInventoryItemGroupRequest): Observable { + return this.http.post(this.baseUri + 'offer/publish_by_inventory_item_group/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to end a multiple-variation eBay listing that is associated with the specified inventory item group. This call only ends multiple-variation eBay listing associated with the inventory item group but does not delete the inventory item group object. Similarly, this call also does not delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. If the seller wanted to relist the multiple-variation eBay listing, they could use the publishOfferByInventoryItemGroup method. + * Post offer/withdraw_by_inventory_item_group + * @param {WithdrawByInventoryItemGroupRequest} requestBody The base request of the withdrawOfferByInventoryItemGroup call. + * @return {void} + */ + WithdrawOfferByInventoryItemGroup(requestBody: WithdrawByInventoryItemGroupRequest): Observable> { + return this.http.post(this.baseUri + 'offer/withdraw_by_inventory_item_group', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call is used to retrieve the expected listing fees for up to 250 unpublished offers. An array of one or more offerId values are passed in under the offers container. In the response payload, all listing fees are grouped by eBay marketplace, and listing fees per offer are not shown. A fees container will be returned for each eBay marketplace where the seller is selling the products associated with the specified offers. Errors will occur if the seller passes in offerIds that represent published offers, so this call should be made before the seller publishes offers with the publishOffer. + * Post offer/get_listing_fees + * @param {OfferKeysWithId} requestBody List of offers that needs fee information + * @return {FeesSummaryResponse} Success + */ + GetListingFees(requestBody: OfferKeysWithId): Observable { + return this.http.post(this.baseUri + 'offer/get_listing_fees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call creates multiple offers (up to 25) for specific inventory items on a specific eBay marketplace. Although it is not a requirement for the seller to create complete offers (with all necessary details) right from the start, eBay recommends that the seller provide all necessary details with this call since there is currently no bulk operation available to update multiple offers with one call. The following fields are always required in the request payload: sku, marketplaceId, and (listing) format. Other information that will be required before a offer can be published are highlighted below: Inventory location Offer price Available quantity eBay listing category Referenced listing policy profiles to set payment, return, and fulfillment values/settings If the call is successful, unique offerId values are returned in the response for each successfully created offer. The offerId value will be required for many other offer-related calls. Note that this call only stages an offer for publishing. The seller must run either the publishOffer, bulkPublishOffer, or publishOfferByInventoryItemGroup call to convert offer(s) into an active single- or multiple-variation listing. In addition to the authorization header, which is required for all eBay REST API calls, the bulkCreateOffer call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. For those who prefer to create a single offer per call, the createOffer method can be used instead. + * Post bulk_create_offer + * @param {BulkEbayOfferDetailsWithKeys} requestBody Details of the offer for the channel + * @return {BulkOfferResponse} Success + */ + BulkCreateOffer(requestBody: BulkEbayOfferDetailsWithKeys): Observable { + return this.http.post(this.baseUri + 'bulk_create_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to convert unpublished offers (up to 25) into published offers, or live eBay listings. The unique identifier (offerId) of each offer to publlish is passed into the request payload. It is possible that some unpublished offers will be successfully created into eBay listings, but others may fail. The response payload will show the results for each offerId value that is passed into the request payload. The errors and warnings containers will be returned for an offer that had one or more issues being published. For those who prefer to publish one offer per call, the publishOffer method can be used instead. In the case of a multiple-variation listing, the publishOfferByInventoryItemGroup call should be used instead, as this call will convert all unpublished offers associated with an inventory item group into a multiple-variation listing. + * Post bulk_publish_offer + * @param {BulkOffer} requestBody The base request of the bulkPublishOffer method. + * @return {BulkPublishResponse} Success + */ + BulkPublishOffer(requestBody: BulkOffer): Observable { + return this.http.post(this.baseUri + 'bulk_publish_offer', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call is used to end a single-variation listing that is associated with the specified offer. This call is used in place of the deleteOffer call if the seller only wants to end the listing associated with the offer but does not want to delete the offer object. With this call, the offer object remains, but it goes into the unpublished state, and will require a publishOffer call to relist the offer. To end a multiple-variation listing that is associated with an inventory item group, the withdrawOfferByInventoryItemGroup method can be used. This call only ends the multiple-variation listing associated with an inventory item group but does not delete the inventory item group object, nor does it delete any of the offers associated with the inventory item group, but instead all of these offers go into the unpublished state. + * Post offer/{offerId}/withdraw + * @param {string} offerId The unique identifier of the offer that is to be withdrawn. This value is passed into the path of the call URI. + * @return {WithdrawResponse} Success + */ + WithdrawOffer(offerId: string): Observable { + return this.http.post(this.baseUri + 'offer/' + (offerId == null ? '' : encodeURIComponent(offerId)) + '/withdraw', null, {}); + } + + /** + * This call retrieves the inventory item group for a given inventoryItemGroupKey value. The inventoryItemGroupKey value is passed in at the end of the call URI. + * Get inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to retrieve is passed in at the end of the call URI. + * @return {InventoryItemGroup} Success + */ + GetInventoryItemGroup(inventoryItemGroupKey: string): Observable { + return this.http.get(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), {}); + } + + /** + * This call creates a new inventory item group or updates an existing inventory item group. It is up to sellers whether they want to create a complete inventory item group record right from the start, or sellers can provide only some information with the initial createOrReplaceInventoryItemGroup call, and then make one or more additional createOrReplaceInventoryItemGroup calls to complete the inventory item group record. Upon first creating an inventory item group record, the only required elements are the inventoryItemGroupKey identifier in the call URI, and the members of the inventory item group specified through the variantSKUs array in the request payload. In the case of updating/replacing an existing inventory item group, this call does a complete replacement of the existing inventory item group record, so all fields (including the member SKUs) that make up the inventory item group are required, regardless of whether their values changed. So, when replacing/updating an inventory item group record, it is advised that the seller run a getInventoryItemGroup call for that inventory item group to see all of its current values/settings/members before attempting to update the record. And if changes are made to an inventory item group that is part of a live, multiple-variation eBay listing, these changes automatically update the eBay listing. For example, if a SKU value is removed from the inventory item group, the corresponding product variation will be removed from the eBay listing as well. In addition to the required inventory item group identifier and member SKUs, other key information that is set with this call include: Title and description of the inventory item group. The string values provided in these fields will actually become the listing title and listing description of the listing once the first SKU of the inventory item group is published successfully Common aspects that inventory items in the qroup share Product aspects that vary within each product variation Links to images demonstrating the variations of the product, and these images should correspond to the product aspect that is set with the variesBy.aspectsImageVariesBy field In addition to the authorization header, which is required for all eBay REST API calls, the createOrReplaceInventoryItemGroup call also requires the Content-Language header, that sets the natural language that will be used in the field values of the request payload. For US English, the code value passed in this header should be en-US. To view other supported Content-Language values, and to read more about all supported HTTP headers for eBay REST API calls, see the HTTP request headers topic in the Using eBay RESTful APIs document. + * Put inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey Unique identifier of the inventory item group. This identifier is supplied by the seller. The inventoryItemGroupKey value for the inventory item group to create/update is passed in at the end of the call URI. This value cannot be changed once it is set. + * @param {InventoryItemGroup} requestBody Details of the inventory Item Group + * @return {BaseResponse} Success + */ + CreateOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, requestBody: InventoryItemGroup): Observable { + return this.http.put(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This call deletes the inventory item group for a given inventoryItemGroupKey value. + * Delete inventory_item_group/{inventoryItemGroupKey} + * @param {string} inventoryItemGroupKey The unique identifier of an inventory item group. This value is assigned by the seller when an inventory item group is created. The inventoryItemGroupKey value for the inventory item group to delete is passed in at the end of the call URI. + * @return {void} + */ + DeleteInventoryItemGroup(inventoryItemGroupKey: string): Observable> { + return this.http.delete(this.baseUri + 'inventory_item_group/' + (inventoryItemGroupKey == null ? '' : encodeURIComponent(inventoryItemGroupKey)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call is used to convert existing eBay Listings to the corresponding Inventory API objects. If an eBay listing is successfully migrated to the Inventory API model, new Inventory Location, Inventory Item, and Offer objects are created. For a multiple-variation listing that is successfully migrated, in addition to the three new Inventory API objects just mentioned, an Inventory Item Group object will also be created. If the eBay listing is a motor vehicle part or accessory listing with a compatible vehicle list (ItemCompatibilityList container in Trading API's Add/Revise/Relist/Verify calls), a Product Compatibility object will be created. Migration Requirements To be eligible for migration, the active eBay listings must meet the following requirements: Listing type is Fixed-Price Listing duration is 'GTC' (Good 'til Cancelled) The item(s) in the listings must have seller-defined SKU values associated with them, and in the case of a multiple-variation listing, each product variation must also have its own SKU value Business Polices (Payment, Return Policy, and Shipping) must be used on the listing, as legacy payment, return policy, and shipping fields will not be accepted. With the Payment Policy associated with a listing, the immediate payment requirement must be enabled, and the only accepted payment method should be PayPal The postal/zip code (PostalCode field in Trading's ItemType) or city (Location field in Trading's ItemType) must be set in the listing; the country is also needed, but this value is required in Trading API, so it will always be set for every listing Unsupported Listing Features The following features are not yet available to be set or modified through the Inventory API, but they will remain on the active eBay listing, even after a successful migration to the Inventory model. The downside to this is that the seller will be completely blocked (in APIs or My eBay) from revising these features/settings once the migration takes place: Best Offer settings, including the Best Offer Auto Accept and Auto Reject price thresholds Any listing-level Buyer Requirements Charity donations from sale proceeds Listing Designer Template applied to the listing Listing enhancements like a bold listing title or Gallery Plus Listing in two categories (secondary category) Making the Call In the request payload of the bulkMigrateListings call, the seller will pass in an array of one to five eBay listing IDs (aka Item IDs). To save time and hassle, that seller should do a pre-check on each listing to make sure those listings meet the requirements to be migrated to the new Inventory model. There are no path or query parameters for this call. Call Response If an eBay listing is migrated successfully to the new Inventory model, the following will occur: An Inventory Item object will be created for the item(s) in the listing, and this object will be accessible through the Inventory API An Offer object will be created for the listing, and this object will be accessible through the Inventory API An Inventory Location object will be created and associated with the Offer object, as an Inventory Location must be associated with a published OfferThe response payload of the Bulk Migrate Listings call will show the results of each listing migration. These results include an HTTP status code to indicate the success or failure of each listing migration, the SKU value associated with each item, and if the migration is successful, an Offer ID value. The SKU value will be used in the Inventory API to manage the Inventory Item object, and the Offer ID value will be used in the Inventory API to manage the Offer object. Errors and/or warnings containers will be returned for each listing where an error and/or warning occurred with the attempted migration. If a multiple-variation listing is successfully migrated, along with the Offer and Inventory Location objects, an Inventory Item object will be created for each product variation within the listing, and an Inventory Item Group object will also be created, grouping those variations together in the Inventory API platform. For a motor vehicle part or accessory listing that has a specified list of compatible vehicles, in addition to the Inventory Item, Inventory Location, and Offer objects that are created, a Product Compatibility object will also be created in the Inventory API platform. + * Post bulk_migrate_listing + * @param {BulkMigrateListing} requestBody Details of the listings that needs to be migrated into Inventory + * @return {BulkMigrateListingResponse} Success + */ + BulkMigrateListing(requestBody: BulkMigrateListing): Observable { + return this.http.post(this.baseUri + 'bulk_migrate_listing', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_listing.txt b/Tests/SwagTsTests/NG2Results/sell_listing.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/sell_listing.txt rename to Tests/SwagTsTests/NG2Results/sell_listing.ts index 1e8d31fe..91087093 100644 --- a/Tests/SwagTsTests/NG2Results/sell_listing.txt +++ b/Tests/SwagTsTests/NG2Results/sell_listing.ts @@ -1,172 +1,172 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** The type that defines the fields for the currency and a monetary amount. */ - export interface Amount { - - /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount, in the currency specified by the currency field. */ - value?: string | null; - } - - - /** The type that defines the fields for the item aspects. */ - export interface Aspect { - - /** The name of an aspect, such and Brand. */ - name?: string | null; - - /** A list of potential values for this aspect. */ - values?: Array; - } - - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - export interface Charity { - - /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ - donationPercentage?: string | null; - - /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ - charityId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** The type that defines the fields for the listing details. */ - export interface ItemDraft { - - /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - categoryId?: string | null; - - /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ - condition?: string | null; - - /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ - format?: string | null; - - /** The type that defines the fields for the price details for an item. */ - pricingSummary?: PricingSummary; - - /** The type that defines the fields for the aspects of a product. */ - product?: Product; - - /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ - charity?: Charity; - } - - - /** The type that defines the fields for the price details for an item. */ - export interface PricingSummary { - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionReservePrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - auctionStartPrice?: Amount; - - /** The type that defines the fields for the currency and a monetary amount. */ - price?: Amount; - } - - - /** The type that defines the fields for the aspects of a product. */ - export interface Product { - - /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ - aspects?: Array; - - /** The name brand of the item, such as Nike, Apple, etc. */ - brand?: string | null; - - /** The description of the item that was created by the seller. This can be plain text or rich content. */ - description?: string | null; - - /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ - epid?: string | null; - - /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ - imageUrls?: Array; - - /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ - title?: string | null; - } - - - /** The type that defines the field for the createItemDraft response. */ - export interface ItemDraftResponse { - - /** The eBay generated ID of the listing draft. */ - itemDraftId?: string | null; - - /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ - sellFlowNativeUri?: string | null; - - /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ - sellFlowUrl?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. - * Post item_draft/ - * @return {void} - */ - CreateItemDraft(requestBody: ItemDraft): Observable> { - return this.http.post(this.baseUri + 'item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** The type that defines the fields for the currency and a monetary amount. */ + export interface Amount { + + /** The three-letter ISO 4217 code representing the currency of the amount in the value field. Restriction: Only the currency of the marketplace is supported. For example, on the US marketplace the only currency supported is USD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount, in the currency specified by the currency field. */ + value?: string | null; + } + + + /** The type that defines the fields for the item aspects. */ + export interface Aspect { + + /** The name of an aspect, such and Brand. */ + name?: string | null; + + /** A list of potential values for this aspect. */ + values?: Array; + } + + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + export interface Charity { + + /** This field sets the percentage of the purchase price that the charitable organization (identified in the charityId field) will receive for each sale that the listing generates. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. This numeric value can range from 10 to 100, and in any 5 (percent) increments in between this range (e.g. 10, 15, 20...95,... 100). The seller would pass in 10 for 10 percent, 15 for 15 percent, 20 for 20 percent, and so on, all the way to 100 for 100 percent. Note: For this field, createItemDraft will only validate that a positive integer value is supplied, so the listing draft will still be successfully created (with no error or warning message) if a non-supported value is specified. However, if the seller attempted to publish this listing draft with an unsupported value, the charity information would just be dropped from the listing. */ + donationPercentage?: string | null; + + /** The eBay-assigned unique identifier of the charitable organization that will receive a percentage of the sales proceeds. The charitable organization must be reqistered with the PayPal Giving Fund in order to receive sales proceeds through eBay listings. This field is conditionally required if a seller is planning on donating a percentage of the sale proceeds to a charitable organization. The eBay-assigned unique identifier of a charitable organization can be found using the GetCharities call of the Trading API. In the GetCharities call response, this unique identifier is shown in the id attribute of the Charity container. */ + charityId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** The type that defines the fields for the listing details. */ + export interface ItemDraft { + + /** The ID of the leaf category associated with this item. A leaf category is the lowest level in that category and has no children. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + categoryId?: string | null; + + /** An enumeration value representing the condition of the item, such as NEW. For implementation help, refer to eBay API documentation */ + condition?: string | null; + + /** The format of the listing. Valid Values: FIXED_PRICE and AUCTION For implementation help, refer to eBay API documentation */ + format?: string | null; + + /** The type that defines the fields for the price details for an item. */ + pricingSummary?: PricingSummary; + + /** The type that defines the fields for the aspects of a product. */ + product?: Product; + + /** This type is used to identify the charitable organization that will receive a percentage of sale proceeds for each sale generated by the listing. This container also includes the donation percentage, which is the percentage of the sale proceeds that the charitable organization will get. In order to receive a percentage of the sales proceeds, the non-profit organization must be registered with the PayPal Giving Fund, which is a partner of eBay for Charity. */ + charity?: Charity; + } + + + /** The type that defines the fields for the price details for an item. */ + export interface PricingSummary { + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionReservePrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + auctionStartPrice?: Amount; + + /** The type that defines the fields for the currency and a monetary amount. */ + price?: Amount; + } + + + /** The type that defines the fields for the aspects of a product. */ + export interface Product { + + /** The list of item aspects that describe the item (such as size, color, capacity, model, brand, etc.) */ + aspects?: Array; + + /** The name brand of the item, such as Nike, Apple, etc. */ + brand?: string | null; + + /** The description of the item that was created by the seller. This can be plain text or rich content. */ + description?: string | null; + + /** An EPID is the eBay product identifier of a product from the eBay product catalog. Note: If you submit both a category ID and an EPID, eBay determines the best category based on the EPID and uses that. The category ID will be ignored. */ + epid?: string | null; + + /** The image URLs of the item. The first URL will be the primary image, which appears on the View Item page in the eBay listing. The URL can be from the following: The eBay Picture Services (images previously uploaded). A server outside of eBay (self-hosted). For more details, see PictureURL and Introduction to Pictures in Listings. Maximum: 12 URLs (for most categories and marketplaces) Restrictions: You cannot mix self-hosted and EPS-hosted URLs in the same listing. All image URLs must be 'https'. */ + imageUrls?: Array; + + /** The seller-created title of the item. This should include unique characteristics of the item, such as brand, model, color, size, capacity, etc. For example: Levi's 501 size 10 black jeans */ + title?: string | null; + } + + + /** The type that defines the field for the createItemDraft response. */ + export interface ItemDraftResponse { + + /** The eBay generated ID of the listing draft. */ + itemDraftId?: string | null; + + /** The URI the Partner uses to send the seller to their listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using a mobile app. */ + sellFlowNativeUri?: string | null; + + /** The web URL the Partner uses to send the seller to the listing draft that was created on the eBay site. From there the seller can change, update, and publish the item on eBay. This is returned when the seller is using mobile web (mweb) or the desktop web. Note: You must construct the URL using the URL returned in this field and a session token. For example: sellFlowUrl?id_token=session_token */ + sellFlowUrl?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This call gives Partners the ability to create an eBay draft of a item for their seller using information from their site. This lets the Partner increase the exposure of items on their site and leverage the eBay user listing experience seamlessly. This experience provides guidance on pricing, aspects, etc. and recommendations that help create a listing that is complete and improves the exposure of the listing in search results. After the listing draft is created, the seller logs into their eBay account and uses the listing experience to finish the listing and publish the item on eBay. + * Post item_draft/ + * @return {void} + */ + CreateItemDraft(requestBody: ItemDraft): Observable> { + return this.http.post(this.baseUri + 'item_draft/', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_logistics.txt b/Tests/SwagTsTests/NG2Results/sell_logistics.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/sell_logistics.txt rename to Tests/SwagTsTests/NG2Results/sell_logistics.ts index de67a688..02bb0642 100644 --- a/Tests/SwagTsTests/NG2Results/sell_logistics.txt +++ b/Tests/SwagTsTests/NG2Results/sell_logistics.ts @@ -1,482 +1,482 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ - export interface AdditionalOption { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - additionalCost?: Amount; - - /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ - optionType?: string | null; - } - - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains contact information for an individual buyer or seller. */ - export interface Contact { - - /** The company name with which the contact is associated. */ - companyName?: string | null; - - /** This complex type specifies the details of a geographical address. */ - contactAddress?: ContactAddress; - - /** The contact's full name. */ - fullName?: string | null; - - /** This complex type contains a string field representing a telephone number. */ - primaryPhone?: PhoneNumber; - } - - - /** This complex type specifies the details of a geographical address. */ - export interface ContactAddress { - - /** The first line of the street address. */ - addressLine1?: string | null; - - /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ - addressLine2?: string | null; - - /** The city in which the address is located. */ - city?: string | null; - - /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ - countryCode?: string | null; - - /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ - county?: string | null; - - /** The postal code of the address. */ - postalCode?: string | null; - - /** The state or province in which the address is located. States and provinces often contain multiple counties. */ - stateOrProvince?: string | null; - } - - - /** This complex type contains a string field representing a telephone number. */ - export interface PhoneNumber { - - /** A telephone number. */ - phoneNumber?: string | null; - } - - - /** This complex type contains the request payload for the createFromShippingQuote method. */ - export interface CreateShipmentFromQuoteRequest { - - /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ - additionalOptions?: Array; - - /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ - labelCustomMessage?: string | null; - - /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ - labelSize?: string | null; - - /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ - rateId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ - shippingQuoteId?: string | null; - } - - - /** This complex type defines the dimensions of a package to be shipped. */ - export interface Dimensions { - - /** The numeric value of the height of the package. */ - height?: string | null; - - /** The numeric value of the length of the package. */ - length?: string | null; - - /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the width of the package. */ - width?: string | null; - } - - - /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ - export interface Order { - - /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ - channel?: string | null; - - /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ - orderId?: string | null; - } - - - /** This complex type specifies the dimensions and weight of a package. */ - export interface PackageSpecification { - - /** This complex type defines the dimensions of a package to be shipped. */ - dimensions?: Dimensions; - - /** This complex type contains information about the weight of an object such as a shipping package. */ - weight?: Weight; - } - - - /** This complex type contains information about the weight of an object such as a shipping package. */ - export interface Weight { - - /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** The numeric value of the weight of the package, as measured by the value of unit. */ - value?: string | null; - } - - - /** This complex type defines a time window for the pickup of a package. */ - export interface PickupSlot { - - /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ - pickupSlotEndTime?: string | null; - - /** Seller-defined name for the pickup slot. */ - pickupSlotId?: string | null; - - /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ - pickupSlotStartTime?: string | null; - - /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ - pickupSlotTimeZone?: string | null; - } - - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - export interface PurchasedRate { - - /** An list of additional, optional features that have been purchased for the shipment. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ - destinationTimeZone?: string | null; - - /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - maxEstimatedDeliveryDate?: string | null; - - /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ - pickupSlotId?: string | null; - - /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ - rateId?: string | null; - - /** The ID code for the carrier that was selected for the package shipment. */ - shippingCarrierCode?: string | null; - - /** The name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ - shippingQuoteId?: string | null; - - /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ - shippingServiceCode?: string | null; - - /** The name of the shipping service. */ - shippingServiceName?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - totalShippingCost?: Amount; - } - - - /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ - export interface Rate { - - /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ - additionalOptions?: Array; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - baseShippingCost?: Amount; - - /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ - destinationTimeZone?: string | null; - - /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ - maxEstimatedDeliveryDate?: string | null; - - /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - minEstimatedDeliveryDate?: string | null; - - /** A list of pickup networks compatible with the shipping service. */ - pickupNetworks?: Array; - - /** A list of available pickup slots for the package. */ - pickupSlots?: Array; - - /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ - pickupType?: string | null; - - /** The unique eBay-assigned ID for this shipping rate. */ - rateId?: string | null; - - /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ - rateRecommendation?: Array; - - /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ - shippingCarrierCode?: string | null; - - /** The common name of the shipping carrier. */ - shippingCarrierName?: string | null; - - /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ - shippingServiceCode?: string | null; - - /** The common name of the shipping service. */ - shippingServiceName?: string | null; - } - - - /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ - export interface Shipment { - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - cancellation?: ShipmentCancellation; - - /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ - creationDate?: string | null; - - /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ - labelCustomMessage?: string | null; - - /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ - labelDownloadUrl?: string | null; - - /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ - labelSize?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ - rate?: PurchasedRate; - - /** This complex type contains contact information for an individual buyer or seller. */ - returnTo?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ - shipmentId?: string | null; - - /** A unique carrier-assigned ID string that can be used to track the shipment. */ - shipmentTrackingNumber?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - - /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ - export interface ShipmentCancellation { - - /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ - cancellationRequestedDate?: string | null; - - /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ - cancellationStatus?: string | null; - } - - - /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ - export interface ShippingQuote { - - /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ - creationDate?: string | null; - - /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ - expirationDate?: string | null; - - /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ - rates?: Array; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ - shippingQuoteId?: string | null; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - - /** A list of any warnings triggered by the request. */ - warnings?: Array; - } - - - /** A container that defines the elements of error and warning message. */ - export interface Error { - - /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for an error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - - /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ - export interface ShippingQuoteRequest { - - /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ - orders?: Array; - - /** This complex type specifies the dimensions and weight of a package. */ - packageSpecification?: PackageSpecification; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipFrom?: Contact; - - /** This complex type contains contact information for an individual buyer or seller. */ - shipTo?: Contact; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. - * Post shipment/create_from_shipping_quote - * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. - * @return {void} - */ - CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Observable> { - return this.http.post(this.baseUri + 'shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. - * Get shipment/{shipmentId} - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - GetShipment(shipmentId: string): Observable { - return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}); - } - - /** - * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. - * Get shipment/{shipmentId}/download_label_file - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {void} Success - */ - DownloadLabelFile(shipmentId: string): Observable> { - return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { observe: 'response', responseType: 'text' }); - } - - /** - * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. - * Post shipment/{shipmentId}/cancel - * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. - * @return {Shipment} Success - */ - CancelShipment(shipmentId: string): Observable { - return this.http.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}); - } - - /** - * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. - * Post shipping_quote - * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. - * @return {void} - */ - CreateShippingQuote(requestBody: ShippingQuoteRequest): Observable> { - return this.http.post(this.baseUri + 'shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. - * Get shipping_quote/{shippingQuoteId} - * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. - * @return {ShippingQuote} Success - */ - GetShippingQuote(shippingQuoteId: string): Observable { - return this.http.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** This complex type contains information about a shipping option that can be purchased in addition to the base shipping cost of a recommended rate. Additional options for each rate are defined, named, and offered by the selected shipping carrier. Examples include shipping insurance or the requirement for a recipient signature. */ + export interface AdditionalOption { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + additionalCost?: Amount; + + /** The name of a shipping option that can be purchased in addition to the base shipping cost of this rate. The value supplied in this field must match exactly the option name as supplied by the selected rate. */ + optionType?: string | null; + } + + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains contact information for an individual buyer or seller. */ + export interface Contact { + + /** The company name with which the contact is associated. */ + companyName?: string | null; + + /** This complex type specifies the details of a geographical address. */ + contactAddress?: ContactAddress; + + /** The contact's full name. */ + fullName?: string | null; + + /** This complex type contains a string field representing a telephone number. */ + primaryPhone?: PhoneNumber; + } + + + /** This complex type specifies the details of a geographical address. */ + export interface ContactAddress { + + /** The first line of the street address. */ + addressLine1?: string | null; + + /** The second line of the street address. Use this field for additional address information, such as a suite or apartment number. */ + addressLine2?: string | null; + + /** The city in which the address is located. */ + city?: string | null; + + /** The country of the address, represented as two-letter ISO 3166-1 Alpha-2 country code. For example, US represents the United States and DE represents Germany. For implementation help, refer to eBay API documentation */ + countryCode?: string | null; + + /** The county (not country) in which the address is located. Counties typically contain multiple cities or towns. */ + county?: string | null; + + /** The postal code of the address. */ + postalCode?: string | null; + + /** The state or province in which the address is located. States and provinces often contain multiple counties. */ + stateOrProvince?: string | null; + } + + + /** This complex type contains a string field representing a telephone number. */ + export interface PhoneNumber { + + /** A telephone number. */ + phoneNumber?: string | null; + } + + + /** This complex type contains the request payload for the createFromShippingQuote method. */ + export interface CreateShipmentFromQuoteRequest { + + /** Supply a list of one or more shipping options that the seller has purchased for this shipment. The total cost of the added options is added to the base shipping cost to determine the final cost for the shipment. All added options must be selected from the set of options offered by the selected rate (such as shipping insurance or the requirement for a recipient signature). The base rate of the shipment is the value of the baseShippingCost field that's associated with the rateId of the selected shipping rate. */ + additionalOptions?: Array; + + /** Optional text to be printed on the shipping label if the selected shipping carrier supports custom messages on their labels. */ + labelCustomMessage?: string | null; + + /** The seller's desired label size. Any supplied value is applied only if the shipping carrier supports multiple label sizes, otherwise the carrier's default label size is used. 4"x6" */ + labelSize?: string | null; + + /** The eBay-assigned ID of the shipping rate that the seller selected for the shipment. This value is generated by a call to createShippingQuote and is returned in the rates.rateId field. */ + rateId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** The unique eBay-assigned ID of the shipping quote that was generated by a call to createShippingQuote. */ + shippingQuoteId?: string | null; + } + + + /** This complex type defines the dimensions of a package to be shipped. */ + export interface Dimensions { + + /** The numeric value of the height of the package. */ + height?: string | null; + + /** The numeric value of the length of the package. */ + length?: string | null; + + /** The unit of measure used to express the height, length, and width of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the width of the package. */ + width?: string | null; + } + + + /** This complex type defines an order from which a seller is including one or more line items in a single package to be shipped. */ + export interface Order { + + /** The e-commerce platform or environment where the order was created. Use the value EBAY to get the rates available for eBay orders. */ + channel?: string | null; + + /** The unique ID of the order supplied by the channel of origin. For eBay orders, this would be the orderId. */ + orderId?: string | null; + } + + + /** This complex type specifies the dimensions and weight of a package. */ + export interface PackageSpecification { + + /** This complex type defines the dimensions of a package to be shipped. */ + dimensions?: Dimensions; + + /** This complex type contains information about the weight of an object such as a shipping package. */ + weight?: Weight; + } + + + /** This complex type contains information about the weight of an object such as a shipping package. */ + export interface Weight { + + /** The unit of measure used to express the weight of the package. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** The numeric value of the weight of the package, as measured by the value of unit. */ + value?: string | null; + } + + + /** This complex type defines a time window for the pickup of a package. */ + export interface PickupSlot { + + /** The date and time the pickup slot ends, formatted as an ISO 8601 UTC string. */ + pickupSlotEndTime?: string | null; + + /** Seller-defined name for the pickup slot. */ + pickupSlotId?: string | null; + + /** The date and time the pickup slot begins, formatted as an ISO 8601 UTC string. */ + pickupSlotStartTime?: string | null; + + /** The time zone of the pickup location, returned as Time Zone Database ID (also know as an Olson time zone ID). */ + pickupSlotTimeZone?: string | null; + } + + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + export interface PurchasedRate { + + /** An list of additional, optional features that have been purchased for the shipment. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The time zone of the destination according to Time Zone Database. For example, "America/Los_Angeles". */ + destinationTimeZone?: string | null; + + /** A string value representing maximum (latest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + maxEstimatedDeliveryDate?: string | null; + + /** A string value representing minimum (earliest) estimated delivery time, formatted as an ISO 8601 UTC string. */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** This unique eBay-assigned ID value is returned only if the shipment has been configured for a scheduled pickup. */ + pickupSlotId?: string | null; + + /** The type of pickup or drop off configured for the shipment. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The eBay-generated ID of the shipping rate that the seller has chosen to purchase for the shipment. */ + rateId?: string | null; + + /** The ID code for the carrier that was selected for the package shipment. */ + shippingCarrierCode?: string | null; + + /** The name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The unique eBay-generated ID of the shipping quote from which the seller selected a shipping rate (rateId). */ + shippingQuoteId?: string | null; + + /** String ID code for the shipping service selected for the package shipment. This is a service that the shipping carrier supplies. */ + shippingServiceCode?: string | null; + + /** The name of the shipping service. */ + shippingServiceName?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + totalShippingCost?: Amount; + } + + + /** This complex type contains live quote information about a shipping service that's available for a given shipping quote request, including the shipping carrier and service, delivery window, shipping cost, and additional shipping options. */ + export interface Rate { + + /** Contains service and pricing information for one or more shipping options that are offered by the carrier and can be purchased in addition to the base shipping service provided by this rate. Shipping options can include items such as INSURANCE and SIGNATURE. */ + additionalOptions?: Array; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + baseShippingCost?: Amount; + + /** The name of the time zone region, as defined in the IANA Time Zone Database, to which the package is being shipped. Delivery dates are calculated relative to this time zone. Note: This is different from a Coordinated Universal Time (UTC) offset. For example, the America/Los_Angeles time zone identifies a region with the UTC standard time offset of -08:00, but so do several other time zones, including America/Tijuana,America/Dawson, and Pacific/Pitcairn. */ + destinationTimeZone?: string | null; + + /** The latest stated date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 string, which is based on the 24-hour Universal Coordinated Time (UTC) clock. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-04T07:09:00.000Z */ + maxEstimatedDeliveryDate?: string | null; + + /** The estimated earliest date and time the shipment will be delivered at this rate. The time stamp is formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + minEstimatedDeliveryDate?: string | null; + + /** A list of pickup networks compatible with the shipping service. */ + pickupNetworks?: Array; + + /** A list of available pickup slots for the package. */ + pickupSlots?: Array; + + /** The type of pickup or drop-off service associated with the pickupSlots time frames. For implementation help, refer to eBay API documentation */ + pickupType?: string | null; + + /** The unique eBay-assigned ID for this shipping rate. */ + rateId?: string | null; + + /** A list of reasons this rate is recommended. Available values are: BUYER_CHOSEN — The rate meets or exceeds the requirements of the buyer's preferred shipping option. CHEAPEST_ON_TIME — The rate is the cheapest rate available that will provide delivery within the seller's time frame commitment. EBAY_PLUS_OK — The rate complies with the shipping requirements of the eBay Plus program. FASTEST_ON_TIME — The rate has the fastest shipping time, and will provide delivery within the seller's time frame commitment. GUARANTEED_DELIVERY_OK — The rate complies with the shipping requirements of the eBay Guaranteed Delivery program. */ + rateRecommendation?: Array; + + /** The code name of the shipping carrier who will provide the service identified by shippingServiceCode. */ + shippingCarrierCode?: string | null; + + /** The common name of the shipping carrier. */ + shippingCarrierName?: string | null; + + /** The code name of the shipping service to be provided by the carrier identified by shippingCarrierCode. */ + shippingServiceCode?: string | null; + + /** The common name of the shipping service. */ + shippingServiceName?: string | null; + } + + + /** This complex type defines a shipment for a specific package (for example, a box or letter). Shipments are always linked to a purchased shipping label. */ + export interface Shipment { + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + cancellation?: ShipmentCancellation; + + /** The date and time the shipment was created, formatted as an ISO 8601 UTC string. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Example: 2018-08-06T01:00:00.000Z */ + creationDate?: string | null; + + /** If supported by the selected shipping carrier, this field can contain optional seller text to be printed on the shipping label. */ + labelCustomMessage?: string | null; + + /** The direct URL the seller can use to download an image of the shipping label. By default, the file format is PDF. See downloadLabelFile for requesting different response file formats. */ + labelDownloadUrl?: string | null; + + /** The seller's desired label size. The support for multi-sized labels is shipping-carrier specific and if the size requested in the creaateFromShippingQuote call matches a size the carrier supports, the value will be represented here in the shipment. Currently, the only valid value is: 4"x6" */ + labelSize?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** The "rate" that has been selected and purchased for the shipment, as referenced by the rateId value. */ + rate?: PurchasedRate; + + /** This complex type contains contact information for an individual buyer or seller. */ + returnTo?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for the shipment. The ID is generated when the shipment is created by a call to createFromShippingQuote. */ + shipmentId?: string | null; + + /** A unique carrier-assigned ID string that can be used to track the shipment. */ + shipmentTrackingNumber?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + + /** This type defines a shipment cancellation by the date and time the cancellation request was made and the current status of the request. */ + export interface ShipmentCancellation { + + /** The time and date the request was made to cancel the shipment, formatted as an ISO 8601 UTC string. */ + cancellationRequestedDate?: string | null; + + /** This enum specifies the current cancellation status of a shipment, if a cancellation request has been made. For implementation help, refer to eBay API documentation */ + cancellationStatus?: string | null; + } + + + /** This complex type describes a "shipping quote," which contains the parameters for a package shipment. The shipping quote contains a list of "live quotes" or rates for the shipment. Rates are offerd by a carrier for a particular service, of set of services, for shipping the package. Included in the shipping quote are the package specifications, the shipment's origin and destination addresses, and the shipping parameters specified by the seller. Use the rateId value to select the specific service you want when you create a shipment by calling createFromShippingQuote. */ + export interface ShippingQuote { + + /** The date and time this quote was created, expressed as an ISO 8601 UTC string. */ + creationDate?: string | null; + + /** The last date and time that this quote will be honored, expressed as an ISO 8601 UTC string. After this time the quote expires and the expressed rates can no longer be purchased. */ + expirationDate?: string | null; + + /** This list value is optionally assigned by the seller. When present, each element in the returned list contains seller-assigned information about an order (such as an order number). Because a package can contain all or part of one or more orders, this field provides a way for sellers to identify the packages that contain specific orders. */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** A list of rates where each rate, as identified by a rateId, contains information about a specific shipping service offered by a carrier. Rates include shipping carrier and service, the to and from locations, the pickup and delivery windows, the seller's shipping parameters, the service constraints, and the cost for the base service and a list of additional shipping options. Each rate offered is supported by a label service where you can purchase the rate, and associated shipping label, via a call to createFromShippingQuote. */ + rates?: Array; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** The unique eBay-assigned ID for this shipping quote. The value of this field is associated with a specific package, based on its origin, destination, and size. */ + shippingQuoteId?: string | null; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + + /** A list of any warnings triggered by the request. */ + warnings?: Array; + } + + + /** A container that defines the elements of error and warning message. */ + export interface Error { + + /** The category type for this error or warning. It takes a string that can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app-developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for an error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + + /** This complex type defines the request body for createShippingQuote. Sellers request a quote for a shipment by defining the "To" and "From" addresses for the package, plus the package's size. Carriers respond by offering up a "rate" for the service of theirs that best fits seller's needs. */ + export interface ShippingQuoteRequest { + + /** A seller-defined list that contains information about the orders in the package. This allows sellers to include information about the line items in the package with the shipment information. A package can contain any number of line items from one or more orders, providing they all ship in the same package. Maximum list size: 10 */ + orders?: Array; + + /** This complex type specifies the dimensions and weight of a package. */ + packageSpecification?: PackageSpecification; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipFrom?: Contact; + + /** This complex type contains contact information for an individual buyer or seller. */ + shipTo?: Contact; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method creates a "shipment" based on the shippingQuoteId and rateId values supplied in the request. The rate identified by the rateId value specifies the carrier and service for the package shipment, and the rate ID must be contained in the shipping quote identified by the shippingQuoteId value. Call createShippingQuote to retrieve a set of live shipping rates. When you create a shipment, eBay generates a shipping label that you can download and use to ship your package. In a createFromShippingQuote request, sellers can include a list of shipping options they want to add to the base service quoted in the selected rate. The list of available shipping options is specific to each quoted rate and if available, the options are listed in the rate container of the of the shipping quote. In addition to a configurable return-to location and other details about the shipment, the response to this method includes: The shipping carrier and service to be used for the package shipment A list of selected shipping options, if any The shipment tracking number The total shipping cost (the sum cost of the base shipping service and any added options) When you create a shipment, your billing agreement account is charged the sum of the baseShippingCost and the total cost of any additional shipping options you might have selected. Use the URL returned in labelDownloadUrl field, or call downloadLabelFile with the shipmentId value from the response, to download a shipping label for your package. Important! Sellers must set up their payment method with eBay before they can use this method to create a shipment and the associated shipping label. + * Post shipment/create_from_shipping_quote + * @param {CreateShipmentFromQuoteRequest} requestBody The create shipment from quote request. + * @return {void} + */ + CreateFromShippingQuote(requestBody: CreateShipmentFromQuoteRequest): Observable> { + return this.http.post(this.baseUri + 'shipment/create_from_shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the shipment details for the specified shipment ID. Call createFromShippingQuote to generate a shipment ID. + * Get shipment/{shipmentId} + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment you want to retrieve. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + GetShipment(shipmentId: string): Observable { + return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)), {}); + } + + /** + * This method returns the shipping label file that was generated for the shipmentId value specified in the request. Call createFromShippingQuote to generate a shipment ID. Use the Accept HTTP header to specify the format of the returned file. The default file format is a PDF file. + * Get shipment/{shipmentId}/download_label_file + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment associated with the shipping label you want to download. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {void} Success + */ + DownloadLabelFile(shipmentId: string): Observable> { + return this.http.get(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/download_label_file', { observe: 'response', responseType: 'text' }); + } + + /** + * This method cancels the shipment associated with the specified shipment ID and the associated shipping label is deleted. When you cancel a shipment, the totalShippingCost of the canceled shipment is refunded to the account established by the user's billing agreement. Note that you cannot cancel a shipment if you have used the associated shipping label. + * Post shipment/{shipmentId}/cancel + * @param {string} shipmentId This path parameter specifies the unique eBay-assigned ID of the shipment to be canceled. The shipmentId value is generated and returned by a call to createFromShippingQuote. + * @return {Shipment} Success + */ + CancelShipment(shipmentId: string): Observable { + return this.http.post(this.baseUri + 'shipment/' + (shipmentId == null ? '' : encodeURIComponent(shipmentId)) + '/cancel', null, {}); + } + + /** + * The createShippingQuote method returns a shipping quote that contains a list of live "rates." Each rate represents an offer made by a shipping carrier for a specific service and each offer has a live quote for the base service cost. Rates have a time window in which they are "live," and rates expire when their purchase window ends. If offered by the carrier, rates can include shipping options (and their associated prices), and users can add any offered shipping option to the base service should they desire. Also, depending on the services required, rates can also include pickup and delivery windows. Each rate is for a single package and is based on the following information: The shipping origin The shipping destination The package size (weight and dimensions) Rates are identified by a unique eBay-assigned rateId and rates are based on price points, pickup and delivery time frames, and other user requirements. Because each rate offered must be compliant with the eBay shipping program, all rates reflect eBay-negotiated prices. The various rates returned in a shipping quote offer the user a choice from which they can choose a shipping service that best fits their needs. Select the rate for your shipment and using the associated rateId, call cerateFromShippingQuote to create a shipment and generate a shipping label that you can use to ship the package. + * Post shipping_quote + * @param {ShippingQuoteRequest} requestBody The request object for createShippingQuote. + * @return {void} + */ + CreateShippingQuote(requestBody: ShippingQuoteRequest): Observable> { + return this.http.post(this.baseUri + 'shipping_quote', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the complete details of the shipping quote associated with the specified shippingQuoteId value. A "shipping quote" pertains to a single specific package and contains a set of shipping "rates" that quote the cost to ship the package by different shipping carriers and services. The quotes are based on the package's origin, destination, and size. Call createShippingQuote to create a shippingQuoteId. + * Get shipping_quote/{shippingQuoteId} + * @param {string} shippingQuoteId This path parameter specifies the unique eBay-assigned ID of the shipping quote you want to retrieve. The shippingQuoteId value is generated and returned by a call to createShippingQuote. + * @return {ShippingQuote} Success + */ + GetShippingQuote(shippingQuoteId: string): Observable { + return this.http.get(this.baseUri + 'shipping_quote/' + (shippingQuoteId == null ? '' : encodeURIComponent(shippingQuoteId)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_marketing.txt b/Tests/SwagTsTests/NG2Results/sell_marketing.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/sell_marketing.txt rename to Tests/SwagTsTests/NG2Results/sell_marketing.ts index 2ff8c0a6..c11df327 100644 --- a/Tests/SwagTsTests/NG2Results/sell_marketing.txt +++ b/Tests/SwagTsTests/NG2Results/sell_marketing.ts @@ -1,1720 +1,1720 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** This type defines the fields for an ad. */ - export interface Ad { - - /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ - adId?: string | null; - - /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type is a container for a list of ad IDs. */ - export interface AdIds { - - /** A list of ad ID's. */ - adIds?: Array; - } - - - /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface AdPagedCollection { - - /** A list of ads contained on this page from the paginated response. */ - ads?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields for an ad ID and its associated URL. */ - export interface AdReference { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** The URI of an ad. You can use this URI to retrieve the ad. */ - href?: string | null; - } - - - /** This type is a container for a list of ad IDs and their associated URIs. */ - export interface AdReferences { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines the fields returned in an ad response. */ - export interface AdResponse { - - /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ - adId?: string | null; - - /** An array of errors associated with the request. */ - errors?: Array; - - /** The URI that points to the ad. */ - href?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields returned in an error condition. */ - export interface Error { - - /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** The name of the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ - longMessage?: string | null; - - /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ - message?: string | null; - - /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ - parameters?: Array; - - /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** A name/value pair that provides parameter details regarding a warning or error condition. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** The value that was set for the element specified in the name field. */ - value?: string | null; - } - - - /** This type defines the container for an array of ads. */ - export interface Ads { - - /** A list of ad IDs and the URIs that point to them. */ - ads?: Array; - } - - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - export interface Amount { - - /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ - value?: string | null; - } - - - /** This type defines the fields for any warning error messages. */ - export interface BaseResponse { - - /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ - warnings?: Array; - } - - - /** This type defines the fields for the create ads in bulk response. */ - export interface BulkAdResponse { - - /** A list of ads processed by the call. */ - responses?: Array; - } - - - /** This type defines the fields for the create ads in bulk by listing IDs. */ - export interface BulkCreateAdRequest { - - /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ - requests?: Array; - } - - - /** This type defines the fields for the create ad request. */ - export interface CreateAdRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ - export interface BulkCreateAdsByInventoryReferenceRequest { - - /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to create ads by inventory reference ID request. */ - export interface CreateAdsByInventoryReferenceRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ - export interface BulkCreateAdsByInventoryReferenceResponse { - - /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ - responses?: Array; - } - - - /** This type defines the fields returned when you create an ad by inventory reference ID. */ - export interface CreateAdsByInventoryReferenceResponse { - - /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ - ads?: Array; - - /** An array of errors or warnings associated with the create-ads request. */ - errors?: Array; - - /** The seller's inventory reference ID that's associated with the ad. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that the call uses to remove ads in bulk. */ - export interface BulkDeleteAdRequest { - - /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - requests?: Array; - } - - - /** This type defines the fields used in a delete-ad request. */ - export interface DeleteAdRequest { - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ - export interface BulkDeleteAdResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned in a delete-ad response. */ - export interface DeleteAdResponse { - - /** The ID of the ad that was deleted. */ - adId?: string | null; - - /** An array of the errors or warnings associated with the request. */ - errors?: Array; - - /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingId?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ - export interface BulkDeleteAdsByInventoryReferenceRequest { - - /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ - requests?: Array; - } - - - /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ - export interface DeleteAdsByInventoryReferenceRequest { - - /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ - export interface BulkDeleteAdsByInventoryReferenceResponse { - - /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ - responses?: Array; - } - - - /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ - export interface DeleteAdsByInventoryReferenceResponse { - - /** The list of ad IDs that were removed from the campaign. */ - adIds?: Array; - - /** The container for the errors associated with the request. */ - errors?: Array; - - /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ - inventoryReferenceId?: string | null; - - /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - - /** - * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - statusCode?: number | null; - } - - - /** This type defines the fields that describe an ad campaign. */ - export interface Campaign { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ - campaignId?: string | null; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ - campaignStatus?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - export interface CampaignCriterion { - - /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ - criterionType?: string | null; - - /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ - selectionRules?: Array; - } - - - /** This type specifies the selection rules used to create a campaign. */ - export interface SelectionRule { - - /** A list of the brands of the items to be included in the campaign. */ - brands?: Array; - - /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ - categoryIds?: Array; - - /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ - categoryScope?: string | null; - - /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ - listingConditionIds?: Array; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - maxPrice?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minPrice?: Amount; - } - - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - export interface FundingStrategy { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - - /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ - fundingModel?: string | null; - } - - - /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface CampaignPagedCollection { - - /** A list of campaigns contained on this page from the paginated response. */ - campaigns?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type contains a list of campaigns. */ - export interface Campaigns { - - /** An array of campaigns and their details. */ - campaigns?: Array; - } - - - /** This type defines the fields needed for a clone-campaign request. */ - export interface CloneCampaignRequest { - - /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ - export interface CreateCampaignRequest { - - /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ - campaignCriterion?: CampaignCriterion; - - /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ - campaignName?: string | null; - - /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ - fundingStrategy?: FundingStrategy; - - /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ - startDate?: string | null; - } - - - /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ - export interface CreateReportTask { - - /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ - dimensions?: Array; - - /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ - inventoryReferences?: Array; - - /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ - listingIds?: Array; - - /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ - metricKeys?: Array; - - /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ - export interface Dimension { - - /** A list of annotations associated with the dimension of the report. */ - annotationKeys?: Array; - - /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ - dimensionKey?: string | null; - } - - - /** This type defines the fields contained in an inventory reference ID. */ - export interface InventoryReference { - - /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ - inventoryReferenceId?: string | null; - - /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ - inventoryReferenceType?: string | null; - } - - - /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ - export interface DimensionKeyAnnotation { - - /** An annotation key associated with the dimension. */ - annotationKey?: string | null; - - /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - } - - - /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ - export interface DimensionMetadata { - - /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the dimension used to create the report. */ - dimensionKey?: string | null; - - /** An list of annotation keys associated with the specified dimension of the report. */ - dimensionKeyAnnotations?: Array; - } - - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - export interface DiscountBenefit { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffItem?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - amountOffOrder?: Amount; - - /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ - percentageOffItem?: string | null; - - /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ - percentageOffOrder?: string | null; - } - - - /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ - export interface DiscountRule { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountSpecification?: DiscountSpecification; - - /** - * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - export interface DiscountSpecification { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - forEachAmount?: Amount; - - /** - * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - forEachQuantity?: number | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - minAmount?: Amount; - - /** - * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - minQuantity?: number | null; - - /** - * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfDiscountedItems?: number | null; - } - - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - export interface InventoryCriterion { - - /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ - inventoryCriterionType?: string | null; - - /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ - inventoryItems?: Array; - - /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ - listingIds?: Array; - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - ruleCriteria?: RuleCriteria; - } - - - /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ - export interface InventoryItem { - - /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ - inventoryReferenceId?: string | null; - } - - - /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ - export interface RuleCriteria { - - /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeInventoryItems?: Array; - - /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ - excludeListingIds?: Array; - - /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ - markupInventoryItems?: Array; - - /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ - markupListingIds?: Array; - - /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ - selectionRules?: Array; - } - - - /** This type defines the fields used to describe an item price markdown promotion. */ - export interface ItemPriceMarkdown { - - /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ - applyFreeShipping?: boolean | null; - - /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ - autoSelectFutureInventory?: boolean | null; - - /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ - blockPriceIncreaseInItemRevision?: boolean | null; - - /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ - selectedInventoryDiscounts?: Array; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ - export interface SelectedInventoryDiscount { - - /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ - discountBenefit?: DiscountBenefit; - - /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ - discountId?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** - * For markdown promotions, this field is reserved for future use. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ruleOrder?: number | null; - } - - - /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ - export interface ItemPromotion { - - /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This complex type defines the fields returned for a promotion. */ - export interface ItemPromotionResponse { - - /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ - applyDiscountToSingleItemOnly?: boolean | null; - - /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ - discountRules?: Array; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ - inventoryCriterion?: InventoryCriterion; - - /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the name and data type of a metric. */ - export interface MetricMetadata { - - /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ - dataType?: string | null; - - /** The name of the metric. */ - metricKey?: string | null; - } - - - /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ - export interface PromotionDetail { - - /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ - description?: string | null; - - /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ - name?: string | null; - - /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ - priority?: string | null; - - /** The URI of the promotion details. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ - promotionImageUrl?: string | null; - - /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ - promotionStatus?: string | null; - - /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ - startDate?: string | null; - } - - - /** This type defines the fields in a promotion-level report. */ - export interface PromotionReportDetail { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageItemRevenue?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - averageOrderRevenue?: Amount; - - /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ - averageOrderSize?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** - * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemsSoldQuantity?: number | null; - - /** - * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - numberOfOrdersSold?: number | null; - - /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ - percentageSalesLift?: string | null; - - /** The URI of the promotion report. */ - promotionHref?: string | null; - - /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ - promotionId?: string | null; - - /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ - promotionReportId?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ - promotionType?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalDiscount?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ - promotions?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ - export interface PromotionsReportPagedCollection { - - /** The URI of the current page of results. */ - href?: string | null; - - /** - * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ - prev?: string | null; - - /** A list of promotionReports contained in the paginated result set. */ - promotionReports?: Array; - - /** - * The total number of promotions in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** This type defines the fields included in the report. */ - export interface ReportMetadata { - - /** A list containing the metadata for the dimension used in the report. */ - dimensionMetadata?: Array; - - /** - * The maximum number of dimensions that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfDimensionsToRequest?: number | null; - - /** - * The maximum number of metrics that can be requested for the specified report type. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfMetricsToRequest?: number | null; - - /** A list containing the metadata for the metrics in the report. */ - metricMetadata?: Array; - - /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the metadata used by the all report types. */ - export interface ReportMetadatas { - - /** A list of the metadata for the associated report type. */ - reportMetadata?: Array; - } - - - /** This type defines the fields in a report task. */ - export interface ReportTask { - - /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ - campaignIds?: Array; - - /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateFrom?: string | null; - - /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - dateTo?: string | null; - - /** A list containing the dimension in the report. */ - dimensions?: Array; - - /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ - inventoryReferences?: Array; - - /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ - listingIds?: Array; - - /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ - marketplaceId?: string | null; - - /** A list of metrics for the report task. */ - metricKeys?: Array; - - /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportExpirationDate?: string | null; - - /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ - reportFormat?: string | null; - - /** The URL of the generated report, which can be used to download the report once it has been generated. */ - reportHref?: string | null; - - /** A unique eBay-assigned ID for the report. */ - reportId?: string | null; - - /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ - reportName?: string | null; - - /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCompletionDate?: string | null; - - /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskCreationDate?: string | null; - - /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ - reportTaskExpectedCompletionDate?: string | null; - - /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ - reportTaskId?: string | null; - - /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ - reportTaskStatus?: string | null; - - /** A status message with additional information about the report task. */ - reportTaskStatusMessage?: string | null; - - /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ - reportType?: string | null; - } - - - /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ - export interface ReportTaskPagedCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - - /** A list of report tasks contained on this page from the paginated response. */ - reportTasks?: Array; - } - - - /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ - export interface SummaryReportResponse { - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - baseSale?: Amount; - - /** The date the report was generated. */ - lastUpdated?: string | null; - - /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ - percentageSalesLift?: string | null; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - promotionSale?: Amount; - - /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ - totalSale?: Amount; - } - - - /** This type specifies the bid percentage for an ad campaign. */ - export interface UpdateBidPercentageRequest { - - /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ - bidPercentage?: string | null; - } - - - /** This type specifies the updated name, and start and end dates for an update-campaign request. */ - export interface UpdateCampaignIdentificationRequest { - - /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ - campaignName?: string | null; - - /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ - endDate?: string | null; - - /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ - startDate?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @return {BulkAdResponse} Success - */ - BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. - * @return {BulkDeleteAdsByInventoryReferenceResponse} Success - */ - BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. - * @return {BulkDeleteAdResponse} Success - */ - BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. - * @return {BulkCreateAdsByInventoryReferenceResponse} Success - */ - BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. - * @return {BulkAdResponse} Success - */ - BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {AdPagedCollection} Success - */ - GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. - * Post ad_campaign/{campaign_id}/ad - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. - * @return {void} - */ - CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. - * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. - * @return {void} - */ - CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. - * Get ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Ad} Success - */ - GetAd(ad_id: string, campaign_id: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}); - } - - /** - * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. - * Delete ad_campaign/{campaign_id}/ad/{ad_id} - * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteAd(ad_id: string, campaign_id: string): Observable> { - return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. - * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. - * @return {AdIds} Success - */ - DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Observable { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. - * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. - * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. - * @return {Ads} Success - */ - GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}); - } - - /** - * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. - * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid - * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. - * @return {void} - */ - UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). - * Post ad_campaign/{campaign_id}/clone - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. - * @return {void} - */ - CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign - * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name - * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status - * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. - * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. - * @return {CampaignPagedCollection} Success - */ - GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}); - } - - /** - * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. - * Post ad_campaign - * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. - * @return {void} - */ - CreateCampaign(requestBody: CreateCampaignRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {Campaign} Success - */ - GetCampaign(campaign_id: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}); - } - - /** - * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Delete ad_campaign/{campaign_id} - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - DeleteCampaign(campaign_id: string): Observable> { - return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/end - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - EndCampaign(campaign_id: string): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). - * Get ad_campaign/find_campaign_by_ad_reference - * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. - * @param {string} listing_id Identifier of the eBay listing associated with the ad. - * @return {Campaigns} Success - */ - FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}); - } - - /** - * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. - * Get ad_campaign/get_campaign_by_name - * @param {string} campaign_name Name of the campaign. - * @return {Campaign} Success - */ - GetCampaignByName(campaign_name: string): Observable { - return this.http.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}); - } - - /** - * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/pause - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - PauseCampaign(campaign_id: string): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. - * Post ad_campaign/{campaign_id}/resume - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @return {void} - */ - ResumeCampaign(campaign_id: string): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. - * Post ad_campaign/{campaign_id}/update_campaign_identification - * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. - * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. - * @return {void} - */ - UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Observable> { - return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. - * Get ad_report/{report_id} - * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. - * @return {void} Success - */ - GetReport(report_id: string): Observable> { - return this.http.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. - * Get ad_report_metadata - * @return {ReportMetadatas} Success - */ - GetReportMetadata(): Observable { - return this.http.get(this.baseUri + 'ad_report_metadata', {}); - } - - /** - * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. - * Get ad_report_metadata/{report_type} - * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT - * @return {ReportMetadata} Success - */ - GetReportMetadataForReportType(report_type: string): Observable { - return this.http.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}); - } - - /** - * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. - * Get ad_report_task - * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 - * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED - * @return {ReportTaskPagedCollection} Success - */ - GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}); - } - - /** - * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. - * Post ad_report_task - * @param {CreateReportTask} requestBody The container for the fields that define the report task. - * @return {void} - */ - CreateReportTask(requestBody: CreateReportTask): Observable> { - return this.http.post(this.baseUri + 'ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Get ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {ReportTask} Success - */ - GetReportTask(report_task_id: string): Observable { - return this.http.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}); - } - - /** - * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. - * Delete ad_report_task/{report_task_id} - * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. - * @return {void} - */ - DeleteReportTask(report_task_id: string): Observable> { - return this.http.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. - * Post item_price_markdown - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {void} - */ - CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Observable> { - return this.http.post(this.baseUri + 'item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPriceMarkdown} Success - */ - GetItemPriceMarkdownPromotion(promotion_id: string): Observable { - return this.http.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); - } - - /** - * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. - * Put item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. - * @return {string} Success - */ - UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Observable { - return this.http.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); - } - - /** - * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. - * Delete item_price_markdown/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPriceMarkdownPromotion(promotion_id: string): Observable> { - return this.http.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. - * Post item_promotion - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {void} - */ - CreateItemPromotion(requestBody: ItemPromotion): Observable> { - return this.http.post(this.baseUri + 'item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. - * Get item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {ItemPromotionResponse} Success - */ - GetItemPromotion(promotion_id: string): Observable { - return this.http.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); - } - - /** - * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. - * Put item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. - * @return {BaseResponse} Success - */ - UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Observable { - return this.http.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. - * Delete item_promotion/{promotion_id} - * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - DeleteItemPromotion(promotion_id: string): Observable> { - return this.http.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 - * Get promotion/{promotion_id}/get_listing_set - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. - * @param {string} q Reserved for future use. - * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html - * @return {void} - */ - GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Observable> { - return this.http.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { observe: 'response', responseType: 'text' }); - } - - /** - * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 - * Get promotion - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 - * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html - * @return {PromotionsPagedCollection} Success - */ - GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); - } - - /** - * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). - * Post promotion/{promotion_id}/pause - * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - PausePromotion(promotion_id: string): Observable> { - return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. - * Post promotion/{promotion_id}/resume - * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. - * @return {void} - */ - ResumePromotion(promotion_id: string): Observable> { - return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); - } - - /** - * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. - * Get promotion_report - * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 - * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 - * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. - * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. - * @return {PromotionsReportPagedCollection} Success - */ - GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}); - } - - /** - * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. - * Get promotion_summary_report - * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States - * @return {SummaryReportResponse} Success - */ - GetPromotionSummaryReport(marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** This type defines the fields for an ad. */ + export interface Ad { + + /** A unique eBay-assigned ID for the ad that is generated when the ad is created. */ + adId?: string | null; + + /** The user-defined bid percentage (also known as the ad rate) sets level to which eBay should raise the visibility of the associated listing in the search results returned for buyer queries. The value is also used to calculate the Promoted Listings fee. Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** A unique eBay-assigned ID that is generated when a listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type is a container for a list of ad IDs. */ + export interface AdIds { + + /** A list of ad ID's. */ + adIds?: Array; + } + + + /** This type defines the fields that paginate the ads returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface AdPagedCollection { + + /** A list of ads contained on this page from the paginated response. */ + ads?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields for an ad ID and its associated URL. */ + export interface AdReference { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** The URI of an ad. You can use this URI to retrieve the ad. */ + href?: string | null; + } + + + /** This type is a container for a list of ad IDs and their associated URIs. */ + export interface AdReferences { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines the fields returned in an ad response. */ + export interface AdResponse { + + /** A unique eBay-assigned ID for an ad. This ID is generated when an ad is created. */ + adId?: string | null; + + /** An array of errors associated with the request. */ + errors?: Array; + + /** The URI that points to the ad. */ + href?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields returned in an error condition. */ + export interface Error { + + /** The category type for this error or warning. This field can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship items to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** The name of the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of reference IDs that identify the specific request elements most closely associated to the error or warning, if any. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** A detailed description of the condition that caused the error or warning and information on what to do to correct the problem. The string is normally 100-200 characters in length, but is not required to be such. */ + longMessage?: string | null; + + /** A short description of the condition that caused the error or warning. This value is at most 50 characters long and, if applicable, is localized in the end user's requested locale. */ + message?: string | null; + + /** An array of reference IDs that identify the specific response elements most closely associated to the error or warning, if any. The path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** An array that contains contextual information about the error or warning. The list often includes the parameter or input fields that triggered the warning or error condition. */ + parameters?: Array; + + /** The name of the subdomain in which the error or warning occurred. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** A name/value pair that provides parameter details regarding a warning or error condition. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** The value that was set for the element specified in the name field. */ + value?: string | null; + } + + + /** This type defines the container for an array of ads. */ + export interface Ads { + + /** A list of ad IDs and the URIs that point to them. */ + ads?: Array; + } + + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + export interface Amount { + + /** The currency in which the amount value is expressed. The currency is represented as a 3-letter ISO4217 currency code. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The value of the amount in the specified currency. The value of currency defaults to the standard currency used by the marketplace on which the item is listed. */ + value?: string | null; + } + + + /** This type defines the fields for any warning error messages. */ + export interface BaseResponse { + + /** The container for any warning error messages generated by the request. Warnings are not fatal in that they do not prevent the call from running and returning a response, but they should be reviewed to ensure your requests are returning the responses you expect. */ + warnings?: Array; + } + + + /** This type defines the fields for the create ads in bulk response. */ + export interface BulkAdResponse { + + /** A list of ads processed by the call. */ + responses?: Array; + } + + + /** This type defines the fields for the create ads in bulk by listing IDs. */ + export interface BulkCreateAdRequest { + + /** An array of listing IDs and their associated bid percentages, which the request uses to create ads in bulk. This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 IDs per call */ + requests?: Array; + } + + + /** This type defines the fields for the create ad request. */ + export interface CreateAdRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines the fields used to create ads in bulk by inventory reference IDs. */ + export interface BulkCreateAdsByInventoryReferenceRequest { + + /** A lsit of inventory reference ID and inventory reference type pairs, and the bid percentage, which the call uses to create ads in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to create ads by inventory reference ID request. */ + export interface CreateAdsByInventoryReferenceRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** The seller's inventory reference ID for a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the response fields used by the bulkCreateAdsByInventoryReference method. */ + export interface BulkCreateAdsByInventoryReferenceResponse { + + /** A list of inventory reference IDs, and their bid percentages, that the call processed. */ + responses?: Array; + } + + + /** This type defines the fields returned when you create an ad by inventory reference ID. */ + export interface CreateAdsByInventoryReferenceResponse { + + /** A list of ad IDs (based on their inventory reference IDs) and the URIs that point to them. */ + ads?: Array; + + /** An array of errors or warnings associated with the create-ads request. */ + errors?: Array; + + /** The seller's inventory reference ID that's associated with the ad. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successful created. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that the call uses to remove ads in bulk. */ + export interface BulkDeleteAdRequest { + + /** An array of the listing IDs that identify the ads to remove. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + requests?: Array; + } + + + /** This type defines the fields used in a delete-ad request. */ + export interface DeleteAdRequest { + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByListingId deleted. */ + export interface BulkDeleteAdResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByListingId request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned in a delete-ad response. */ + export interface DeleteAdResponse { + + /** The ID of the ad that was deleted. */ + adId?: string | null; + + /** An array of the errors or warnings associated with the request. */ + errors?: Array; + + /** A unique eBay-assigned ID for a listing that is generated when the listing is created. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingId?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ad was successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the request fields that bulkDeleteAdsByInventoryReference uses to delete ads in bulk. */ + export interface BulkDeleteAdsByInventoryReferenceRequest { + + /** A list of inventory referenceID and inventory reference type pairs that specify the set of ads to remove in bulk. */ + requests?: Array; + } + + + /** This type defines the fields needed to delete an ad by its inventory reference ID. You must always supply both inventory_reference_id and inventory_reference_type. */ + export interface DeleteAdsByInventoryReferenceRequest { + + /** The seller's inventory reference ID for an ad to be deleted. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines a container that lists the ads that bulkDeleteAdsByInventoryReference deleted. */ + export interface BulkDeleteAdsByInventoryReferenceResponse { + + /** An array of the ads that were deleted by the bulkDeleteAdsByInventoryReference request, including information associated with each individual delete request. */ + responses?: Array; + } + + + /** This type defines the fields returned by request to delete a set of ads by inventory reference ID. */ + export interface DeleteAdsByInventoryReferenceResponse { + + /** The list of ad IDs that were removed from the campaign. */ + adIds?: Array; + + /** The container for the errors associated with the request. */ + errors?: Array; + + /** The seller's inventory reference ID for a listing that's associated with the ad. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is a value used by the Inventory API to indicate a listing that's the parent of a inventory item group (a multi-variation listing, such as a listing for shirt that's available in multiple sizes and colors). You must always specify both an inventory_reference_id and an inventory_reference_type. */ + inventoryReferenceId?: string | null; + + /** Indicates the item type of the listing referenced by inventoryReferenceId, and can be either INVENTORY_ITEM or INVENTORY_ITEM_GROUP. You must always pair an inventory_reference_id with and inventory_reference_type. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + + /** + * An HTTP status code that indicates the response-status of the request. Check this code to see if the ads were successfully deleted. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + statusCode?: number | null; + } + + + /** This type defines the fields that describe an ad campaign. */ + export interface Campaign { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A unique eBay-assigned ID for a campaign. This ID is generated when a campaign is created. */ + campaignId?: string | null; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** Indicates the status of the campaign, such as RUNNING, PAUSED, and ENDED. For implementation help, refer to eBay API documentation */ + campaignStatus?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + export interface CampaignCriterion { + + /** If set to true, eBay adds all inventory matching the campaign criterion to the campaign, including any new listings created from the items in your inventory. In other words, if you create a new listing, and it is is eligible for the Promoted Listings campaign (it is a multiple-quantity fixed-price listing that matches the selection rules of the campaign), it will be automatically added to the campaign.Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** This enum defines the criterion (selection rule) types. Currently, the only criterion type supported is INVENTORY_PARTITION. For implementation help, refer to eBay API documentation */ + criterionType?: string | null; + + /** Set of rules that selects the listings to include in the campaign. The following rules apply to the selection rules: Each set of selection rules are ORed with each other. Individual rules within a selection rule set are ANDed with each other. If a rule has a list of values (such a list of category IDs), the item need match only one of the values of the rule in order to be included in the campaign. Note: If an item matches multiple sets of rules or multiple rules within a selection rule set, the item is considered only once.Maximum number of rules: 10 */ + selectionRules?: Array; + } + + + /** This type specifies the selection rules used to create a campaign. */ + export interface SelectionRule { + + /** A list of the brands of the items to be included in the campaign. */ + brands?: Array; + + /** A list of category IDs associated with the listings to be included in the campaign. All the seller's items listed in the specified categories are included in the campaign, up to a maximum of 25,000 items. The IDs can be either a list of eBay category IDs (from the site where the item is hosted), or a list of category IDs defined and used by the seller's store. eBay Marketplace category IDs To get a list of marketplace category IDs, do one of the following: Get a list of category IDs for a marketplace by adding /sch/allcategories/all-categories to the marketplace URL when browsing the site. For example: http://www.ebay.com.au/sch/allcategories/all-categories Navigate to the desired category on the host site and copy the category ID from the URL. These options are also available for the US marketplace: See Category Changes for the latest list of category IDs. Retrieve a list of category IDs using the Taxonomy API. Seller store category IDs Because store category IDs are uniquely defined and maintained by each seller, this service cannot provide a list of a seller's IDs. However, sellers can retrieve their store category IDs as follows: Go to Seller Hub > Marketing. Click Manage store categories. A list of your store categories displays. Click the All categories link displayed at the bottom of the list. A complete list of your store categories and their associated store category IDs displays. */ + categoryIds?: Array; + + /** Indicates the source of the category ID; eBay or seller's store. For implementation help, refer to eBay API documentation */ + categoryScope?: string | null; + + /** The ID of the listing's condition. Valid values: 1000 = New 2000 = Manufacturer refurbished 2500 = Seller refurbished 3000 = Used/Like new/Pre owned */ + listingConditionIds?: Array; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + maxPrice?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minPrice?: Amount; + } + + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + export interface FundingStrategy { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + + /** Indicates the model that eBay uses to calculate the Promoted Listings fee. Currently, only COST_PER_SALE is supported. Default: COST_PER_SALE For implementation help, refer to eBay API documentation */ + fundingModel?: string | null; + } + + + /** This type defines the fields that paginate the campaigns returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface CampaignPagedCollection { + + /** A list of campaigns contained on this page from the paginated response. */ + campaigns?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type contains a list of campaigns. */ + export interface Campaigns { + + /** An array of campaigns and their details. */ + campaigns?: Array; + } + + + /** This type defines the fields needed for a clone-campaign request. */ + export interface CloneCampaignRequest { + + /** A seller-defined name for the newly-cloned campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The date and time the cloned campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the fields needed to create a campaign. To create a campaign, you need to specify a name, start and end dates, funding, marketplace, and optionally the criterion (selection rules). */ + export interface CreateCampaignRequest { + + /** This type defines the fields for specifying the criterion (selection rule) settings of an ad campaign. */ + campaignCriterion?: CampaignCriterion; + + /** A seller-defined name for the campaign. This value must be unique for the seller. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters */ + campaignName?: string | null; + + /** The date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines how the Promoted Listing fee is calculated when fundingModel is set to COST_PER_SALE. */ + fundingStrategy?: FundingStrategy; + + /** The ID of the eBay marketplace where the campaign is hosted. Note the X-EBAY-C-MARKETPLACE-Id header value is ignored for this purpose. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The date and time the campaign starts, in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaign to check the status of the campaign. */ + startDate?: string | null; + } + + + /** This type defines the rules that govern the generation of a report task and the criteria that's used to create the report. The report-generation rules include the starting and ending dates for the report. Report-task criteria includes the report dimensions, metrics, listings covered in the report, and so on. For information on the required and optional fields for each report type, see Reading Promoted Listings reports. */ + export interface CreateReportTask { + + /** Required if reportType is set to CAMPAIGN_PERFORMANCE_REPORT or CAMPAIGN_PERFORMANCE_SUMMARY_REPORT. A list of campaign IDs to be included in the report task. Call getCampaigns to get a list of the current campaign IDs for a seller. Note: The API currently supports only a single campaign ID per report task. Maximum: 1 */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** The list of the dimensions applied to the report. A dimension is an attribute to which the report data applies. For example, if you set dimensionKey to campaign_id in a Campaign Performance Report, the data will apply to the entire ad campaign. For information on the dimensions and how to specify them, see Reading Promoted Listings reports. */ + dimensions?: Array; + + /** Required if reportType is set to INVENTORY_PERFORMANCE_REPORT. The list of inventory reference IDs to include in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API.Maximum: 500 */ + inventoryReferences?: Array; + + /** Required if reportType is set to LISTING_PERFORMANCE_REPORT. An array of listing IDs to be included in the report. A listing ID is the eBay listing identifier that's generated when the listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). Maximum: 500 */ + listingIds?: Array; + + /** Required if reportType is set to ACCOUNT_PERFORMANCE_REPORT or INVENTORY_PERFORMANCE_REPORT. The ID for the eBay marketplace on which the report is based.Maximum: 1 For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The list of metrics to be included in the report. Metrics are the quantitative measurements compiled into the report and the data returned is based on the specified dimension of the report. For example, if the dimension is campaign, the metrics for number of sales would be the number of sales in the campaign. However, if the dimension is listing, the number of sales represents the number of items sold in that listing. For information on metric keys and how to set them, see Reading Promoted Listings reports.Minimum: 1 */ + metricKeys?: Array; + + /** The file format of the report. Currently, the only supported format is TSV_GZIP, which is a gzip file with tab separated values. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The type of report to be generated, such as ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, and so on. Maximum: 1 For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the annotation and dimension key used by the report. For information on how to set these values, see Reading Promoted Listings reports. */ + export interface Dimension { + + /** A list of annotations associated with the dimension of the report. */ + annotationKeys?: Array; + + /** The name of the dimension on which the report is based. A dimension is an attribute to which the report data applies. */ + dimensionKey?: string | null; + } + + + /** This type defines the fields contained in an inventory reference ID. */ + export interface InventoryReference { + + /** Required if if you supply an inventoryReferenceType The seller's inventory reference ID for a listing. An inventory reference is either the ID of a single listing or the ID of the parent of an item group listing (a multi-variation listing, such as a shirt that is available in multiple sizes and colors). */ + inventoryReferenceId?: string | null; + + /** Required if if you supply an inventoryReferenceId Indicates the type of the inventoryReferenceId. For implementation help, refer to eBay API documentation */ + inventoryReferenceType?: string | null; + } + + + /** This type defines the the annotation values associated with a dimension. Annotations are metadata of the dimension. For example, annotations for a listing ID could be listing_title or listing_quantity_sold. */ + export interface DimensionKeyAnnotation { + + /** An annotation key associated with the dimension. */ + annotationKey?: string | null; + + /** The data type of the annotation key value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + } + + + /** This type defines the dimension used to create the report and the annotation keys associated with that dimension. */ + export interface DimensionMetadata { + + /** The data type of the dimension value used to create the report. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the dimension used to create the report. */ + dimensionKey?: string | null; + + /** An list of annotation keys associated with the specified dimension of the report. */ + dimensionKeyAnnotations?: Array; + } + + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + export interface DiscountBenefit { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffItem?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + amountOffOrder?: Amount; + + /** The percentage applied to the sales price that is discounted off the promoted item (or items) when the promotion criteria is met. Valid integer values for percentage off:   Min: 5   Max: 80 */ + percentageOffItem?: string | null; + + /** Used for threshold promotions, this is the percentage of the order price that is discounted off the order when the promotion criteria is met. This field is not value for markdown promotions. Valid integer values for ORDER_DISCOUNT promotions:   Min: 5   Max: 80 For VOLUME_DISCOUNT promotions: Must be set to 0 for the first discount rule, then a minimum of 5 for the subsequent discount rules. */ + percentageOffOrder?: string | null; + } + + + /** This complex type defines a promotion as being either a monetary amount or a percentage of a sales price that's subtracted from the price of an item or order. Set the amount of the discount and the rules that govern when the discount triggers using the discountBenefit and discountSpecification fields. Note: In volume pricing promotions, you must configure at least two discountRule containers and at most four. */ + export interface DiscountRule { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountSpecification?: DiscountSpecification; + + /** + * Required if: you are creating a volume pricing promotion. This field indicates the order in which the discountRules are presented. The value specified for this field must equal the associated minQuantity value. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This container defines the criteria for when the discounts of a promotion trigger, such as the minimum quantity the buyer must purchase before the promotion kicks in. The promotional discount is applied each time the criteria defined by this container is met. Note: When configuring the rules that govern when the discounts are applied, populate just one of the following fields in the discountSpecification container: minAmount minQuantity forEachQuantity forEachAmount Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + export interface DiscountSpecification { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + forEachAmount?: Amount; + + /** + * The number of items that must be purchased in order to qualify for the discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + forEachQuantity?: number | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + minAmount?: Amount; + + /** + * The minimum quantity of promoted items that needs to be bought in order to qualify for the promotion's discount. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,   12, 13, 14, 15, 16, 17, 18, 19   20, 25, 50, 75, 100 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + minQuantity?: number | null; + + /** + * Use this field to configure "Buy One Get One" (or BOGO) promotions. You must couple this field with forEachQuantity and an amountOffItem or percentOffItem field to configure your BOGO promotion. This field is not valid with order-based promotions. The value of this field represents the number of items to be discounted when other promotion criteria is met. For example, when the buyer adds the number of items identified by the forEachQuantity value to their cart, they are then eligible to receive the stated discount from an additional number of like items (the number of which is identified by this field) when they add those items to their cart. To receive the discount, the buyer must purchase the number of items indicated by forEachQuantity plus the number indicated by this field. Valid values:   1, 2, 3, 4, 5, 6, 7, 8, 9, 10 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfDiscountedItems?: number | null; + } + + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + export interface InventoryCriterion { + + /** Indicates how the items to include in the promotion are selected. You can include inventory by ID, using rules, or globally include all your inventory. Valid values: INVENTORY_BY_RULE INVENTORY_BY_VALUE INVENTORY_ANY For implementation help, refer to eBay API documentation */ + inventoryCriterionType?: string | null; + + /** Required if: InventoryCriterionType is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of containers for the seller's inventory reference IDs (also known as an "SKU" or "custom label") to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items Maximum SKU or custom label length: 50 characters */ + inventoryItems?: Array; + + /** Required if: InventoryCriterionEnum is set to INVENTORY_BY_VALUE, you must specify either inventoryItems or listingIds. An array of eBay listing IDs to be added to the promotion. Note: The request can have either inventoryItems or listingIds, but not both. Required: All listings in a promotion must offer an electronic payment method. Maximum: 500 parent items */ + listingIds?: Array; + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + ruleCriteria?: RuleCriteria; + } + + + /** This type defines the fields for the seller inventory reference IDs (also known as an "SKU" or "custom label"). */ + export interface InventoryItem { + + /** The seller's inventory reference ID for a listing. Also known as the "SKU" or "custom label," an inventory reference ID is either the ID of the listing or, if the listing has variations (such as a shirt that's available in multiple sizes and colors), the ID of the parent listing. */ + inventoryReferenceId?: string | null; + } + + + /** This type defines the fields for a set of inventory selection rules. Required: When inventoryCriterionType is set to INVENTORY_BY_RULE. */ + export interface RuleCriteria { + + /** A list of seller inventory reference IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeInventoryItems?: Array; + + /** A list of eBay listing IDs to exclude from the promotion. Note: The request can have either excludeInventoryItems or excludeListingIds but not both. Maximum: 100 parent items Maximum SKU or custom label length: 50 characters */ + excludeListingIds?: Array; + + /** A list of SKUs to remove from a markdown promotion. The listed SKUs are 'marked up' to their standard price after being part of the markdown promotion. */ + markupInventoryItems?: Array; + + /** A list of listing IDs to remove from a markdown promotion. The listed items are 'marked up' to their standard price after being part of the markdown promotion. */ + markupListingIds?: Array; + + /** Required if: inventoryCriterionType is set to INVENTORY_BY_RULE. The container for the rules that select the items to include in a promotion. */ + selectionRules?: Array; + } + + + /** This type defines the fields used to describe an item price markdown promotion. */ + export interface ItemPriceMarkdown { + + /** If set to true, free shipping is applied to the first shipping service specified for the item. The first domestic shipping option is set to "free shipping," regardless if the shipping optionType for that service is set to FLAT_RATE, CALCULATED, or NOT_SPECIFIED (freight). This flag essentially adds free shipping as a promotional bonus. Default: false */ + applyFreeShipping?: boolean | null; + + /** If set to true, eBay will automatically add inventory items to the markdown promotion if they meet the selectedInventoryDiscounts criteria specified for the markdown promotion. Default: false */ + autoSelectFutureInventory?: boolean | null; + + /** If set to true, price increases (including removing the free shipping flag) are blocked and an error message is returned if a seller attempts to adjust the price of an item that's partaking in this markdown promotion. If set to false, an item is dropped from the markdown promotion if the seller adjusts the price. Default: false */ + blockPriceIncreaseInItemRevision?: boolean | null; + + /** This field is required if you are configuring an MARKDOWN_SALE promotion. This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." A tag line appears under the "offer-type text" that is generated for the promotion. The text is displayed on the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "20% off". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). The value supplied for endDate must be at least 24 hours after the value supplied for the startDate of the markdown promotion. If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. Max value: 14 days for the AT, CH, DE, ES, FR, IE, IT, and UK, marketplaces. 45 days for all other marketplaces. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the markdown promotion is hosted. Markdown promotions are supported on all eBay marketplaces. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or 'title' of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** This field is ignored in markdown promotions. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** Required for MARKDOWN_SALE promotions, populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** A list that defines the sets of selected items for the markdown promotion and the discount specified for promotion. */ + selectedInventoryDiscounts?: Array; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields that describe the discounts applied to a set of inventory items and the order in which the selection rules are applied. */ + export interface SelectedInventoryDiscount { + + /** This container defines the promotional discount as either a monetary amount or a percentage of the sales price. Important!: You must populate one and only one of the fields in this container: amountOffItem amountOffOrder percentageOffItem percentageOffOrder Tip: Refer to Configuring discounts for threshold promotions for information and examples on how to combine discountBenefit and discountSpecification values to create different types of promotions. */ + discountBenefit?: DiscountBenefit; + + /** A unique, eBay-generated ID that you can use to identify the discount. This field is ignored in POST and PUT operations. */ + discountId?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** + * For markdown promotions, this field is reserved for future use. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ruleOrder?: number | null; + } + + + /** This type defines the fields that describe a threshold promotion and includes the promotional discount, the items included in the promotion, and the rules that specify when the promotion is applied. */ + export interface ItemPromotion { + + /** This flag is only relevant in volume pricing promotions (VOLUME_DISCOUNT). If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed on the offer tile that's shown on the seller's All Offers page, and on the event page for the promotion. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. The offer-type text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** This container defines a promotion using the following two required fields: discountBenefit – Defines a discount as either a monetary amount or a percentage that is subtracted from the sales price of an item, a set of items, or an order. discountSpecification – Defines a set of rules that determine when the promotion is applied. Note: For volume pricing, you must specify at least two and not more than four discountBenefit/discountSpecification pairs. In addition, you must define each set of rules with a ruleOrder value that corresponds with the order of volume discounts you present. Tip: Refer to Specifying item promotion discounts for information and examples on how to combine discountBenefit and discountSpecification to create different types of promotions. */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** This field is optional for ORDER_DISCOUNT promotions, but is not valid for VOLUME_DISCOUNT promotions. Populate this field with a URL that points to an image to be used with the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. Note that you must set this value to SCHEDULED when you update a RUNNING promotion. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Required if: you are creating a volume pricing promotion (VOLUME_DISCOUNT). Use this field to specify the type of the promotion you are creating. The supported types are: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. See the Promotions Manager documentation for details. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This complex type defines the fields returned for a promotion. */ + export interface ItemPromotionResponse { + + /** If set to true, the discount is applied only when the buyer purchases multiple quantities of a single item in the promotion. Otherwise, the promotional discount applies to multiple quantities of any items in the promotion. Note that this flag is not relevant if the inventoryCriterion container identifies a single listing ID for the promotion. */ + applyDiscountToSingleItemOnly?: boolean | null; + + /** This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." The tag line appears under the "offer-type text" that is generated for the promotion and is displayed under the offer tile that is shown on the seller's All Offers page and on the event page for the promotion. This tag line is not used with volume pricing promotions. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** A list containing the promotion benefits (discountRule) and the rules that define when the benefit is applied (discountSpecification). */ + discountRules?: Array; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** This type defines either the selections rules or the list of listing IDs for the promotion. The "listing IDs" are are either the seller's item IDs or the eBay listing IDs. */ + inventoryCriterion?: InventoryCriterion; + + /** The eBay marketplace ID of the site where the threshold promotion is hosted. Threshold promotions are currently supported on a limited number of eBay marketplaces. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which eBay uses to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, this value must be set to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the name and data type of a metric. */ + export interface MetricMetadata { + + /** The data type of the returned metric value. For implementation help, refer to eBay API documentation */ + dataType?: string | null; + + /** The name of the metric. */ + metricKey?: string | null; + } + + + /** This type defines the fields that describe a promotion. This includes all the information about a promotion except for the listings that are a part of the promotion. */ + export interface PromotionDetail { + + /** Required if you are configuring ORDER_DISCOUNT or MARKDOWN_SALE promotions (and not valid for VOLUME_DISCOUNT promotions). This is the seller-defined "tag line" for the offer, such as "Save on designer shoes." Tag lines appear under the "offer-type text" that is generated for a promotion and displayed under the offer tile that is shown on the seller's All Offers page and on the promotion's event page. Note: Offer-type text is a teaser that's presented throughout the buyer's journey through the sales flow and is generated by eBay. This text is not editable by the seller—it's derived from the settings in the discountRules and discountSpecification fields—and can be, for example, "Extra 20% off when you buy 3+". Maximum length: 50 */ + description?: string | null; + + /** The date and time the promotion ends in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (null), it indicates the promotion has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The eBay marketplace ID of the site where the promotion is hosted. Threshold promotions are supported on a select set of marketplaces while markdown promotions are supported on all eBay marketplaces. Valid values for threshold promotions are as follows: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** The seller-defined name or "title" of the promotion, such as "Buy 1 Get 1", that the seller can use to identify a promotion. This label is not displayed in end-user flows. Maximum length: 90 */ + name?: string | null; + + /** Applicable for only ORDER_DISCOUNT promotions, this field indicates the precedence of the promotion, which is used to determine the position of a promotion on the seller's All Offers page. If an item is associated with multiple promotions, the promotion with the higher priority takes precedence. For implementation help, refer to eBay API documentation */ + priority?: string | null; + + /** The URI of the promotion details. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** Not applicable for VOLUME_DISCOUNT promotions, this field is a URL that points to an image for the promotion. This image is displayed on the seller's All Offers page. The URL must point to either JPEG or PNG image and it must be a minimum of 500x500 pixels in dimension and cannot exceed 12Mb in size. */ + promotionImageUrl?: string | null; + + /** The current status of the promotion. When creating a new promotion, you must set this value to either DRAFT or SCHEDULED. For implementation help, refer to eBay API documentation */ + promotionStatus?: string | null; + + /** Indicates type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** The date and time the promotion starts in UTC format (yyyy-MM-ddThh:mm:ssZ). For display purposes, convert this time into the local time of the seller. */ + startDate?: string | null; + } + + + /** This type defines the fields in a promotion-level report. */ + export interface PromotionReportDetail { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageItemRevenue?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + averageOrderRevenue?: Amount; + + /** The average order size is the average number of items that each order contained in a promotion. This value is calculated as follows: itemsSoldQuantity / numberOfOrdersSold = averageOrderSize */ + averageOrderSize?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** + * This is the quantity of items purchased in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your number of items sold (itemsSoldQuantity) would be 2 and you number of orders sold (numberOfOrdersSold) would be 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemsSoldQuantity?: number | null; + + /** + * This is the number of orders sold in a threshold promotion where the threshold has been met and the discount was applied. For example, suppose you're running a "Buy 1, get 1 at 50%" promotion on $5 socks. One buyer purchases two pairs of socks, so they pay $7.50 for both pairs (rather than the full price of $10). Your numberOfOrdersSold would be 1 and your itemsSoldQuantity would be 2. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + numberOfOrdersSold?: number | null; + + /** The percentage sales lift is the total dollar amount gained due to promotions. This value is calculated as follows: promotionSale / totalSale = percentageSalesLift */ + percentageSalesLift?: string | null; + + /** The URI of the promotion report. */ + promotionHref?: string | null; + + /** A unique eBay-assigned ID for the promotion that's generated when the promotion is created. */ + promotionId?: string | null; + + /** The unique eBay-assigned ID of the promotion report that is generated when the report is created. */ + promotionReportId?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** Indicates the type of the promotion, either MARKDOWN_SALE, ORDER_DISCOUNT, or VOLUME_DISCOUNT. For implementation help, refer to eBay API documentation */ + promotionType?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalDiscount?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type defines the fields in a paginated result set of seller promotions. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of promotions returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of promotions to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list containing the details of each returned promotion. This includes all the information about the promotions except for the listings that are part of the promotions. */ + promotions?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields in a paginated result set of promotion-level reports. The response consists of 0 or more sequenced pages that are returned from the complete result set, where each page consists of 0 or more items. */ + export interface PromotionsReportPagedCollection { + + /** The URI of the current page of results. */ + href?: string | null; + + /** + * The value of the limit parameter submitted in the request, which is the maximum number of reports returned on a page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned if there is another page of results to return from the result set. */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of reports to skip before returning the first result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous set of results. This is returned if there is a previous page of results in the result set. */ + prev?: string | null; + + /** A list of promotionReports contained in the paginated result set. */ + promotionReports?: Array; + + /** + * The total number of promotions in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** This type defines the fields included in the report. */ + export interface ReportMetadata { + + /** A list containing the metadata for the dimension used in the report. */ + dimensionMetadata?: Array; + + /** + * The maximum number of dimensions that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfDimensionsToRequest?: number | null; + + /** + * The maximum number of metrics that can be requested for the specified report type. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfMetricsToRequest?: number | null; + + /** A list containing the metadata for the metrics in the report. */ + metricMetadata?: Array; + + /** The report_type, as specified in the request to create the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the metadata used by the all report types. */ + export interface ReportMetadatas { + + /** A list of the metadata for the associated report type. */ + reportMetadata?: Array; + } + + + /** This type defines the fields in a report task. */ + export interface ReportTask { + + /** A list of campaign IDs to be included in the report. A campaign ID is a unique eBay-assigned identifier of the campaign that's generated when the campaign is created. Call getCampaigns to return the current campaign IDs for a seller. Note: Currently, you can specify only one campaign ID. */ + campaignIds?: Array; + + /** The date and time defining the start of the timespan covered by the report. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateFrom?: string | null; + + /** The date and time defining the end of the report timespan. For display purposes, convert this time into the local time of the seller. Valid format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + dateTo?: string | null; + + /** A list containing the dimension in the report. */ + dimensions?: Array; + + /** A list of the seller's inventory reference IDs to be included in the report. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. */ + inventoryReferences?: Array; + + /** A list of the listing IDs to be included in the report. A listing ID is an eBay-assigned ID that's generated when a listing is created. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). */ + listingIds?: Array; + + /** The ID of the eBay marketplace used by the report task. For implementation help, refer to eBay API documentation */ + marketplaceId?: string | null; + + /** A list of metrics for the report task. */ + metricKeys?: Array; + + /** The date after which the report is no longer be available. Reports are available for 30 days and you cannot download a report after it has expired. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportExpirationDate?: string | null; + + /** Indicates the format of the report. Currently, only TSV_GZIP is supported. For implementation help, refer to eBay API documentation */ + reportFormat?: string | null; + + /** The URL of the generated report, which can be used to download the report once it has been generated. */ + reportHref?: string | null; + + /** A unique eBay-assigned ID for the report. */ + reportId?: string | null; + + /** An eBay-assigned name for the report that's created by the createReportTask call. This name is unique for the seller. */ + reportName?: string | null; + + /** The date the report task completed the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCompletionDate?: string | null; + + /** The date the report task was created. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskCreationDate?: string | null; + + /** The date the report task is expected to complete the report generation. For display purposes, convert this time into the local time of the seller. Format (UTC): yyyy-MM-ddThh:mm:ss.sssZ */ + reportTaskExpectedCompletionDate?: string | null; + + /** The unique eBay-assigned ID of the report task. This value is generated when the report task is created with a call to createReportTask. */ + reportTaskId?: string | null; + + /** Indicates the current state of the report task. For implementation help, refer to eBay API documentation */ + reportTaskStatus?: string | null; + + /** A status message with additional information about the report task. */ + reportTaskStatusMessage?: string | null; + + /** Indicates type of report associated with the report task. For implementation help, refer to eBay API documentation */ + reportType?: string | null; + } + + + /** This type defines the fields that paginate the reports tasks returned by the request. The entire result set consists of 0 or more sequenced response pages, where each page consists of 0 or more items from the complete result set. */ + export interface ReportTaskPagedCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The value of the offset submitted in the request, which is the number of results to skip before listing the first returned result. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + + /** A list of report tasks contained on this page from the paginated response. */ + reportTasks?: Array; + } + + + /** This type defines the fields in an Promotions Manager Summary report. Reports are formatted in JSON. For more details, see Reading item promotion Summary reports. */ + export interface SummaryReportResponse { + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + baseSale?: Amount; + + /** The date the report was generated. */ + lastUpdated?: string | null; + + /** The percentage of the total dollar amount gained due to promotions. This value is calculated as follows: precentageSalesLift = promotionSale / (baseSale + promotionSale) */ + percentageSalesLift?: string | null; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + promotionSale?: Amount; + + /** This type defines a monetary value as represented by a currency. The currency is normally set to the currency used on the associated eBay marketplace. */ + totalSale?: Amount; + } + + + /** This type specifies the bid percentage for an ad campaign. */ + export interface UpdateBidPercentageRequest { + + /** The user-defined bid percentage (also known as the ad rate) sets the level that eBay increases the visibility in search results for the associated listing. The higher the bidPercentage value, the more eBay promotes the listing. The value specified here is also used to calculate the Promoted Listings fee. This percentage value is multiplied by the final sales price to determine the fee. The Promoted Listings fee is determined at the time the transaction completes and the seller is assessed the fee only when an item sells through a Promoted Listings ad campaign. bidPercentage is a single precision value that is guided by the following rules: These values are valid:    1,    1.0,    4.1,    5.0,    5.5, ... These values are not valid:    0.01,    10.75,    99.99,    and so on. If a bid percentage is not provided for an ad, eBay uses the default bid percentage of the associated campaign.Minimum value: 1.0 Maximum value: 100.0 */ + bidPercentage?: string | null; + } + + + /** This type specifies the updated name, and start and end dates for an update-campaign request. */ + export interface UpdateCampaignIdentificationRequest { + + /** The new seller-defined name for the campaign. This value must be unique for the seller. If you don't want to change the name of the campaign, specify the current campaign name in this field. You can use any alphanumeric characters in the name, except the less than (<) or greater than (>) characters.Max length: 80 characters. */ + campaignName?: string | null; + + /** The new date and time the campaign ends, in UTC format (yyyy-MM-ddThh:mm:ssZ). If this field is blank (code>null), it indicates a campaign that has no end date. For display purposes, convert this time into the local time of the seller. */ + endDate?: string | null; + + /** The new start date for the campaign, in UTC format (yyyy-MM-ddThh:mm:ssZ). If the campaign is currently RUNNING or PAUSED, enter the current date in this field because you cannot submit past or future date for these campaigns. On the date specified, the service derives the keywords for each listing in the campaign, creates an ad for each listing, and associates each new ad with the campaign. The campaign starts after this process is completed. The amount of time it takes the service to start the campaign depends on the number of listings in the campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. */ + startDate?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method creates an ad for each inventory reference ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter in your call to this method. In the payload, specify the bidPercentage, inventoryReferenceId, and inventoryReferenceType for each listing you want to include in the campaign. Each listing you specify becomes a new ad that is associated with the campaign. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey. An inventoryItemGroupKey is seller-defined ID for an inventory item group (a multiple-variation listing), and is created and used by the Inventory API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the bulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkCreateAdsByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method creates an ad for each listing ID specified in the request and associates the newly created ads with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a list of elements, each containing a listingId and its associated bidPercentage, for each listing you want associated with the ad campaign. Each listing you specify becomes a new ad that is associated with the campaign. A listing ID can be either a listing ID created by the Inventory API or an item ID that is used by the Trading API. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/bulk_create_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody The container for the bulk request to create ads for eBay listing IDs. eBay listing IDs are generated when the listing is created on eBay. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @return {BulkAdResponse} Success + */ + BulkCreateAdsByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_create_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a set of ads, as specified by a list of inventory reference IDs, from the specified campaign. Pass the campaign_id as a URI parameter and create a request payload that contains a list of inventoryReferenceId and inventoryReferenceType pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for a bulkDeleteAdsByInventoryReference request. + * @return {BulkDeleteAdsByInventoryReferenceResponse} Success + */ + BulkDeleteAdsByInventoryReference(campaign_id: string, requestBody: BulkDeleteAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes a set of ads, as specified by a list of listing IDs, from the specified campaign. Supply the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_delete_ads_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkDeleteAdRequest} requestBody This type defines the fields for the bulkDeleteAdsByListingId request. + * @return {BulkDeleteAdResponse} Success + */ + BulkDeleteAdsByListingId(campaign_id: string, requestBody: BulkDeleteAdRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_delete_ads_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method replaces an ad bid based on a list of inventory references IDs associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and a list of the bidPercentage, inventoryReferenceId, inventoryReferenceType fields. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's inventory reference IDs. + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the BulkCreateAdsByInventoryReference request. + * @return {BulkCreateAdsByInventoryReferenceResponse} Success + */ + BulkUpdateAdsBidByInventoryReference(campaign_id: string, requestBody: BulkCreateAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method replaces an ad bid based on a supplied list of listing IDs that are associated with the specified campaign. In the request, specify the campaign_id as a URI parameter and create a request payload that contains a list of listingId values. An eBay listing ID is generated when a listing is created on eBay. Get the campaign IDs for a seller by calling getCampaigns and call getAds to get a list of the seller's listing IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Post ad_campaign/{campaign_id}/bulk_update_ads_bid_by_listing_id + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {BulkCreateAdRequest} requestBody Container for the bulk request to update ads. + * @return {BulkAdResponse} Success + */ + BulkUpdateAdsBidByListingId(campaign_id: string, requestBody: BulkCreateAdRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/bulk_update_ads_bid_by_listing_id', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves all the ads for the specified campaign. Use the listing_ids query parameter to control the ads to target, and paginate the result set by specifying a limit, which dictates how many ads to return on each page of the response. Specify how many ads to skip in the result set before returning the first result using the offset parameter. Call getCampaigns to retrieve the current campaign IDs for the seller. Note: This field accepts both a listingId, as generated by the Inventory API, and an itemId as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} limit Specifies the maximum number of ads to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} listing_ids A comma separated list of eBay listing IDs. The response includes only active ads (ads associated with a RUNNING campaign). The results do not include listing IDs that are excluded by other conditions. Note: This field accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {AdPagedCollection} Success + */ + GetAds(campaign_id: string, limit: string | null | undefined, listing_ids: string, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&listing_ids=' + (listing_ids == null ? '' : encodeURIComponent(listing_ids)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method creates an ad for the specified listing ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and specify a listingId and its associated bidPercentage in the payload. After processing the request, eBay returns the ID of the newly-created ad in the Location response header. Call getCampaigns to get a list of the seller's campaign IDs. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. Maximums: You can specify a maximum of 500 IDs per call and 25,000 listings per campaign. + * Post ad_campaign/{campaign_id}/ad + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdRequest} requestBody This type defines the fields for the createAd request. + * @return {void} + */ + CreateAdByListingId(campaign_id: string, requestBody: CreateAdRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method creates an ad for the specified inventory reference ID, sets the bid percentage for that specific item, and associates the ad with the specified campaign. Use the campaign ID returned from createCampaign as a URI parameter and in the payload specify an inventoryReferenceId, its inventoryReferenceType, and the bidPercentage for the specific item. Call getCampaigns to get a list of the seller's campaign IDs. For information on the eBay marketplaces that support Promoted Listings campaigns, see Promoted Listings requirements and restrictions. + * Post ad_campaign/{campaign_id}/create_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CreateAdsByInventoryReferenceRequest} requestBody This type defines the fields for the createAdsByInventoryReference request. + * @return {void} + */ + CreateAdsByInventoryReference(campaign_id: string, requestBody: CreateAdsByInventoryReferenceRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/create_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the specified ad from the specified campaign. In the request, supply the campaign_id and ad_id as URI parameters. Call getCampaigns to retrieve a list of the seller's current campaign IDs and call getAds to retrieve their current ad IDs. + * Get ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Ad} Success + */ + GetAd(ad_id: string, campaign_id: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), {}); + } + + /** + * This method removes the specified ad from the specified campaign. This method requires that you pass in the ID of the ad to delete and the ID of the campaign to which the ad is associated. Call getCampaigns to get the current list of the seller's campaign IDs. + * Delete ad_campaign/{campaign_id}/ad/{ad_id} + * @param {string} ad_id Identifier of an ad. This ID was generated when the ad was created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteAd(ad_id: string, campaign_id: string): Observable> { + return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method deletes ads using a list of seller inventory reference IDs that are associated with the specified campaign ID. Specify the campaign ID and a list of inventoryReferenceId and inventoryReferenceType pairs to be deleted. Call getCampaigns to get a list of the seller's current campaign IDs. + * Post ad_campaign/{campaign_id}/delete_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {DeleteAdsByInventoryReferenceRequest} requestBody This type defines the fields for the deleteAdsByInventoryReference request. + * @return {AdIds} Success + */ + DeleteAdsByInventoryReference(campaign_id: string, requestBody: DeleteAdsByInventoryReferenceRequest): Observable { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/delete_ads_by_inventory_reference', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method retrieves ads from the specified campaign using the seller's inventory reference ID and inventory reference type. Supply the campaign_id as a URI parameter and configure the payload with inventory_reference_id inventory_reference_type pairs. An inventory reference ID is either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used in the Inventory API to create a multiple-variation listing). You must always specify both an inventory_reference_id and the associated inventory_reference_type. Call getCampaigns to retrieve all of the seller's the current campaign IDs. + * Get ad_campaign/{campaign_id}/get_ads_by_inventory_reference + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {string} inventory_reference_id The inventory reference ID associated with the ad you want returned. A seller's inventory reference ID is the ID of either a listing or the ID of an inventory item group (the parent of a multi-variation listing, such as a shirt that is available in multiple sizes and colors). You must always supply in both an inventory_reference_id and an inventory_reference_type. + * @param {string} inventory_reference_type The type of the inventory reference ID. Set this value to either INVENTORY_ITEM (a single listing) or INVENTORY_ITEM_GROUP (a multi-variation listing). You must always pass in both an inventory_reference_id and an inventory_reference_type. + * @return {Ads} Success + */ + GetAdsByInventoryReference(campaign_id: string, inventory_reference_id: string, inventory_reference_type: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/get_ads_by_inventory_reference&inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)), {}); + } + + /** + * This method updates the bid for the specified ad in the specified campaign. In the request, supply the campaign_id and ad_id as a URI parameters. Call getCampaigns to retrieve a seller's current campaign IDs and call getAds to get their ad IDs. + * Post ad_campaign/{campaign_id}/ad/{ad_id}/update_bid + * @param {string} ad_id A unique eBay-assigned ID for an ad that's generated when an ad is created. + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateBidPercentageRequest} requestBody This type defines the fields for the updateBid request. + * @return {void} + */ + UpdateBid(ad_id: string, campaign_id: string, requestBody: UpdateBidPercentageRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/ad/' + (ad_id == null ? '' : encodeURIComponent(ad_id)) + '/update_bid', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method clones (makes a copy of) the specified campaign. Supply the campaign_id as a URI parameter. The ID of the newly-cloned campaign is returned in the Location response header. Call getCampaigns to retrieve a seller's current campaign IDs Requirement: In order to clone a campaign, the campaignStatus must be ENDED and the campaign must define a set of selection rules (it must be a rules-based campaign). + * Post ad_campaign/{campaign_id}/clone + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {CloneCampaignRequest} requestBody This type defines the fields for a clone campaign request. + * @return {void} + */ + CloneCampaign(campaign_id: string, requestBody: CloneCampaignRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/clone', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the details for all the campaigns of a seller, including the campaign's the selection rules. Note that this method does not return the listing IDs or inventory reference IDs of the items included in the ad campaign. Call getAds to retrieve these IDs. You can filter the result set by a campaign name, end date range, start date range, or campaign status. You can also paginate the records returned from the result set using the limit query parameter, and control which records to return using the offset parameter. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign + * @param {string} campaign_name Specifies the campaign name. The results are filtered to include only the campaign by the specified name. Note: The results might be null if other filters exclude the campaign with this name. Maximum: 1 campaign name + * @param {string} campaign_status Specifies the campaign status. The results are filtered to include only campaigns that are in the specified states. Note: The results might not include all the campaigns with this status if other filters exclude them. Valid values: See CampaignStatusEnum Maximum: 1 status + * @param {string} end_date_range Specifies the range of a campaign's end date. The results are filtered to include only campaigns with an end date that is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (campaign ends within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign ends on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign ends on or before this date)     2016-09-08T00:00:00Z..2016-09-09T00:00:00Z   (campaign ends on September 8, 2016) Note: The results might not include all the campaigns ending on this date if other filters exclude them. + * @param {string} limit Specifies the maximum number of campaigns to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of campaigns to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} start_date_range Specifies the range of a campaign's start date in which to filter the results. The results are filtered to include only campaigns with a start date that is equal to this date or is within specified range. Valid format (UTC):     yyyy-MM-ddThh:mm:ssZ..yyyy-MM-ddThh:mm:ssZ   (starts within this range)     yyyy-MM-ddThh:mm:ssZ..  (campaign starts on or after this date)     ..yyyy-MM-ddThh:mm:ssZ   (campaign starts on or before this date)     2016-09-08T00:00.00.000Z..2016-09-09T00:00:00Z   (campaign starts on September 8, 2016) Note: The results might not include all the campaigns with this start date if other filters exclude them. + * @return {CampaignPagedCollection} Success + */ + GetCampaigns(campaign_name: string | null | undefined, campaign_status: string | null | undefined, end_date_range: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, start_date_range: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_campaign?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)) + '&campaign_status=' + (campaign_status == null ? '' : encodeURIComponent(campaign_status)) + '&end_date_range=' + (end_date_range == null ? '' : encodeURIComponent(end_date_range)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&start_date_range=' + (start_date_range == null ? '' : encodeURIComponent(start_date_range)), {}); + } + + /** + * This method creates a Promoted Listings ad campaign. To create a basic campaign, supply the user-defined campaign name, the start date (and optionally the end date) of the campaign, the eBay marketplace on which the campaign is hosted, and details on the campaign funding model. The campaign funding model specifies how the Promoted Listings fee is calculated. Currently, the only supported funding model is COST_PER_SALE. For complete information on how the fee is calculated and when it applies, see Promoted Listings fees. For details on creating Promoted Listings campaigns and how to select the items to be included in your campaigns, see Creating Promoted Listings campaigns. For recommendations on which listings are prime for a Promoted Listings ad campaign, and to get guidance on how to set the bidPercentage field, see Using the Recommendation API to help configure campaigns. + * Post ad_campaign + * @param {CreateCampaignRequest} requestBody This type defines the fields for the create campaign request. + * @return {void} + */ + CreateCampaign(requestBody: CreateCampaignRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_id query parameter. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign IDs. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {Campaign} Success + */ + GetCampaign(campaign_id: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), {}); + } + + /** + * This method deletes the campaign specified by the campaign_id query parameter. Note: You can delete only campaigns that have ended. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Delete ad_campaign/{campaign_id} + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + DeleteCampaign(campaign_id: string): Observable> { + return this.http.delete(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method ends an active (RUNNINGM) or paused campaign. Specify the campaign you want to end by supplying its campaign ID in a query parameter. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/end + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + EndCampaign(campaign_id: string): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/end', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method retrieves the campaign containing the listing that is specified using either an eBay listing ID or an inventory reference ID and inventory reference type. eBay listing IDs are generated when you create a listing. An inventory reference ID can be either a seller-defined SKU value or an inventoryItemGroupKey (a seller-defined ID for an inventory item group, which is an entity that's used by the Inventory API to create a multiple-variation listing such as a shirt that is available in multiple sizes and colors. Note: This request accepts both listing IDs, as generated by the Inventory API, and an item IDs, as used in the eBay Traditional API set (e.g., the Trading and Finding APIs). + * Get ad_campaign/find_campaign_by_ad_reference + * @param {string} inventory_reference_id The seller's inventory reference ID of the listing to be used to find the campaign in which it is associated. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} inventory_reference_type The type of the seller's inventory reference ID, which is a listing or group of items. You must always pass in both inventory_reference_id and inventory_reference_type. + * @param {string} listing_id Identifier of the eBay listing associated with the ad. + * @return {Campaigns} Success + */ + FindCampaignByAdReference(inventory_reference_id: string | null | undefined, inventory_reference_type: string | null | undefined, listing_id: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_campaign/find_campaign_by_ad_reference?inventory_reference_id=' + (inventory_reference_id == null ? '' : encodeURIComponent(inventory_reference_id)) + '&inventory_reference_type=' + (inventory_reference_type == null ? '' : encodeURIComponent(inventory_reference_type)) + '&listing_id=' + (listing_id == null ? '' : encodeURIComponent(listing_id)), {}); + } + + /** + * This method retrieves the details of a single campaign, as specified with the campaign_name query parameter. Note that the campaign name you specify must be an exact, case-sensitive match of the name of the campaign you want to retrieve. This method returns all the details of a campaign (including the campaign's the selection rules), except the for the listing IDs or inventory reference IDs included in the campaign. These IDs are returned by getAds. Call getCampaigns to retrieve a list of the seller's campaign names. Note: This call does not retrieve campaigns created via the eBay web flow. + * Get ad_campaign/get_campaign_by_name + * @param {string} campaign_name Name of the campaign. + * @return {Campaign} Success + */ + GetCampaignByName(campaign_name: string): Observable { + return this.http.get(this.baseUri + 'ad_campaign/get_campaign_by_name?campaign_name=' + (campaign_name == null ? '' : encodeURIComponent(campaign_name)), {}); + } + + /** + * This method pauses an active (RUNNING) campaign. You can restarted by calling resumeCampaign, as long as the campaign's end date is in the future. Note: The listings associated with a paused campaign cannot be added into another campaign. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/pause + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + PauseCampaign(campaign_id: string): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method resumes a paused campaign, as long as it's end date is in the future. Supply the campaign_id for the campaign you want to restart as a query parameter in the request. Call getCampaigns to retrieve the campaign_id and the campaign status (RUNNING, PAUSED, ENDED, and so on) for all the seller's campaigns. + * Post ad_campaign/{campaign_id}/resume + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @return {void} + */ + ResumeCampaign(campaign_id: string): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method replaces the name and the start and end dates of a campaign. Specify the campaign_id you want to update as a URI parameter, and configure the campaignName and startDate in the request payload. If you want to change only the end date of the campaign, specify the current campaign name and set startDate to the current date (you cannot use a start date that is in the past), and set the endDate as desired. Note that if you do not set a new end date in this call, any current endDate value will be set to null. To preserve the currently-set end date, you must specify the value again in your request. Call getCampaigns to retrieve a seller's campaign details, including the campaign ID, campaign name, and the start and end dates of the campaign. + * Post ad_campaign/{campaign_id}/update_campaign_identification + * @param {string} campaign_id A unique eBay-assigned ID for an ad campaign that's generated when a campaign is created. Get a seller's campaign IDs by calling getCampaigns. + * @param {UpdateCampaignIdentificationRequest} requestBody This type defines the fields to updated the campaign name and start and end dates. + * @return {void} + */ + UpdateCampaignIdentification(campaign_id: string, requestBody: UpdateCampaignIdentificationRequest): Observable> { + return this.http.post(this.baseUri + 'ad_campaign/' + (campaign_id == null ? '' : encodeURIComponent(campaign_id)) + '/update_campaign_identification', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call downloads the report as specified by the report_id path parameter. Note: All date values are returned in UTC format (yyyy-MM-ddThh:mm:ss.sssZ), which you can convert and display in the seller's local time. + * Get ad_report/{report_id} + * @param {string} report_id The unique ID of the Promoted Listings report you want to get. This ID is generated by eBay when you run a report task with a call to createReportTask. Get all the seller's report IDs by calling getReportTasks. + * @return {void} Success + */ + GetReport(report_id: string): Observable> { + return this.http.get(this.baseUri + 'ad_report/' + (report_id == null ? '' : encodeURIComponent(report_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This call retrieves information that details the fields used in each of the Promoted Listings reports. The request for this method does not use a payload or any URI parameters. Use the information returned by this method to configure the different Promoted Listings report types. + * Get ad_report_metadata + * @return {ReportMetadatas} Success + */ + GetReportMetadata(): Observable { + return this.http.get(this.baseUri + 'ad_report_metadata', {}); + } + + /** + * This call retrieves metadata that details the fields used by the Promoted Listings report type that's specified by the report_type path parameter. This method does not use a request payload. Use the information returned by this method to configure the specified Promoted Listings report. + * Get ad_report_metadata/{report_type} + * @param {string} report_type The name of the report type whose metadata you want to get. For details about each report type, see ReportTypeEnum. Valid values:    ACCOUNT_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_REPORT    CAMPAIGN_PERFORMANCE_SUMMARY_REPORT    LISTING_PERFORMANCE_REPORT    INVENTORY_PERFORMANCE_REPORT + * @return {ReportMetadata} Success + */ + GetReportMetadataForReportType(report_type: string): Observable { + return this.http.get(this.baseUri + 'ad_report_metadata/' + (report_type == null ? '' : encodeURIComponent(report_type)), {}); + } + + /** + * This method returns information on all the existing report tasks related to a seller. Use the report_task_statuses query parameter to control which reports to return. You can paginate the result set by specifying a limit, which dictates how many report tasks to return on each page of the response. Use the offset parameter to specify how many reports to skip in the result set before returning the first result. + * Get ad_report_task + * @param {string} limit Specifies the maximum number of report tasks to return on a page in the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of report tasks to skip in the result set before returning the first report in the paginated response. Combine offset with the limit query parameter to control the reports returned in the response. For example, if you supply an offset of 0 and a limit of 10, the response contains the first 10 reports from the complete list of report tasks retrieved by the call. If offset is 10 and limit is 10, the first page of the response contains reports 11-20 from the complete result set. Default: 0 + * @param {string} report_task_statuses This parameter filters the returned report tasks by their status. Supply a comma-separated list of the report statuses you want returned. The results are filtered to include only the report statuses you specify. Note: The results might not include some report tasks if other search conditions exclude them. Valid values:    PENDING    SUCCESS    FAILED + * @return {ReportTaskPagedCollection} Success + */ + GetReportTasks(limit: string | null | undefined, offset: string | null | undefined, report_task_statuses: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ad_report_task?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&report_task_statuses=' + (report_task_statuses == null ? '' : encodeURIComponent(report_task_statuses)), {}); + } + + /** + * This method creates a report task, which generates a Promoted Listings report based on the values specified in the call. The report is generated based on the criteria you specify, including the report type, the report's dimensions and metrics, the report's start and end dates, the listings to include in the report, and more. Metrics are the quantitative measurements in the report while dimensions specify the attributes of the data included in the reports. For details on the required and optional fields for each report type, see Creating Promoted Listings reports. This call returns the URL to the report task in the Location response header, and the URL includes the report-task ID. Reports often take time to generate and it's common for this call to return an HTTP status of 202, which indicates the report is being generated. Call getReportTasks (or getReportTask with the report-task ID) to determine the status of a Promoted Listings report. When a report is complete, eBay sets its status to SUCCESS and you can download it using the URL returned in the reportHref field of the getReportTask call. Report files are tab-separated value gzip files with a file extension of .tsv.gz. Note: This call fails if you don't submit all the required fields for the specified report type. Fields not supported by the specified report type are ignored. Call getReportMetadata to retrieve a list of the fields you need to configure for each Promoted Listings report type. + * Post ad_report_task + * @param {CreateReportTask} requestBody The container for the fields that define the report task. + * @return {void} + */ + CreateReportTask(requestBody: CreateReportTask): Observable> { + return this.http.post(this.baseUri + 'ad_report_task', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This call returns the details of a specific Promoted Listings report task, as specified by the report_task_id path parameter. The report task includes the report criteria (such as the report dimensions, metrics, and included listing) and the report-generation rules (such as starting and ending dates for the specified report task). Report-task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Get ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {ReportTask} Success + */ + GetReportTask(report_task_id: string): Observable { + return this.http.get(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), {}); + } + + /** + * This call deletes the report task specified by the report_task_id path parameter. This method also deletes any reports generated by the report task. Report task IDs are generated by eBay when you call createReportTask. Get a complete list of a seller's report-task IDs by calling getReportTasks. + * Delete ad_report_task/{report_task_id} + * @param {string} report_task_id A unique eBay-assigned ID for the report task that's generated when the report task is created by a call to createReportTask. + * @return {void} + */ + DeleteReportTask(report_task_id: string): Observable> { + return this.http.delete(this.baseUri + 'ad_report_task/' + (report_task_id == null ? '' : encodeURIComponent(report_task_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method creates an item price markdown promotion (know simply as a "markdown promotion") where a discount amount is applied directly to the items included the promotion. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Unlike an item promotion, a markdown promotion does not require the buyer meet a "threshold" before the offer takes effect. With markdown promotions, all the buyer needs to do is purchase the item to receive the promotion benefit. Important: You can create item price markdown promotions only for specific listings. For complete details, see Promotions Manager requirements and restrictions. In addition, we recommend you list items at competitive prices before including them in your markdown promotions. For an extensive list of pricing recommendations, see the Growth tab in Seller Hub. There are two ways to add items to markdown promotions: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. New promotions must be created in either a DRAFT or a SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests (such as to schedule a promotion that's in a DRAFT state). Tip: Refer to Promotions Manager in the Selling Integration Guide for details and examples showing how to create and manage seller promotions. Markdown promotions are available on all eBay marketplaces. For more information, see Promotions Manager requirements and restrictions. + * Post item_price_markdown + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {void} + */ + CreateItemPriceMarkdownPromotion(requestBody: ItemPriceMarkdown): Observable> { + return this.http.post(this.baseUri + 'item_price_markdown', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method returns the complete details of the item price markdown promotion that's indicated by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPriceMarkdown} Success + */ + GetItemPriceMarkdownPromotion(promotion_id: string): Observable { + return this.http.get(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); + } + + /** + * This method updates the specified item price markdown promotion with the new configuration that you supply in the payload of the request. Specify the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request fails. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. + * Put item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPriceMarkdown} requestBody This type defines the fields that describe an item price markdown promotion. + * @return {string} Success + */ + UpdateItemPriceMarkdownPromotion(promotion_id: string, requestBody: ItemPriceMarkdown): Observable { + return this.http.put(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, responseType: 'text' }); + } + + /** + * This method deletes the item price markdown promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running promotion, call updateItemPriceMarkdownPromotion and adjust the endDate field as appropriate. + * Delete item_price_markdown/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPriceMarkdownPromotion(promotion_id: string): Observable> { + return this.http.delete(this.baseUri + 'item_price_markdown/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method creates an item promotion (known casually as a "threshold promotion") where the buyer receives a discount when they meet the buying criteria that's set for the promotion. eBay highlights promoted items by placing teasers for the items throughout the online sales flows. Discounts can be specified as either a monetary amount or a percentage off the standard sales price. This gives you the ability offer discounts such as "Buy 1 Get 1", or "Buy $50, get 20% off". You can also create volume pricing promotions, where the discount amount increases as the buyer increases the quantity they purchase. There are two ways to add items to a threshold promotion: Key-based promotions select items using either the listing IDs or inventory reference IDs of the items you want to promote. Note that if you use inventory reference IDs, you must specify both the inventoryReferenceId and the associated inventoryReferenceType of the item(s) you want to include the promotion. Rule-based promotions select items using a list of eBay category IDs or seller Store category IDs. Rules can further constrain items in a promotion by minimum and maximum prices, brands, and item conditions. You must create a new promotion either a DRAFT or SCHEDULED state. Use the DRAFT state when you are initially creating a promotion and you want to be sure it's correctly configured before scheduling it to run. When you create a promotion, the promotion ID is returned in the Location response header. Use this ID to reference the promotion in subsequent requests. Tip: Refer to the Selling Integration Guide for details and examples showing how to create and manage threshold promotions using the Promotions Manager. For information on the eBay marketplaces that support item promotions, see Promotions Manager requirements and restrictions. + * Post item_promotion + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {void} + */ + CreateItemPromotion(requestBody: ItemPromotion): Observable> { + return this.http.post(this.baseUri + 'item_promotion', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * This method returns the complete details of the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. + * Get item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {ItemPromotionResponse} Success + */ + GetItemPromotion(promotion_id: string): Observable { + return this.http.get(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), {}); + } + + /** + * This method updates the specified threshold promotion with the new configuration that you supply in the request. Indicate the promotion you want to update using the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. When updating a promotion, supply all the fields that you used to configure the original promotion (and not just the fields you are updating). eBay replaces the specified promotion with the values you supply in the update request and if you don't pass a field that currently has a value, the update request will fail. The parameters you are allowed to update with this request depend on the status of the promotion you're updating: DRAFT or SCHEDULED promotions: You can update any of the parameters in these promotions that have not yet started to run, including the discountRules. RUNNING or PAUSED promotions: You can change the endDate and the item's inventory but you cannot change the promotional discount or the promotion's start date. ENDED promotions: Nothing can be changed. Tip: When updating a RUNNING or PAUSED promotion, set the status field to SCHEDULED for the update request. When the promotion is updated, the previous status (either RUNNING or PAUSED) will be reset. + * Put item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to update. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {ItemPromotion} requestBody This type defines the fields that describe an item promotion. + * @return {BaseResponse} Success + */ + UpdateItemPromotion(promotion_id: string, requestBody: ItemPromotion): Observable { + return this.http.put(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * This method deletes the threshold promotion specified by the promotion_id path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. You can delete any promotion with the exception of those that are currently active (RUNNING). To end a running threshold promotion, call updateItemPromotion and adjust the endDate field as appropriate. + * Delete item_promotion/{promotion_id} + * @param {string} promotion_id The ID of the promotion you want to delete. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + DeleteItemPromotion(promotion_id: string): Observable> { + return this.http.delete(this.baseUri + 'item_promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method returns the set of listings associated with the promotion_id specified in the path parameter. Call getPromotions to retrieve the IDs of a seller's promotions. The listing details are returned in a paginated set and you can control and results returned using the following query parameters: limit, offset, q, sort, and status. Maximum associated listings returned: 200 Default number of listings returned: 200 + * Get promotion/{promotion_id}/get_listing_set + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_id The ID of the promotion whose associated listings you want to retrieve. The promotion ID is a unique eBay-assigned value that's generated when the promotion is created. + * @param {string} q Reserved for future use. + * @param {string} sort Specifies the order in which to sort the associated listings in the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=PRICE - Sorts the associated listings by their current price in ascending order    sort=-TITLE - Sorts the associated listings by their title in descending alphabetical order (Z-Az-a) Valid values: AVAILABLE PRICE TITLE For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @param {string} status This query parameter applies only to markdown promotions. It filters the response based on the indicated status of the promotion. Currently, the only supported value for this parameter is MARKED_DOWN, which indicates active markdown promotions. For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/ItemMarkdownStatusEnum.html + * @return {void} + */ + GetListingSet(limit: string | null | undefined, offset: string | null | undefined, promotion_id: string, q: string | null | undefined, sort: string | null | undefined, status: string | null | undefined): Observable> { + return this.http.get(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/get_listing_set?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)) + '&status=' + (status == null ? '' : encodeURIComponent(status)), { observe: 'response', responseType: 'text' }); + } + + /** + * This method returns a list of a seller's undeleted promotions. The call returns up to 200 currently-available promotions on the specified marketplace. While the response body does not include the promotion's discountRules or inventoryCriterion containers, it does include the promotionHref (which you can use to retrieve the complete details of the promotion). Use query parameters to sort and filter the results by the number of promotions to return, the promotion state or type, and the eBay marketplace. You can also supply keywords to limit the response to the promotions that contain that keywords in the title of the promotion. Maximum returned: 200 + * Get promotion + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site where the promotion is hosted. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Specifies the promotion state by which you want to filter the results. The response contains only those promotions that match the state you specify. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of input values: 1 + * @param {string} promotion_type Filters the returned promotions based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @param {string} sort Specifies the order for how to sort the response. If you precede the supplied value with a dash, the response is sorted in reverse order. Example:    sort=END_DATE   Sorts the promotions in the response by their end dates in ascending order    sort=-PROMOTION_NAME   Sorts the promotions by their promotion name in descending alphabetical order (Z-Az-a) Valid values: START_DATE END_DATE PROMOTION_NAME For implementation help, refer to eBay API documentation at https://developer.ebay.com/devzone/rest/api-ref/marketing/types/SortField.html + * @return {PromotionsPagedCollection} Success + */ + GetPromotions(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined, sort: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'promotion?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)) + '&sort=' + (sort == null ? '' : encodeURIComponent(sort)), {}); + } + + /** + * This method pauses a currently-active (RUNNING) threshold promotion and changes the state of the promotion from RUNNING to PAUSED. Pausing a promotion makes the promotion temporarily unavailable to buyers and any currently-incomplete transactions will not receive the promotional offer until the promotion is resumed. Also, promotion teasers are not displayed when a promotion is paused. Pass the ID of the promotion you want to pause using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. Note: You can only pause threshold promotions (you cannot pause markdown promotions). + * Post promotion/{promotion_id}/pause + * @param {string} promotion_id Identifier of the promotion you want to pause. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + PausePromotion(promotion_id: string): Observable> { + return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/pause', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method restarts a threshold promotion that was previously paused and changes the state of the promotion from PAUSED to RUNNING. Only promotions that have been previously paused can be resumed. Resuming a promotion reinstates the promotional teasers and any transactions that were in motion before the promotion was paused will again be eligible for the promotion. Pass the ID of the promotion you want to resume using the promotion_id path parameter. Call getPromotions to retrieve the IDs of the seller's promotions. + * Post promotion/{promotion_id}/resume + * @param {string} promotion_id Identifier of the promotion you want to make active. The ID is a unique eBay-assigned value that's generated when the promotion is created. + * @return {void} + */ + ResumePromotion(promotion_id: string): Observable> { + return this.http.post(this.baseUri + 'promotion/' + (promotion_id == null ? '' : encodeURIComponent(promotion_id)) + '/resume', null, { observe: 'response', responseType: 'text' }); + } + + /** + * This method generates a report that lists the seller's running, paused, and ended promotions for the specified eBay marketplace. The result set can be filtered by the promotion status and the number of results to return. You can also supply keywords to limit the report to promotions that contain the specified keywords. Specify the eBay marketplace for which you want the report run using the marketplace_id query parameter. Supply additional query parameters to control the report as needed. + * Get promotion_report + * @param {string} limit Specifies the maximum number of promotions returned on a page from the result set. Default: 200 Maximum: 200 + * @param {string} marketplace_id The eBay marketplace ID of the site for which you want the promotions report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @param {string} offset Specifies the number of promotions to skip in the result set before returning the first promotion in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @param {string} promotion_status Limits the results to the promotions that are in the state specified by this query parameter. Valid values: DRAFT SCHEDULED RUNNING PAUSED ENDEDMaximum number of values supported: 1 + * @param {string} promotion_type Filters the returned promotions in the report based on the their campaign promotion type. Specify one of the following values to indicate the promotion type you want returned in the report: MARKDOWN_SALE – A markdown promotion set with createItemPriceMarkdownPromotion. ORDER_DISCOUNT – A threshold promotion set with createItemPromotion. VOLUME_DISCOUNT – A volume pricing promotion set with createItemPromotion. + * @param {string} q A string consisting of one or more keywords. eBay filters the response by returning only the promotions that contain the supplied keywords in the promotion title. Example: "iPhone" or "Harry Potter." Commas that separate keywords are ignored. For example, a keyword string of "iPhone, iPad" equals "iPhone iPad", and each results in a response that contains promotions with both "iPhone" and "iPad" in the title. + * @return {PromotionsReportPagedCollection} Success + */ + GetPromotionReports(limit: string | null | undefined, marketplace_id: string, offset: string | null | undefined, promotion_status: string | null | undefined, promotion_type: string | null | undefined, q: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'promotion_report?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)) + '&promotion_status=' + (promotion_status == null ? '' : encodeURIComponent(promotion_status)) + '&promotion_type=' + (promotion_type == null ? '' : encodeURIComponent(promotion_type)) + '&q=' + (q == null ? '' : encodeURIComponent(q)), {}); + } + + /** + * This method generates a report that summarizes the seller's promotions for the specified eBay marketplace. The report returns information on RUNNING, PAUSED, and ENDED promotions (deleted reports are not returned) and summarizes the seller's campaign performance for all promotions on a given site. For information about summary reports, see Reading the item promotion Summary report. + * Get promotion_summary_report + * @param {string} marketplace_id The eBay marketplace ID of the site you for which you want a promotion summary report. Valid values: EBAY_AU = Australia EBAY_DE = Germany EBAY_ES = Spain EBAY_FR = France EBAY_GB = Great Britain EBAY_IT = Italy EBAY_US = United States + * @return {SummaryReportResponse} Success + */ + GetPromotionSummaryReport(marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'promotion_summary_report?marketplace_id=' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_metadata.txt b/Tests/SwagTsTests/NG2Results/sell_metadata.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/sell_metadata.txt rename to Tests/SwagTsTests/NG2Results/sell_metadata.ts index 8904bc99..7bd8369e 100644 --- a/Tests/SwagTsTests/NG2Results/sell_metadata.txt +++ b/Tests/SwagTsTests/NG2Results/sell_metadata.ts @@ -1,361 +1,361 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** A unique ID for a sales tax jurisdiction. */ - export interface SalesTaxJurisdiction { - - /** The unique ID for a sales tax jurisdiction. */ - salesTaxJurisdictionId?: string | null; - } - - - /** This complex type contains a list of sales tax jurisdictions. */ - export interface SalesTaxJurisdictions { - - /** A list of sales tax jurisdictions. */ - salesTaxJurisdictions?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An amount of time, as measured by the time-measurement units specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A container that defines the elements of error and warning messages. */ - export interface Error { - - /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ - category?: string | null; - - /** Name of the domain containing the service or application. */ - domain?: string | null; - - /** - * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ - inputRefIds?: Array; - - /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ - longMessage?: string | null; - - /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ - message?: string | null; - - /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ - outputRefIds?: Array; - - /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ - parameters?: Array; - - /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ - subdomain?: string | null; - } - - - /** Container for a error parameter. */ - export interface ErrorParameter { - - /** Name of the entity that threw the error. */ - name?: string | null; - - /** A description of the error. */ - value?: string | null; - } - - export interface AutomotivePartsCompatibilityPolicy { - - /** The category ID to which the automotive-parts-compatibility policies apply. */ - categoryId?: string | null; - - /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ - compatibilityBasedOn?: string | null; - - /** Indicates the compatibility classification of the part based on high-level vehicle types. */ - compatibleVehicleTypes?: Array; - - /** - * Specifies the maximum number of compatible vehicle-applications allowed per item. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - maxNumberOfCompatibleVehicles?: number | null; - } - - export interface AutomotivePartsCompatibilityPolicyResponse { - - /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ - automotivePartsCompatibilityPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - export interface Exclusion { - - /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ - brands?: Array; - } - - export interface ItemCondition { - - /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ - conditionDescription?: string | null; - - /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ - conditionId?: string | null; - } - - export interface ItemConditionPolicy { - - /** The category ID to which the item-condition policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ - itemConditionRequired?: boolean | null; - - /** The item-condition values allowed in the category. */ - itemConditions?: Array; - } - - export interface ItemConditionPolicyResponse { - - /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ - itemConditionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ListingStructurePolicy { - - /** The category ID to which the listing-structure policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ - variationsSupported?: boolean | null; - } - - export interface ListingStructurePolicyResponse { - - /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ - listingStructurePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface NegotiatedPricePolicy { - - /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ - bestOfferAutoAcceptEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ - bestOfferAutoDeclineEnabled?: boolean | null; - - /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ - bestOfferCounterEnabled?: boolean | null; - - /** The category ID to which the negotiated-price policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - } - - export interface NegotiatedPricePolicyResponse { - - /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ - negotiatedPricePolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - - /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ - export interface ProductAdoptionPolicy { - - /** The category ID to which the listing policies apply. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ - exclusion?: Exclusion; - - /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ - productRequired?: boolean | null; - } - - - /** This is the response object returned by a call to getProductAdoptionPolicies. */ - export interface ProductAdoptionPolicyResponse { - - /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ - productAdoptionPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - export interface ReturnPolicy { - - /** The category ID to which the return policy applies. */ - categoryId?: string | null; - - /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ - categoryTreeId?: string | null; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - domestic?: ReturnPolicyDetails; - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - international?: ReturnPolicyDetails; - - /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ - required?: boolean | null; - } - - - /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ - export interface ReturnPolicyDetails { - - /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ - policyDescriptionEnabled?: boolean | null; - - /** A list of refund methods allowed for the associated category. */ - refundMethods?: Array; - - /** A list of return methods allowed for the associated category. */ - returnMethods?: Array; - - /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ - returnPeriods?: Array; - - /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ - returnsAcceptanceEnabled?: boolean | null; - - /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ - returnShippingCostPayers?: Array; - } - - export interface ReturnPolicyResponse { - - /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ - returnPolicies?: Array; - - /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ - warnings?: Array; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. - * Get country/{countryCode}/sales_tax_jurisdiction - * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. - * @return {SalesTaxJurisdictions} Success - */ - GetSalesTaxJurisdictions(countryCode: string): Observable { - return this.http.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}); - } - - /** - * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT - * @return {AutomotivePartsCompatibilityPolicyResponse} Success - */ - GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_item_condition_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ItemConditionPolicyResponse} Success - */ - GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_listing_structure_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ListingStructurePolicyResponse} Success - */ - GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_negotiated_price_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {NegotiatedPricePolicyResponse} Success - */ - GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_product_adoption_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ProductAdoptionPolicyResponse} Success - */ - GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - - /** - * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip - * Get marketplace/{marketplace_id}/get_return_policies - * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D - * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. - * @return {ReturnPolicyResponse} Success - */ - GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Observable { - return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** A unique ID for a sales tax jurisdiction. */ + export interface SalesTaxJurisdiction { + + /** The unique ID for a sales tax jurisdiction. */ + salesTaxJurisdictionId?: string | null; + } + + + /** This complex type contains a list of sales tax jurisdictions. */ + export interface SalesTaxJurisdictions { + + /** A list of sales tax jurisdictions. */ + salesTaxJurisdictions?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit used to specify a period of time. Time-measurement units can be years, months, days, hours, minutes, and other time units (see TimeDurationUnitEnum for a complete list of possible units). The value setting is applied to the unit value to define a span of time. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An amount of time, as measured by the time-measurement units specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A container that defines the elements of error and warning messages. */ + export interface Error { + + /** The category type for this error or warning. It takes an ErrorCategory object which can have one of three values: Application: Indicates an exception or error occurred in the application code or at runtime. Examples include catching an exception in a service's business logic, system failures, or request errors from a dependency. Business: Used when your service or a dependent service refused to continue processing on the resource because of a business rule violation such as "Seller does not ship item to Antarctica" or "Buyer ineligible to purchase an alcoholic item". Business errors are not syntactical input errors. Request: Used when there is anything wrong with the request, such as authentication, syntactical errors, rate limiting or missing headers, bad HTTP header values, and so on. */ + category?: string | null; + + /** Name of the domain containing the service or application. */ + domain?: string | null; + + /** + * A positive integer that uniquely identifies the specific error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** Identifies specific request elements associated with the error, if any. inputRefId's response is format specific. For JSON, use JSONPath notation. */ + inputRefIds?: Array; + + /** An expanded version of message that should be around 100-200 characters long, but is not required to be such. */ + longMessage?: string | null; + + /** An end user and app developer friendly device agnostic message. It explains what the error or warning is, and how to fix it (in a general sense). Its value is at most 50 characters long. If applicable, the value is localized in the end user's requested locale. */ + message?: string | null; + + /** Identifies specific response elements associated with the error, if any. Path format is the same as inputRefId. */ + outputRefIds?: Array; + + /** This optional complex field type contains a list of one or more context-specific ErrorParameter objects, with each item in the list entry being a parameter (or input field name) that caused an error condition. Each ErrorParameter object consists of two fields, a name and a value. */ + parameters?: Array; + + /** Name of the domain's subsystem or subdivision. For example, checkout is a subdomain in the buying domain. */ + subdomain?: string | null; + } + + + /** Container for a error parameter. */ + export interface ErrorParameter { + + /** Name of the entity that threw the error. */ + name?: string | null; + + /** A description of the error. */ + value?: string | null; + } + + export interface AutomotivePartsCompatibilityPolicy { + + /** The category ID to which the automotive-parts-compatibility policies apply. */ + categoryId?: string | null; + + /** This is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** Indicates whether the category supports parts compatibility by either ASSEMBLY or by SPECIFICATION. For implementation help, refer to eBay API documentation */ + compatibilityBasedOn?: string | null; + + /** Indicates the compatibility classification of the part based on high-level vehicle types. */ + compatibleVehicleTypes?: Array; + + /** + * Specifies the maximum number of compatible vehicle-applications allowed per item. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + maxNumberOfCompatibleVehicles?: number | null; + } + + export interface AutomotivePartsCompatibilityPolicyResponse { + + /** A list of category IDs and the automotive-parts-compatibility policies for each of the listed categories. */ + automotivePartsCompatibilityPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + export interface Exclusion { + + /** A list of brands that are excluded from requiring a link to the eBay Catalog for the associated categoryId. If productRequired is set to true, items that are of a brand returned in this field are excluded from the need to specify a value for the ePID field in their item description in order to be listed in the associated category. */ + brands?: Array; + } + + export interface ItemCondition { + + /** The human-readable label for the condition (e.g., "New"). This value is typically localized for each site. Note that the display name can vary by category. For example, the description for condition ID 1000 could be called "New: with Tags" in one category and "Brand New" in another. For details on condition IDs and descriptions, see Item condition ID and name values. */ + conditionDescription?: string | null; + + /** The ID value of the selected item condition. For information on the supported condition ID values, see Item condition ID and name values. */ + conditionId?: string | null; + } + + export interface ItemConditionPolicy { + + /** The category ID to which the item-condition policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not you must list the item condition in a listing for the specified category. If set to true, you must specify an item condition for the associated category. */ + itemConditionRequired?: boolean | null; + + /** The item-condition values allowed in the category. */ + itemConditions?: Array; + } + + export interface ItemConditionPolicyResponse { + + /** A list of category IDs and the policies for how to indicate an item's condition in each of the listed categories. */ + itemConditionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ListingStructurePolicy { + + /** The category ID to which the listing-structure policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This flag denotes whether or not the associated category supports listings with item variations. If set to true, the category does support item variations. */ + variationsSupported?: boolean | null; + } + + export interface ListingStructurePolicyResponse { + + /** A list of category IDs and a flag indicating whether or not each listed category supports item variations. */ + listingStructurePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface NegotiatedPricePolicy { + + /** This flag denotes whether or not the category supports the setting of a price at which best offers are automatically accepted. If set to true, the category does support the setting of an automatic price for best-offers. */ + bestOfferAutoAcceptEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting of an auto-decline price for best offers. If set to true, the category does support the setting of an automatic-decline price for best-offers. */ + bestOfferAutoDeclineEnabled?: boolean | null; + + /** This flag denotes whether or not the category supports the setting for an automatic counter-offer on best offers. If set to true, the category does support the setting of an automatic counter-offer price for best-offers. */ + bestOfferCounterEnabled?: boolean | null; + + /** The category ID to which the negotiated-price policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + } + + export interface NegotiatedPricePolicyResponse { + + /** A list of category IDs and the policies related to negotiated-price items for each of the listed categories. */ + negotiatedPricePolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + + /** This complex type returns a category ID and a flag that indicates whether or not items listed in that category require the declaration of an ePID value, which links the item to the eBay Catalog. The type also lists any items that are excepted from the requirement to included an ePID value. */ + export interface ProductAdoptionPolicy { + + /** The category ID to which the listing policies apply. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This type returns a list of properties (and their associated values) that are excluded from requiring an ePID value (from the eBay Catalog) for items that are listed in the associated category. */ + exclusion?: Exclusion; + + /** If set to true, items must include an ePID value in their item description before they can be listed in the category identified by the associated categoryId. In contrast, a value of false indicates that items listed in the associated category do not require ePID values. Important! It is possible for a productAdoptionPolicies container to not contain this productRequired field. This occurs if the eBay category is not part of the PBSE Phase 1 or Phase 2 mandate. In these scenarios, please treat the response the same as if this field were present and contained a value of false. */ + productRequired?: boolean | null; + } + + + /** This is the response object returned by a call to getProductAdoptionPolicies. */ + export interface ProductAdoptionPolicyResponse { + + /** A list of category IDs from the marketplace specified in the request where each returned element represents a leaf node in the category tree. Each element in the list contains the policies governing whether or not items listed in that category must include an ePID value (which links the item to the eBay Catalog). */ + productAdoptionPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + export interface ReturnPolicy { + + /** The category ID to which the return policy applies. */ + categoryId?: string | null; + + /** The value returned in this field is a unique eBay-assigned value that represents the root node of the category tree to which the associated categoryId belongs. This value reflects the category tree related to the marketplace_id passed in the request. A category tree is a hierarchical framework of eBay categories that begins at the root node of the tree and extends to include all the child nodes in the tree. Each child node in the tree is an eBay category and each is represented by a unique categoryId value. Within a category tree, the root node has no parent node and leaf nodes are nodes that have no child nodes. */ + categoryTreeId?: string | null; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + domestic?: ReturnPolicyDetails; + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + international?: ReturnPolicyDetails; + + /** If set to true, this flag indicates that you must specify a return policy for items listed in the associated category. Note that not accepting returns (setting returnsAcceptedEnabled to false) is a valid return policy. */ + required?: boolean | null; + } + + + /** This container defines the category policies that relate to domestic and international return policies (the return shipping is made via a domestic or an international shipping service, respectively). */ + export interface ReturnPolicyDetails { + + /** If set to true, this flag indicates you can supply a detailed return policy description within your return policy (for example, by populating the returnInstructions field in the Account API's createReturnPolicy). User-supplied return policy details are allowed only in the DE, ES, FR, and IT marketplaces. */ + policyDescriptionEnabled?: boolean | null; + + /** A list of refund methods allowed for the associated category. */ + refundMethods?: Array; + + /** A list of return methods allowed for the associated category. */ + returnMethods?: Array; + + /** A list of return periods allowed for the associated category. Note that different APIs require you to enter the return period in different ways. For example, the Account API uses the complex TimeDuration type, which takes two values (a unit and a value), whereas the Trading API takes a single value (such as Days_30). */ + returnPeriods?: Array; + + /** If set to true, this flag indicates the seller can configure how they handle domestic returns. */ + returnsAcceptanceEnabled?: boolean | null; + + /** A list of allowed values for who pays for the return shipping cost. Note that for SNAD returns, the seller is always responsible for the return shipping cost. */ + returnShippingCostPayers?: Array; + } + + export interface ReturnPolicyResponse { + + /** A list of category IDs and a flag indicating whether or not the listings in each category requires a return policy. */ + returnPolicies?: Array; + + /** A list of the warnings that were generated as a result of the request. This field is not returned if no warnings were generated by the request. */ + warnings?: Array; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method retrieves all the sales tax jurisdictions for the country that you specify in the countryCode path parameter. Countries with valid sales tax jurisdictions are Canada, India, and the US. The response from this call tells you the jurisdictions for which a seller can configure tax tables. Although setting up tax tables is optional, you can use the createOrReplaceSalesTax in the Account API call to configure the tax tables for the jurisdictions you sell to. + * Get country/{countryCode}/sales_tax_jurisdiction + * @param {string} countryCode This path parameter specifies the two-letter ISO 3166-1 Alpha-2 country code for the country whose jurisdictions you want to retrieve. eBay provides sales tax jurisdiction information for Canada, India, and the United States.Valid values for this path parameter are CA, IN, and US. + * @return {SalesTaxJurisdictions} Success + */ + GetSalesTaxJurisdictions(countryCode: string): Observable { + return this.http.get(this.baseUri + 'country/' + (countryCode == null ? '' : encodeURIComponent(countryCode)) + '/sales_tax_jurisdiction', {}); + } + + /** + * This method returns the eBay policies that define how to list automotive-parts-compatibility items in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_automotive_parts_compatibility_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. >Note: Only the following eBay marketplaces support automotive parts compatibility: EBAY_US EBAY_AU EBAY_CA EBAY_DE EBAY_ES EBAY_FR EBAY_GB EBAY_IT + * @return {AutomotivePartsCompatibilityPolicyResponse} Success + */ + GetAutomotivePartsCompatibilityPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_automotive_parts_compatibility_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define how to specify item conditions in the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_item_condition_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ItemConditionPolicyResponse} Success + */ + GetItemConditionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_item_condition_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define the allowed listing structures for the categories of a specific marketplace. The listing-structure policies currently pertain to whether or not you can list items with variations. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_listing_structure_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ListingStructurePolicyResponse} Success + */ + GetListingStructurePolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_listing_structure_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define the supported negotiated price features (like "best offer") for the categories of a specific marketplace. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_negotiated_price_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {NegotiatedPricePolicyResponse} Success + */ + GetNegotiatedPricePolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_negotiated_price_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method retrieves a list of leaf categories for a marketplace and identifies the categories that require items to have an eBay product ID value in order to be listed in those categories. An eBay product ID value (known as an "ePID") is a value that references a specific product in the eBay Catalog. Note: This method supports the eBay Product Based Shopping Experience (PBSE), which is applicable to only the US, UK, AU, and CA (English) marketplaces. Note that you can also use GetCategoryFeatures in the Trading API to retrieve the same information. For more information about using this method with PBSE, see the Product-Based Shopping Experience Playbook. Use the marketplace_id path parameter to specify the marketplace you want to review and use the filter query parameter to limit the categories returned in the response. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_product_adoption_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ProductAdoptionPolicyResponse} Success + */ + GetProductAdoptionPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_product_adoption_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + + /** + * This method returns the eBay policies that define whether or not you must include a return policy for the items you list in the categories of a specific marketplace, plus the guidelines for creating domestic and international return policies in the different eBay categories. By default, this method returns the entire category tree for the specified marketplace. You can limit the size of the result set by using the filter query parameter to specify only the category IDs you want to review. Tip: This method can return a very large response payload and we strongly recommend you get the results from this call in a GZIP file by including the following HTTP header with your request:   Accept-Encoding: application/gzip + * Get marketplace/{marketplace_id}/get_return_policies + * @param {string} filter This query parameter limits the response by returning eBay policy information for only the leaf categories specified by this parameter. Set filter to a list of categoryId values. You can specify up to 50 category IDs by separating each with a pipe character ('|'). If you specify more than 50 categoryId values, eBay returns a warning along with the results for the first 50 IDs. If you specify a category ID that has child nodes, eBay returns policy information for all the leaf categories of that parent node. Example: filter=categoryIds:{100|101|102} Note that you must URL-encode the list of category ID values, which results in the following filter for the above example:   filter=categoryIds%3A%7B100%7C101%7C102%7D + * @param {string} marketplace_id This path parameter specifies the eBay marketplace for which policy information is retrieved. See the following page for a list of valid eBay marketplace IDs: Request components. + * @return {ReturnPolicyResponse} Success + */ + GetReturnPolicies(filter: string | null | undefined, marketplace_id: string): Observable { + return this.http.get(this.baseUri + 'marketplace/' + (marketplace_id == null ? '' : encodeURIComponent(marketplace_id)) + '/get_return_policies?filter=' + (filter == null ? '' : encodeURIComponent(filter)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_negotiation.txt b/Tests/SwagTsTests/NG2Results/sell_negotiation.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/sell_negotiation.txt rename to Tests/SwagTsTests/NG2Results/sell_negotiation.ts index 927d2882..0600ca0f 100644 --- a/Tests/SwagTsTests/NG2Results/sell_negotiation.txt +++ b/Tests/SwagTsTests/NG2Results/sell_negotiation.ts @@ -1,239 +1,239 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - export interface Amount { - - /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ - currency?: string | null; - - /** The monetary amount in the specified currency. */ - value?: string | null; - } - - - /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ - export interface CreateOffersRequest { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ - allowCounterOffer?: boolean | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ - offeredItems?: Array; - } - - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - export interface TimeDuration { - - /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ - unit?: string | null; - - /** - * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - value?: number | null; - } - - - /** A complex type that defines the offer being made to an "interested" buyer. */ - export interface OfferedItem { - - /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ - discountPercentage?: string | null; - - /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ - listingId?: string | null; - - /** A complex type that describes the value of a monetary amount as represented by a global currency. */ - price?: Amount; - - /** - * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - quantity?: number | null; - } - - - /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ - export interface EligibleItem { - - /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ - listingId?: string | null; - } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** A complex type that defines an offer that a seller makes to eligible buyers. */ - export interface Offer { - - /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ - allowCounterOffer?: boolean | null; - - /** This complex type identifies an eBay user. */ - buyer?: User; - - /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ - creationDate?: string | null; - - /** The eBay UserName of the user (seller) who initiated the offer. */ - initiatedBy?: string | null; - - /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ - lastModifiedDate?: string | null; - - /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ - message?: string | null; - - /** A complex type that specifies a period of time using a specified time-measurement unit. */ - offerDuration?: TimeDuration; - - /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ - offeredItems?: Array; - - /** A unique eBay-assigned identifier for the offer. */ - offerId?: string | null; - - /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ - offerStatus?: string | null; - - /** The type of offer being made. For implementation help, refer to eBay API documentation */ - offerType?: string | null; - - /** A unique, eBay-assigned ID for the revision of the offer. */ - revision?: string | null; - } - - - /** This complex type identifies an eBay user. */ - export interface User { - - /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ - maskedUsername?: string | null; - } - - - /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ - export interface PagedEligibleItemCollection { - - /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ - eligibleItems?: Array; - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - - /** The response object returned from a SendOfferToInterestedBuyers request. */ - export interface SendOfferToInterestedBuyersCollectionResponse { - - /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ - offers?: Array; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Get find_eligible_items - * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 - * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {PagedEligibleItemCollection} Success - */ - FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); - } - - /** - * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. - * Post send_offer_to_interested_buyers - * @param {CreateOffersRequest} requestBody Send offer to eligible items request. - * @return {SendOfferToInterestedBuyersCollectionResponse} Success - */ - SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Observable { - return this.http.post(this.baseUri + 'send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + export interface Amount { + + /** The base currency applied to the value field to establish a monetary amount. The currency is represented as a 3-letter ISO4217 currency code. For example, the code for the Canadian Dollar is CAD. Default: The default currency of the eBay marketplace that hosts the listing. For implementation help, refer to eBay API documentation */ + currency?: string | null; + + /** The monetary amount in the specified currency. */ + value?: string | null; + } + + + /** This complex type contains the fields needed to create an offer to a buyer that is initiated by the seller. */ + export interface CreateOffersRequest { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. Note: Currently, you must set this field to false; counter-offers are not supported in this release. Default: false */ + allowCounterOffer?: boolean | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers. To increase the conversion rate of the offers a seller makes to buyers, eBay recommends you always add a customized message to your offers. Maximum length: 2,000 characters */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** An array of objects where each object contains the details of an offer and the ID of the listing on which the offer is being made. Note that the service does not currently support the creation of multiple offers with a single call to sendOfferToInterestedBuyer. With this, each request can target only one listing at a time and you must populate this array with a single element that contains the details of one offer. */ + offeredItems?: Array; + } + + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + export interface TimeDuration { + + /** A time-measurement unit that specifies a singular period of time. A span of time is defined when you apply the value specified in the value field to the value specified for unit. Time-measurement units can be YEAR, MONTH, DAY, and so on. See TimeDurationUnitEnum for a complete list of possible time-measurement units. For implementation help, refer to eBay API documentation */ + unit?: string | null; + + /** + * An integer that represents an amount of time, as measured by the time-measurement unit specified in the unit field. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + value?: number | null; + } + + + /** A complex type that defines the offer being made to an "interested" buyer. */ + export interface OfferedItem { + + /** This value denotes the percentage that the listing in the offer will be discounted from its original listed price. The seller can specify either the exact price of the discounted items with the price field or they can use this field to specify the percentage that the listing will be discounted, but not both. Minimum: 5 Required if you do not specify a price value. */ + discountPercentage?: string | null; + + /** This value is a unique eBay-assigned ID that identifies the listing to which the offer pertains. A listingId value is generated by eBay when you list an item with the Trading API. */ + listingId?: string | null; + + /** A complex type that describes the value of a monetary amount as represented by a global currency. */ + price?: Amount; + + /** + * This integer value indicates the number of items in the eBay listing for which the offer is being made. The offer being made by the seller is an "all or nothing" offer, meaning the buyer must purchase the indicated quantity of items in order to receive the discount on the transaction. Default: 1 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + quantity?: number | null; + } + + + /** A listing that is eligible for a seller-initiated offer to a buyer. Listings are identified by a listingId value that is generated and assigned by eBay when a seller lists an item using the Trading API. Note: The Negotiation API does not currently support listings that are managed with the Inventory API. */ + export interface EligibleItem { + + /** The unique eBay-assigned ID for an eBay listing. A listingId is assigned by eBay when a seller creates a listing with the Trading API. */ + listingId?: string | null; + } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** A complex type that defines an offer that a seller makes to eligible buyers. */ + export interface Offer { + + /** If set to true, the buyer is allowed to make a counter-offer to the seller's offer. */ + allowCounterOffer?: boolean | null; + + /** This complex type identifies an eBay user. */ + buyer?: User; + + /** The date and time when the seller's offer was created. The returned timestamp is formatted as an ISO 8601 string, which is based on the 24-hour Coordinated Universal Time (UTC) clock. Format: [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z Example: 2018-08-20T07:09:00.000Z */ + creationDate?: string | null; + + /** The eBay UserName of the user (seller) who initiated the offer. */ + initiatedBy?: string | null; + + /** The date and time when the offer was last modified. The returned timestamp is formatted as an ISO 8601 string. */ + lastModifiedDate?: string | null; + + /** A seller-defined message related to the offer being made. This message is sent to the list of "interested" buyers along with the offer message from eBay. */ + message?: string | null; + + /** A complex type that specifies a period of time using a specified time-measurement unit. */ + offerDuration?: TimeDuration; + + /** The list of items associated with the offer. Currently, the offer list is restricted to a single offer. */ + offeredItems?: Array; + + /** A unique eBay-assigned identifier for the offer. */ + offerId?: string | null; + + /** The current state, or status, of an offer. Status states include PENDING, COUNTERED, ACCEPTED, and DECLINED. For implementation help, refer to eBay API documentation */ + offerStatus?: string | null; + + /** The type of offer being made. For implementation help, refer to eBay API documentation */ + offerType?: string | null; + + /** A unique, eBay-assigned ID for the revision of the offer. */ + revision?: string | null; + } + + + /** This complex type identifies an eBay user. */ + export interface User { + + /** The masked user name is a user name that has certain characters hidden for privacy of the user. */ + maskedUsername?: string | null; + } + + + /** This complex type defines a collection of listings that are eligible for an offer to a buyer. */ + export interface PagedEligibleItemCollection { + + /** A list of items that are eligible for a seller-initiated offer to a buyer. Each element in the list contains the listing ID of a listed item. These IDs represent the listings for which buyers have shown an interest. */ + eligibleItems?: Array; + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set in the request with the limit query parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** The URI for the following page of results. This value is returned only if there is an additional page of results to display from the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set in the request with the offset query parameter. Note: The items in a paginated result set use a zero-based list where the first item in the list has an offset of 0. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the preceding page of results. This value is returned only if there is a previous page of results to display from the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items retrieved in the result set. If no items match the search criteria, the server returns the HTTP status code 204 No Content. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + + /** The response object returned from a SendOfferToInterestedBuyers request. */ + export interface SendOfferToInterestedBuyersCollectionResponse { + + /** The offers container returns a list of the offers sent to buyers who have shown an interest in listings included in the offer. */ + offers?: Array; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * This method evaluates a seller's current listings and returns the set of IDs that are eligible for a seller-initiated discount offer to a buyer. A listing ID is returned only when one or more buyers have shown an "interest" in the listing. If any buyers have shown interest in a listing, the seller can initiate a "negotiation" with them by calling sendOfferToInterestedBuyers, which sends all interested buyers a message that offers the listing at a discount. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Get find_eligible_items + * @param {string} limit This query parameter specifies the maximum number of items to return from the result set on a page in the paginated response. Minimum: 1    Maximum: 200 Default: 10 + * @param {string} offset This query parameter specifies the number of results to skip in the result set before returning the first result in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 results from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {PagedEligibleItemCollection} Success + */ + FindEligibleItems(limit: string | null | undefined, offset: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'find_eligible_items?limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), {}); + } + + /** + * This method sends eligible buyers offers to purchase items in a listing at a discount. When a buyer has shown interest in a listing, they become "eligible" to receive a seller-initiated offer to purchase the item(s). Sellers use findEligibleItems to get the set of listings that have interested buyers. If a listing has interested buyers, sellers can use this method (sendOfferToInterestedBuyers) to send an offer to the buyers who are interested in the listing. The offer gives buyers the ability to purchase the associated listings at a discounted price. For details about how to create seller offers to buyers, see Sending offers to buyers. + * Post send_offer_to_interested_buyers + * @param {CreateOffersRequest} requestBody Send offer to eligible items request. + * @return {SendOfferToInterestedBuyersCollectionResponse} Success + */ + SendOfferToInterestedBuyers(requestBody: CreateOffersRequest): Observable { + return this.http.post(this.baseUri + 'send_offer_to_interested_buyers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/sell_recommendation.txt b/Tests/SwagTsTests/NG2Results/sell_recommendation.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/sell_recommendation.txt rename to Tests/SwagTsTests/NG2Results/sell_recommendation.ts index 96e5e1c1..540cee64 100644 --- a/Tests/SwagTsTests/NG2Results/sell_recommendation.txt +++ b/Tests/SwagTsTests/NG2Results/sell_recommendation.ts @@ -1,163 +1,163 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - export interface Ad { - - /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ - bidPercentages?: Array; - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - promoteWithAd?: PromoteWithAd; - } - - - /** A complex type that returns data related to Promoted Listings bid percentages. */ - export interface BidPercentages { - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - basis?: Basis; - - /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ - value?: string | null; - } - - - /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ - export enum Basis { TRENDING = 0 } - - - /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ - export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } - - - /** This type defines the fields that can be returned in an error. */ - export interface Error { - - /** Identifies the type of erro. */ - category?: string | null; - - /** Name for the primary system where the error occurred. This is relevant for application errors. */ - domain?: string | null; - - /** - * A unique number to identify the error. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - errorId?: number | null; - - /** An array of request elements most closely associated to the error. */ - inputRefIds?: Array; - - /** A more detailed explanation of the error. */ - longMessage?: string | null; - - /** Information on how to correct the problem, in the end user's terms and language where applicable. */ - message?: string | null; - - /** An array of request elements most closely associated to the error. */ - outputRefIds?: Array; - - /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ - parameters?: Array; - - /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ - subdomain?: string | null; - } - - export interface ErrorParameter { - - /** The object of the error. */ - name?: string | null; - - /** The value of the object. */ - value?: string | null; - } - - - /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ - export interface FindListingRecommendationRequest { - - /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ - listingIds?: Array; - } - - - /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ - export interface ListingRecommendation { - - /** An ID that identifies the active listing associated with the eBay recommendations. */ - listingId?: string | null; - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - marketing?: MarketingRecommendation; - } - - - /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ - export interface MarketingRecommendation { - - /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ - ad?: Ad; - - /** A message that can conditionally accompany the listing information. */ - message?: string | null; - } - - - /** The high-level object used to return a set of Promoted Listings ad recommendations. */ - export interface PagedListingRecommendationCollection { - - /** The URI of the current page of results from the result set. */ - href?: string | null; - - /** - * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - limit?: number | null; - - /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ - listingRecommendations?: Array; - - /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ - next?: string | null; - - /** - * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - offset?: number | null; - - /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ - prev?: string | null; - - /** - * The total number of items in the result set. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - total?: number | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. - * Post find - * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} - * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 - * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 - * @return {void} Success - */ - FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Observable> { - return this.http.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + export interface Ad { + + /** This field returns information that you can use to configure the bidPercentage field in a Promoted Listings campaign. While this field returns an array, TRENDING is currently the only supported bid percentage type, so the array is populated with just a single element. The TRENDING bid percentage is calculated by reviewing the average ad rates of other similar promoted listings in the marketplace. Setting the bidPercentage of your ad campaign to this rate will help the items in the campaign be competitive with other items in the marketplace by improving their chances of being displayed more often in the marketplace. */ + bidPercentages?: Array; + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + promoteWithAd?: PromoteWithAd; + } + + + /** A complex type that returns data related to Promoted Listings bid percentages. */ + export interface BidPercentages { + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + basis?: Basis; + + /** The bid percentage data is a single precision value, as calculated by the associated basis. A TRENDING value is calculated by taking into account the average bid percentages of similar promoted listings in the associated marketplace. In Promoted listings ad campaigns, the bid percentage (also known as the ad rate) is a user-defined value that sets the level that eBay raises the visibility of the listing in the marketplace. It is also the rate that is used to calculate the Promoted Listings fee. Minimum value: 1.0   Maximum value: 100.0 */ + value?: string | null; + } + + + /** An enum that describes the different ways, or the basis, by which the bid percentage value is calculated. Currently, TRENDING is the only valid basis. */ + export enum Basis { TRENDING = 0 } + + + /** An enum that describes whether or not eBay recommends placing the associated listing in a Promoted Listings ad campaign. */ + export enum PromoteWithAd { RECOMMENDED = 0, UNDETERMINED = 1 } + + + /** This type defines the fields that can be returned in an error. */ + export interface Error { + + /** Identifies the type of erro. */ + category?: string | null; + + /** Name for the primary system where the error occurred. This is relevant for application errors. */ + domain?: string | null; + + /** + * A unique number to identify the error. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + errorId?: number | null; + + /** An array of request elements most closely associated to the error. */ + inputRefIds?: Array; + + /** A more detailed explanation of the error. */ + longMessage?: string | null; + + /** Information on how to correct the problem, in the end user's terms and language where applicable. */ + message?: string | null; + + /** An array of request elements most closely associated to the error. */ + outputRefIds?: Array; + + /** An array of name/value pairs that describe details the error condition. These are useful when multiple errors are returned. */ + parameters?: Array; + + /** Further helps indicate which subsystem the error is coming from. System subcategories include: Initialization, Serialization, Security, Monitoring, Rate Limiting, etc. */ + subdomain?: string | null; + } + + export interface ErrorParameter { + + /** The object of the error. */ + name?: string | null; + + /** The value of the object. */ + value?: string | null; + } + + + /** An list of listing ID values for which you want Promoted Listings ad configuration information. */ + export interface FindListingRecommendationRequest { + + /** A comma-separated list of listing IDs for which you want Promoted Listings ad configuration information. Currently, this method accepts only listingId values from the Trading API. Max: 500 listing IDs */ + listingIds?: Array; + } + + + /** A complex type that contains the ID of an actively listed item and a set of related listing recommendations. The recommendations contain information the seller can use to optimize their listing configurations. */ + export interface ListingRecommendation { + + /** An ID that identifies the active listing associated with the eBay recommendations. */ + listingId?: string | null; + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + marketing?: MarketingRecommendation; + } + + + /** A complex type that contains information about how a seller can improve their listing configurations. The AD object contains Promoted Listings recommendations and information, which the seller can use to improve buyer conversions. The response can also contain an optional message about the returned data. */ + export interface MarketingRecommendation { + + /** A complex type that contains recommendations and information on how to configure Promoted Listings ad campaigns. */ + ad?: Ad; + + /** A message that can conditionally accompany the listing information. */ + message?: string | null; + } + + + /** The high-level object used to return a set of Promoted Listings ad recommendations. */ + export interface PagedListingRecommendationCollection { + + /** The URI of the current page of results from the result set. */ + href?: string | null; + + /** + * The number of items returned on a single page from the result set. This value can be set with the limit request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + limit?: number | null; + + /** Returns a list of listingRecommendations, where each element in the list offers recommendations for the associated listing ID. */ + listingRecommendations?: Array; + + /** The URI for the next page of results. This value is returned only if there is an additional page of results in the result set. Max length: 2048 */ + next?: string | null; + + /** + * The number of results skipped in the result set before listing the first returned result. This value can be set with the offset request parameter. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + offset?: number | null; + + /** The URI for the previous page of results. This value is returned only if there is a previous page of results in the result set. Max length: 2048 */ + prev?: string | null; + + /** + * The total number of items in the result set. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + total?: number | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * The find method returns recommendations and information that sellers can use to optimize their listing configurations. The response from this method includes an array of the seller's listing IDs, where each element in the array contains recommendations related to the associated listing ID. The AD recommendation type The method currently returns information for a single recommendation type (AD) which contains information that sellers can use to configure Promoted Listings ad campaigns. AD contains two sets of information: The promoteWithAd indicator The promoteWithAd response field indicates whether or not eBay recommends you place the associated listing in a Promoted Listings ad campaign. The returned value is set to either RECOMMENDED or UNDETERMINED, where RECOMMENDED identifies the listings that will benefit the most from having them included in an ad campaign. The bid percentage Also known as the "ad rate," the bidPercentage field provides the current trending bid percentage of similarly promoted items in the marketplace. The ad rate is a user-specified value that indicates the level of promotion that eBay applies to the campaign across the marketplace. The value is also used to calculate the Promotion Listings fee, which is assessed to the seller if a Promoted Listings action results in the sale of an item. Configuring the request You can configure a request to review all of a seller's currently active listings, or just a subset of them. All active listings – If you leave the request body empty, the request targets all the items currently listed by the seller. Here, the response is filtered to contain only the items where promoteWithAd equals RECOMMENDED. In this case, eBay recommends that all the returned listings should be included in a Promoted Listings ad campaign. Selected listing IDs – If you populate the request body with a set of listingIds, the response contains data for all the specified listing IDs. In this scenario, the response provides you with information on listings where the promoteWithAd can be either RECOMMENDED or UNDETERMINED. The paginated response Because the response can contain many listing IDs, the findListingRecommendations method paginates the response set. You can control size of the returned pages, as well as an offset that dictates where to start the pagination, using query parameters in the request. + * Post find + * @param {string} filter Provide a list of key-value pairs to specify the criteria you want to use to filter the response. In the list, separate each filter key from its associated value with a colon (":"). Currently, the only supported filter value is recommendationTypes and it supports only the ("AD") type. Follow the recommendationTypes specifier with the filter type(s) enclosed in curly braces ("{ }"), and separate multiple types with commas. Example: filter=recommendationTypes:{AD} Default: recommendationTypes:{AD} + * @param {string} limit Use this query parameter to set the maximum number of ads to return on a page from the paginated response. Default: 10 Maximum: 500 + * @param {string} offset Specifies the number of ads to skip in the result set before returning the first ad in the paginated response. Combine offset with the limit query parameter to control the items returned in the response. For example, if you supply an offset of 0 and a limit of 10, the first page of the response contains the first 10 items from the complete list of items retrieved by the call. If offset is 10 and limit is 20, the first page of the response contains items 11-30 from the complete result set. Default: 0 + * @return {void} Success + */ + FindListingRecommendations(filter: string | null | undefined, limit: string | null | undefined, offset: string | null | undefined, requestBody: FindListingRecommendationRequest): Observable> { + return this.http.post(this.baseUri + 'find?filter=' + (filter == null ? '' : encodeURIComponent(filter)) + '&limit=' + (limit == null ? '' : encodeURIComponent(limit)) + '&offset=' + (offset == null ? '' : encodeURIComponent(offset)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/xero-identity.txt b/Tests/SwagTsTests/NG2Results/xero-identity.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/xero-identity.txt rename to Tests/SwagTsTests/NG2Results/xero-identity.ts index 0e5fc0f9..efadcc2f 100644 --- a/Tests/SwagTsTests/NG2Results/xero-identity.txt +++ b/Tests/SwagTsTests/NG2Results/xero-identity.ts @@ -1,91 +1,91 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Connection { - - /** Xero identifier */ - id?: string | null; - - /** Xero identifier of organisation */ - tenantId?: string | null; - - /** Identifier shared across connections authorised at the same time */ - authEventId?: string | null; - - /** Xero tenant type (i.e. ORGANISATION, PRACTICE) */ - tenantType?: string | null; - - /** Xero tenant name */ - tenantName?: string | null; - - /** The date when the user connected this tenant to your app */ - createdDateUtc?: Date | null; - - /** The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. */ - updatedDateUtc?: Date | null; - } - - export interface RefreshToken { - - /** Xero grant type */ - grant_type?: string | null; - - /** refresh token provided during authentication flow */ - refresh_token?: string | null; - - /** client id for Xero app */ - client_id?: string | null; - - /** client secret for Xero app 2 */ - client_secret?: string | null; - } - - export interface AccessToken { - - /** Xero unique identifier */ - id_token?: string | null; - - /** access token provided during authentication flow */ - access_token?: string | null; - - /** time in milliseconds until access token expires. */ - expires_in?: string | null; - - /** type of token i.e. Bearer */ - token_type?: string | null; - - /** token used to refresh an expired access token */ - refresh_token?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Allows you to retrieve the connections for this user - * Override the base server url that include version - * Get connections - * @param {string} authEventId Filter by authEventId - * @return {Array} Success - return response of type Connections array with 0 to n Connection - */ - GetConnections(authEventId: string | null | undefined): Observable> { - return this.http.get>(this.baseUri + 'connections?authEventId=' + (authEventId == null ? '' : encodeURIComponent(authEventId)), {}); - } - - /** - * Allows you to delete a connection for this user (i.e. disconnect a tenant) - * Override the base server url that include version - * Delete connections/{id} - * @param {string} id Unique identifier for retrieving single object - * @return {void} - */ - DeleteConnection(id: string): Observable> { - return this.http.delete(this.baseUri + 'connections/' + (id == null ? '' : encodeURIComponent(id)), { observe: 'response', responseType: 'text' }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Connection { + + /** Xero identifier */ + id?: string | null; + + /** Xero identifier of organisation */ + tenantId?: string | null; + + /** Identifier shared across connections authorised at the same time */ + authEventId?: string | null; + + /** Xero tenant type (i.e. ORGANISATION, PRACTICE) */ + tenantType?: string | null; + + /** Xero tenant name */ + tenantName?: string | null; + + /** The date when the user connected this tenant to your app */ + createdDateUtc?: Date | null; + + /** The date when the user most recently connected this tenant to your app. May differ to the created date if the user has disconnected and subsequently reconnected this tenant to your app. */ + updatedDateUtc?: Date | null; + } + + export interface RefreshToken { + + /** Xero grant type */ + grant_type?: string | null; + + /** refresh token provided during authentication flow */ + refresh_token?: string | null; + + /** client id for Xero app */ + client_id?: string | null; + + /** client secret for Xero app 2 */ + client_secret?: string | null; + } + + export interface AccessToken { + + /** Xero unique identifier */ + id_token?: string | null; + + /** access token provided during authentication flow */ + access_token?: string | null; + + /** time in milliseconds until access token expires. */ + expires_in?: string | null; + + /** type of token i.e. Bearer */ + token_type?: string | null; + + /** token used to refresh an expired access token */ + refresh_token?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Allows you to retrieve the connections for this user + * Override the base server url that include version + * Get connections + * @param {string} authEventId Filter by authEventId + * @return {Array} Success - return response of type Connections array with 0 to n Connection + */ + GetConnections(authEventId: string | null | undefined): Observable> { + return this.http.get>(this.baseUri + 'connections?authEventId=' + (authEventId == null ? '' : encodeURIComponent(authEventId)), {}); + } + + /** + * Allows you to delete a connection for this user (i.e. disconnect a tenant) + * Override the base server url that include version + * Delete connections/{id} + * @param {string} id Unique identifier for retrieving single object + * @return {void} + */ + DeleteConnection(id: string): Observable> { + return this.http.delete(this.baseUri + 'connections/' + (id == null ? '' : encodeURIComponent(id)), { observe: 'response', responseType: 'text' }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/xero-payroll-au.txt b/Tests/SwagTsTests/NG2Results/xero-payroll-au.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/xero-payroll-au.txt rename to Tests/SwagTsTests/NG2Results/xero-payroll-au.ts index dab49ef3..2306fa6a 100644 --- a/Tests/SwagTsTests/NG2Results/xero-payroll-au.txt +++ b/Tests/SwagTsTests/NG2Results/xero-payroll-au.ts @@ -1,1574 +1,1574 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Employees { - Employees1?: Array; - } - - export interface Employee { - - /** - * First name of employee - * Required - */ - FirstName: string; - - /** - * Last name of employee - * Required - */ - LastName: string; - - /** - * Date of birth of the employee (YYYY-MM-DD) - * Required - */ - DateOfBirth: string; - HomeAddress?: HomeAddress; - - /** Start date for an employee (YYYY-MM-DD) */ - StartDate?: string | null; - - /** Title of the employee */ - Title?: string | null; - - /** Middle name(s) of the employee */ - MiddleNames?: string | null; - - /** The email address for the employee */ - Email?: string | null; - - /** The employee’s gender. See Employee Gender */ - Gender?: EmployeeGender | null; - - /** Employee phone number */ - Phone?: string | null; - - /** Employee mobile number */ - Mobile?: string | null; - - /** Employee’s twitter name */ - TwitterUserName?: string | null; - - /** Authorised to approve other employees' leave requests */ - IsAuthorisedToApproveLeave?: boolean | null; - - /** Authorised to approve timesheets */ - IsAuthorisedToApproveTimesheets?: boolean | null; - - /** JobTitle of the employee */ - JobTitle?: string | null; - - /** Employees classification */ - Classification?: string | null; - - /** Xero unique identifier for earnings rate */ - OrdinaryEarningsRateID?: string | null; - - /** Xero unique identifier for payroll calendar for the employee */ - PayrollCalendarID?: string | null; - - /** The Employee Group allows you to report on payroll expenses and liabilities for each group of employees */ - EmployeeGroupName?: string | null; - - /** Xero unique identifier for an Employee */ - EmployeeID?: string | null; - - /** Employee Termination Date (YYYY-MM-DD) */ - TerminationDate?: string | null; - BankAccounts?: Array; - PayTemplate?: PayTemplate; - OpeningBalances?: OpeningBalances; - TaxDeclaration?: TaxDeclaration; - LeaveBalances?: Array; - LeaveLines?: Array; - SuperMemberships?: Array; - - /** Employee Status Types */ - Status?: EmployeeStatus | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface HomeAddress { - - /** - * Address line 1 for employee home address - * Required - */ - AddressLine1: string; - - /** Address line 2 for employee home address */ - AddressLine2?: string | null; - - /** Suburb for employee home address */ - City?: string | null; - - /** State abbreviation for employee home address */ - Region?: HomeAddressRegion | null; - - /** PostCode for employee home address */ - PostalCode?: string | null; - - /** Country of HomeAddress */ - Country?: string | null; - } - - export enum HomeAddressRegion { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } - - export enum EmployeeGender { N = 0, M = 1, F = 2, I = 3 } - - export interface BankAccount { - - /** The text that will appear on your employee's bank statement when they receive payment */ - StatementText?: string | null; - - /** The name of the account */ - AccountName?: string | null; - - /** The BSB number of the account */ - BSB?: string | null; - - /** The account number */ - AccountNumber?: string | null; - - /** If this account is the Remaining bank account */ - Remainder?: boolean | null; - - /** - * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) - * Type: double - */ - Amount?: number | null; - } - - export interface PayTemplate { - EarningsLines?: Array; - DeductionLines?: Array; - SuperLines?: Array; - ReimbursementLines?: Array; - LeaveLines?: Array; - } - - export interface EarningsLine { - - /** - * Xero unique id for earnings rate - * Required - */ - EarningsRateID: string; - - /** Required */ - CalculationType: EarningsLineCalculationType; - - /** - * Annual salary for earnings line - * Type: double - */ - AnnualSalary?: number | null; - - /** - * number of units for earning line - * Type: double - */ - NumberOfUnitsPerWeek?: number | null; - - /** - * Rate per unit of the EarningsLine. - * Type: double - */ - RatePerUnit?: number | null; - - /** - * Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" - * Type: double - */ - NormalNumberOfUnits?: number | null; - - /** - * Earnings rate amount - * Type: double - */ - Amount?: number | null; - - /** - * Earnings rate number of units. - * Type: double - */ - NumberOfUnits?: number | null; - - /** - * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - FixedAmount?: number | null; - } - - export enum EarningsLineCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } - - export interface DeductionLine { - - /** - * Xero deduction type identifier - * Required - */ - DeductionTypeID: string; - - /** Required */ - CalculationType: DeductionLineCalculationType; - - /** - * Deduction type amount - * Type: double - */ - Amount?: number | null; - - /** - * The Percentage of the Deduction - * Type: double - */ - Percentage?: number | null; - - /** - * Deduction number of units - * Type: double - */ - NumberOfUnits?: number | null; - } - - export enum DeductionLineCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } - - export interface SuperLine { - - /** Xero super membership ID */ - SuperMembershipID?: string | null; - ContributionType?: SuperLineContributionType | null; - CalculationType?: SuperLineCalculationType | null; - - /** - * amount of mimimum earnings - * Type: double - */ - MinimumMonthlyEarnings?: number | null; - - /** expense account code */ - ExpenseAccountCode?: string | null; - - /** liabilty account code */ - LiabilityAccountCode?: string | null; - - /** - * percentage for super line - * Type: double - */ - Percentage?: number | null; - - /** - * Super membership amount - * Type: double - */ - Amount?: number | null; - } - - export enum SuperLineContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } - - export enum SuperLineCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } - - export interface ReimbursementLine { - - /** Xero reimbursement type identifier */ - ReimbursementTypeID?: string | null; - - /** - * Reimbursement type amount - * Type: double - */ - Amount?: number | null; - - /** - * Reimbursement lines description (max length 50) - * Max length: 50 - */ - Description?: string | null; - - /** Reimbursement expense account. For posted pay run you should be able to see expense account code. */ - ExpenseAccount?: string | null; - } - - export interface LeaveLine { - - /** Xero leave type identifier */ - LeaveTypeID?: string | null; - - /** Calculation type for leave line for Opening Balance on Employee */ - CalculationType?: LeaveLineCalculationType | null; - EntitlementFinalPayPayoutType?: LeaveLineEntitlementFinalPayPayoutType | null; - EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; - - /** amount of leave line */ - IncludeSuperannuationGuaranteeContribution?: boolean | null; - - /** - * Leave number of units - * Type: double - */ - NumberOfUnits?: number | null; - } - - export enum LeaveLineCalculationType { NOCALCULATIONREQUIRED = 0, FIXEDAMOUNTEACHPERIOD = 1, ENTERRATEINPAYTEMPLATE = 2, BASEDONORDINARYEARNINGS = 3, '' = 4 } - - export enum LeaveLineEntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } - - export enum LeaveLineEmploymentTerminationPaymentType { O = 0, R = 1 } - - export interface OpeningBalances { - - /** Opening Balance Date. (YYYY-MM-DD) */ - OpeningBalanceDate?: string | null; - - /** Opening Balance tax */ - Tax?: string | null; - EarningsLines?: Array; - DeductionLines?: Array; - SuperLines?: Array; - ReimbursementLines?: Array; - LeaveLines?: Array; - } - - export interface TaxDeclaration { - - /** - * Address line 1 for employee home address - * Required - */ - EmployeeID: string; - - /** Required */ - EmploymentBasis: TaxDeclarationEmploymentBasis; - TFNExemptionType?: TaxDeclarationTFNExemptionType | null; - - /** The tax file number e.g 123123123. */ - TaxFileNumber?: string | null; - - /** If the employee is Australian resident for tax purposes. e.g true or false */ - AustralianResidentForTaxPurposes?: boolean | null; - ResidencyStatus?: TaxDeclarationResidencyStatus | null; - - /** If tax free threshold claimed. e.g true or false */ - TaxFreeThresholdClaimed?: boolean | null; - - /** If has tax offset estimated then the tax offset estimated amount. e.g 100 */ - TaxOffsetEstimatedAmount?: string | null; - - /** If employee has HECS or HELP debt. e.g true or false */ - HasHELPDebt?: boolean | null; - - /** If employee has financial supplement debt. e.g true or false */ - HasSFSSDebt?: boolean | null; - - /** If employee has trade support loan. e.g true or false */ - HasTradeSupportLoanDebt?: boolean | null; - - /** If the employee has requested that additional tax be withheld each pay run. e.g 50 */ - UpwardVariationTaxWithholdingAmount?: string | null; - - /** If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false */ - EligibleToReceiveLeaveLoading?: boolean | null; - - /** If the employee has approved withholding variation. e.g (0 - 100) */ - ApprovedWithholdingVariationPercentage?: string | null; - - /** If the employee is eligible for student startup loan rules */ - HasStudentStartupLoan?: boolean | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - - export enum TaxDeclarationEmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } - - export enum TaxDeclarationTFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } - - export enum TaxDeclarationResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } - - export interface LeaveBalance { - - /** The name of the leave type */ - LeaveName?: string | null; - - /** Identifier of the leave type (see PayItems) */ - LeaveTypeID?: string | null; - - /** - * The balance of the leave available - * Type: double - */ - NumberOfUnits?: number | null; - - /** The type of units as specified by the LeaveType (see PayItems) */ - TypeOfUnits?: string | null; - } - - export interface SuperMembership { - - /** Xero unique identifier for Super membership */ - SuperMembershipID?: string | null; - - /** - * Xero identifier for super fund - * Required - */ - SuperFundID: string; - - /** - * The memberhsip number assigned to the employee by the super fund. - * Required - * Type: double - */ - EmployeeNumber: number; - } - - export enum EmployeeStatus { ACTIVE = 0, TERMINATED = 1 } - - export interface ValidationError { - - /** Validation error message */ - Message?: string | null; - } - - export interface LeaveApplications { - LeaveApplications1?: Array; - } - - export interface LeaveApplication { - - /** The Xero identifier for Payroll Employee */ - LeaveApplicationID?: string | null; - - /** The Xero identifier for Payroll Employee */ - EmployeeID?: string | null; - - /** The Xero identifier for Leave Type */ - LeaveTypeID?: string | null; - - /** The title of the leave */ - Title?: string | null; - - /** Start date of the leave (YYYY-MM-DD) */ - StartDate?: string | null; - - /** End date of the leave (YYYY-MM-DD) */ - EndDate?: string | null; - - /** The Description of the Leave */ - Description?: string | null; - LeavePeriods?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface LeavePeriod { - - /** - * The Number of Units for the leave - * Type: double - */ - NumberOfUnits?: number | null; - - /** The Pay Period End Date (YYYY-MM-DD) */ - PayPeriodEndDate?: string | null; - - /** The Pay Period Start Date (YYYY-MM-DD) */ - PayPeriodStartDate?: string | null; - LeavePeriodStatus?: LeavePeriodLeavePeriodStatus | null; - } - - export enum LeavePeriodLeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } - - export enum LeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } - - export interface PayItems { - PayItems1?: PayItem; - } - - export interface PayItem { - EarningsRates?: Array; - DeductionTypes?: Array; - LeaveTypes?: Array; - ReimbursementTypes?: Array; - } - - export interface EarningsRate { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** - * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT - * Max length: 50 - */ - TypeOfUnits?: string | null; - - /** Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding */ - IsExemptFromTax?: boolean | null; - - /** See the ATO website for details of which payments are exempt from SGC */ - IsExemptFromSuper?: boolean | null; - - /** Boolean to determine if the earnings rate is reportable or exempt from W1 */ - IsReportableAsW1?: boolean | null; - EarningsType?: EarningsRateEarningsType | null; - - /** Xero identifier */ - EarningsRateID?: string | null; - RateType?: EarningsRateRateType | null; - - /** Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. */ - RatePerUnit?: string | null; - - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE - * Type: double - */ - Multiplier?: number | null; - - /** Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE */ - AccrueLeave?: boolean | null; - - /** - * Optional Amount for FIXEDAMOUNT RateType EarningsRate - * Type: double - */ - Amount?: number | null; - EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - AllowanceType?: EarningsRateAllowanceType | null; - } - - export enum EarningsRateEarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } - - export enum EarningsRateRateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } - - export enum EarningsRateAllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } - - export interface DeductionType { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. */ - ReducesTax?: boolean | null; - - /** Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. */ - ReducesSuper?: boolean | null; - - /** Boolean to determine if the deduction type is reportable or exempt from W1 */ - IsExemptFromW1?: boolean | null; - - /** Xero identifier */ - DeductionTypeID?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - DeductionCategory?: DeductionTypeDeductionCategory | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - } - - export enum DeductionTypeDeductionCategory { NONE = 0, UNIONFEES = 1, WORKPLACEGIVING = 2 } - - export interface LeaveType { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate */ - TypeOfUnits?: string | null; - - /** Xero identifier */ - LeaveTypeID?: string | null; - - /** - * The number of units the employee is entitled to each year - * Type: double - */ - NormalEntitlement?: number | null; - - /** - * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - LeaveLoadingRate?: number | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Set this to indicate that an employee will be paid when taking this type of leave */ - IsPaidLeave?: boolean | null; - - /** Set this if you want a balance for this leave type to be shown on your employee’s payslips */ - ShowOnPayslip?: boolean | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - } - - export interface ReimbursementType { - - /** - * Name of the earnings rate (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** Xero identifier */ - ReimbursementTypeID?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Is the current record */ - CurrentRecord?: boolean | null; - } - - export interface PayrollCalendars { - PayrollCalendars1?: Array; - } - - export interface PayrollCalendar { - - /** Name of the Payroll Calendar */ - Name?: string | null; - CalendarType?: PayrollCalendarCalendarType | null; - - /** The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) */ - StartDate?: string | null; - - /** The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) */ - PaymentDate?: string | null; - - /** Xero identifier */ - PayrollCalendarID?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum PayrollCalendarCalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } - - export interface Timesheets { - Timesheets1?: Array; - } - - export interface Timesheet { - - /** - * The Xero identifier for an employee - * Required - */ - EmployeeID: string; - - /** - * Period start date (YYYY-MM-DD) - * Required - */ - StartDate: string; - - /** - * Period end date (YYYY-MM-DD) - * Required - */ - EndDate: string; - Status?: TimesheetStatus | null; - - /** - * Timesheet total hours - * Type: double - */ - Hours?: number | null; - - /** The Xero identifier for a Payroll Timesheet */ - TimesheetID?: string | null; - TimesheetLines?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum TimesheetStatus { DRAFT = 0, PROCESSED = 1, APPROVED = 2 } - - export interface TimesheetLine { - - /** The Xero identifier for an Earnings Rate */ - EarningsRateID?: string | null; - - /** The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. */ - TrackingItemID?: string | null; - - /** The number of units on a timesheet line */ - NumberOfUnits?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - - export interface TimesheetObject { - Timesheet?: Timesheet; - } - - export interface PayRuns { - PayRuns1?: Array; - } - - export interface PayRun { - - /** - * Xero identifier for pay run - * Required - */ - PayrollCalendarID: string; - - /** Xero identifier for pay run */ - PayRunID?: string | null; - - /** Period Start Date for the PayRun (YYYY-MM-DD) */ - PayRunPeriodStartDate?: string | null; - - /** Period End Date for the PayRun (YYYY-MM-DD) */ - PayRunPeriodEndDate?: string | null; - PayRunStatus?: PayRunPayRunStatus | null; - - /** Payment Date for the PayRun (YYYY-MM-DD) */ - PaymentDate?: string | null; - - /** Payslip message for the PayRun */ - PayslipMessage?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** The payslips in the payrun */ - Payslips?: Array; - - /** - * The total Wages for the Payrun - * Type: double - */ - Wages?: number | null; - - /** - * The total Deductions for the Payrun - * Type: double - */ - Deductions?: number | null; - - /** - * The total Tax for the Payrun - * Type: double - */ - Tax?: number | null; - - /** - * The total Super for the Payrun - * Type: double - */ - Super?: number | null; - - /** - * The total Reimbursements for the Payrun - * Type: double - */ - Reimbursement?: number | null; - - /** - * The total NetPay for the Payrun - * Type: double - */ - NetPay?: number | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum PayRunPayRunStatus { DRAFT = 0, POSTED = 1 } - - export interface PayslipSummary { - - /** The Xero identifier for an employee */ - EmployeeID?: string | null; - - /** Xero identifier for the payslip */ - PayslipID?: string | null; - - /** First name of employee */ - FirstName?: string | null; - - /** Last name of employee */ - LastName?: string | null; - - /** Employee group name */ - EmployeeGroup?: string | null; - - /** - * The Wages for the Payslip - * Type: double - */ - Wages?: number | null; - - /** - * The Deductions for the Payslip - * Type: double - */ - Deductions?: number | null; - - /** - * The Tax for the Payslip - * Type: double - */ - Tax?: number | null; - - /** - * The Super for the Payslip - * Type: double - */ - Super?: number | null; - - /** - * The Reimbursements for the Payslip - * Type: double - */ - Reimbursements?: number | null; - - /** - * The NetPay for the Payslip - * Type: double - */ - NetPay?: number | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - - export interface PayslipLines { - EarningsLines?: Array; - LeaveEarningsLines?: Array; - TimesheetEarningsLines?: Array; - DeductionLines?: Array; - LeaveAccrualLines?: Array; - ReimbursementLines?: Array; - SuperannuationLines?: Array; - TaxLines?: Array; - } - - export interface LeaveEarningsLine { - - /** Xero identifier */ - EarningsRateID?: string | null; - - /** - * Rate per unit of the EarningsLine. - * Type: double - */ - RatePerUnit?: number | null; - - /** - * Earnings rate number of units. - * Type: double - */ - NumberOfUnits?: number | null; - } - - export interface LeaveAccrualLine { - - /** Xero identifier for the Leave type. */ - LeaveTypeID?: string | null; - - /** - * Leave Accrual number of units - * Type: double - */ - NumberOfUnits?: number | null; - - /** If you want to auto calculate leave. */ - AutoCalculate?: boolean | null; - } - - export interface SuperannuationLine { - - /** Xero identifier for payroll super fund membership ID. */ - SuperMembershipID?: string | null; - ContributionType?: SuperLineContributionType | null; - CalculationType?: SuperLineCalculationType | null; - - /** - * Superannuation minimum monthly earnings. - * Type: double - */ - MinimumMonthlyEarnings?: number | null; - - /** Superannuation expense account code. */ - ExpenseAccountCode?: string | null; - - /** Superannuation liability account code */ - LiabilityAccountCode?: string | null; - - /** Superannuation payment date for the current period (YYYY-MM-DD) */ - PaymentDateForThisPeriod?: string | null; - - /** - * Superannuation percentage - * Type: double - */ - Percentage?: number | null; - - /** - * Superannuation amount - * Type: double - */ - Amount?: number | null; - } - - export interface TaxLine { - - /** Xero identifier for payslip tax line ID. */ - PayslipTaxLineID?: string | null; - - /** - * The tax line amount - * Type: double - */ - Amount?: number | null; - - /** Name of the tax type. */ - TaxTypeName?: string | null; - - /** Description of the tax line. */ - Description?: string | null; - ManualTaxType?: TaxLineManualTaxType | null; - - /** The tax line liability account code. For posted pay run you should be able to see liability account code */ - LiabilityAccount?: string | null; - } - - export enum TaxLineManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } - - export interface PayslipObject { - Payslip?: Payslip; - } - - export interface Payslip { - - /** The Xero identifier for an employee */ - EmployeeID?: string | null; - - /** Xero identifier for the payslip */ - PayslipID?: string | null; - - /** First name of employee */ - FirstName?: string | null; - - /** Last name of employee */ - LastName?: string | null; - - /** - * The Wages for the Payslip - * Type: double - */ - Wages?: number | null; - - /** - * The Deductions for the Payslip - * Type: double - */ - Deductions?: number | null; - - /** - * The Tax for the Payslip - * Type: double - */ - Tax?: number | null; - - /** - * The Super for the Payslip - * Type: double - */ - Super?: number | null; - - /** - * The Reimbursements for the Payslip - * Type: double - */ - Reimbursements?: number | null; - - /** - * The NetPay for the Payslip - * Type: double - */ - NetPay?: number | null; - EarningsLines?: Array; - LeaveEarningsLines?: Array; - TimesheetEarningsLines?: Array; - DeductionLines?: Array; - LeaveAccrualLines?: Array; - ReimbursementLines?: Array; - SuperannuationLines?: Array; - TaxLines?: Array; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - } - - export interface Payslips { - Payslips1?: Array; - } - - export interface SettingsObject { - Settings?: Settings; - } - - export interface Settings { - - /** Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. */ - Accounts?: Array; - - /** Tracking categories for Employees and Timesheets */ - TrackingCategories?: SettingsTrackingCategories; - - /** - * Number of days in the Payroll year - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - DaysInPayrollYear?: number | null; - } - - export interface Account { - - /** Xero identifier for accounts */ - AccountID?: string | null; - - /** See Account Types */ - Type?: AccountType | null; - - /** Customer defined account code */ - Code?: string | null; - - /** Name of account */ - Name?: string | null; - } - - export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21, WAGESPAYABLELIABILITY = 22 } - - export interface SettingsTrackingCategories { - - /** The tracking category used for employees */ - EmployeeGroups?: SettingsTrackingCategoriesEmployeeGroups; - - /** The tracking category used for timesheets */ - TimesheetCategories?: SettingsTrackingCategoriesTimesheetCategories; - } - - export interface SettingsTrackingCategoriesEmployeeGroups { - - /** The identifier for the tracking category */ - TrackingCategoryID?: string | null; - - /** Name of the tracking category */ - TrackingCategoryName?: string | null; - } - - export interface SettingsTrackingCategoriesTimesheetCategories { - - /** The identifier for the tracking category */ - TrackingCategoryID?: string | null; - - /** Name of the tracking category */ - TrackingCategoryName?: string | null; - } - - export interface SuperFunds { - SuperFunds1?: Array; - } - - export interface SuperFund { - - /** Xero identifier for a super fund */ - SuperFundID?: string | null; - - /** Required */ - Type: SuperFundType; - - /** Name of the super fund */ - Name?: string | null; - - /** ABN of the self managed super fund */ - ABN?: string | null; - - /** BSB of the self managed super fund */ - BSB?: string | null; - - /** The account number for the self managed super fund. */ - AccountNumber?: string | null; - - /** The account name for the self managed super fund. */ - AccountName?: string | null; - - /** The electronic service address for the self managed super fund. */ - ElectronicServiceAddress?: string | null; - - /** Some funds assign a unique number to each employer */ - EmployerNumber?: string | null; - - /** The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. */ - SPIN?: string | null; - - /** The USI of the Regulated SuperFund */ - USI?: string | null; - - /** Last modified timestamp */ - UpdatedDateUTC?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum SuperFundType { REGULATED = 0, SMSF = 1 } - - export interface SuperFundProducts { - SuperFundProducts1?: Array; - } - - export interface SuperFundProduct { - - /** The ABN of the Regulated SuperFund */ - ABN?: string | null; - - /** The USI of the Regulated SuperFund */ - USI?: string | null; - - /** The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN */ - SPIN?: string | null; - - /** The name of the Regulated SuperFund */ - ProductName?: string | null; - } - - - /** The reimbursement type lines */ - export interface ReimbursementLines { - ReimbursementLines1?: Array; - } - - - /** The leave type lines */ - export interface LeaveLines { - Employee?: Array; - } - - export enum RateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } - - export enum EarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } - - export enum EmploymentTerminationPaymentType { O = 0, R = 1 } - - export enum AllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } - - export enum CalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } - - export enum EarningsRateCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } - - export enum DeductionTypeCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } - - export enum SuperannuationContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } - - export enum SuperannuationCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } - - export enum PaymentFrequencyType { WEEKLY = 0, MONTHLY = 1, FORTNIGHTLY = 2, QUARTERLY = 3, TWICEMONTHLY = 4, FOURWEEKLY = 5, YEARLY = 6 } - - export enum LeaveTypeContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } - - export enum EntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } - - export enum PayRunStatus { DRAFT = 0, POSTED = 1 } - - export enum ManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } - - export enum EmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } - - export enum TFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } - - export enum ResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } - - - /** State abbreviation for employee home address */ - export enum State { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } - - - /** The object returned for a bad request */ - export interface APIException { - - /** The error number */ - ErrorNumber?: string | null; - - /** The type of error */ - Type?: string | null; - - /** The message describing the error */ - Message?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches employees - * Get Employees - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 employees will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Employees} search results matching criteria - */ - GetEmployees(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a payroll employee - * Post Employees - * @return {Employees} A successful request - */ - CreateEmployee(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an employee by unique id - * Get Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {Employees} search results matching criteria - */ - GetEmployee(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); - } - - /** - * Update an Employee - * Update properties on a single employee - * Post Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {Employees} A successful request - */ - UpdateEmployee(EmployeeId: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Leave Applications - * Get LeaveApplications - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {LeaveApplications} search results matching criteria - */ - GetLeaveApplications(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'LeaveApplications?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a Leave Application - * Post LeaveApplications - * @return {LeaveApplications} A successful request - */ - CreateLeaveApplication(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'LeaveApplications', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an Leave Application by unique id - * Get LeaveApplications/{LeaveApplicationId} - * @param {string} LeaveApplicationId Leave Application id for single object - * @return {LeaveApplications} search results matching criteria - */ - GetLeaveApplication(LeaveApplicationId: string): Observable { - return this.http.get(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), {}); - } - - /** - * Use this method to update a Leave Application - * Post LeaveApplications/{LeaveApplicationId} - * @param {string} LeaveApplicationId Leave Application id for single object - * @return {LeaveApplications} A successful request - */ - UpdateLeaveApplication(LeaveApplicationId: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Pay Items - * Get PayItems - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayItems} search results matching criteria - */ - GetPayItems(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayItems?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a Pay Item - * Post PayItems - * @return {PayItems} A successful request - currently returns empty array for JSON - */ - CreatePayItem(requestBody: PayItem): Observable { - return this.http.post(this.baseUri + 'PayItems', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Payroll Calendars - * Get PayrollCalendars - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayrollCalendars} search results matching criteria - */ - GetPayrollCalendars(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayrollCalendars?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a Payroll Calendars - * Post PayrollCalendars - * @return {PayrollCalendars} A successful request - */ - CreatePayrollCalendar(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'PayrollCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches Payroll Calendars - * Get PayrollCalendars/{PayrollCalendarID} - * @param {string} PayrollCalendarID Payroll Calendar id for single object - * @return {PayrollCalendars} search results matching criteria - */ - GetPayrollCalendar(PayrollCalendarID: string): Observable { - return this.http.get(this.baseUri + 'PayrollCalendars/' + (PayrollCalendarID == null ? '' : encodeURIComponent(PayrollCalendarID)), {}); - } - - /** - * searches PayRuns - * Get PayRuns - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayRuns} search results matching criteria - */ - GetPayRuns(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayRuns?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a PayRun - * Post PayRuns - * @return {PayRuns} A successful request - */ - CreatePayRun(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'PayRuns', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an payrun by unique id - * Get PayRuns/{PayRunID} - * @param {string} PayRunID PayRun id for single object - * @return {PayRuns} search results matching criteria - */ - GetPayRun(PayRunID: string): Observable { - return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); - } - - /** - * Update a PayRun - * Update properties on a single PayRun - * Post PayRuns/{PayRunID} - * @param {string} PayRunID PayRun id for single object - * @return {PayRuns} A successful request - */ - UpdatePayRun(PayRunID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an payslip by unique id - * Get Payslip/{PayslipID} - * @param {string} PayslipID Payslip id for single object - * @return {PayslipObject} search results matching criteria - */ - GetPayslip(PayslipID: string): Observable { - return this.http.get(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); - } - - /** - * Update a Payslip - * Update lines on a single payslips - * Post Payslip/{PayslipID} - * @param {string} PayslipID Payslip id for single object - * @return {Payslips} A successful request - currently returns empty array for JSON - */ - UpdatePayslip(PayslipID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve settings - * Get Settings - * @return {SettingsObject} payroll settings - */ - GetSettings(): Observable { - return this.http.get(this.baseUri + 'Settings', {}); - } - - /** - * searches SuperFunds - * Get Superfunds - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {SuperFunds} search results matching criteria - */ - GetSuperfunds(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Superfunds?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a super fund - * Post Superfunds - * @return {SuperFunds} A successful request - */ - CreateSuperfund(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Superfunds', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an Superfund by unique id - * Get Superfunds/{SuperFundID} - * @param {string} SuperFundID Superfund id for single object - * @return {SuperFunds} search results matching criteria - */ - GetSuperfund(SuperFundID: string): Observable { - return this.http.get(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), {}); - } - - /** - * Update a Superfund - * Update properties on a single Superfund - * Post Superfunds/{SuperFundID} - * @param {string} SuperFundID Superfund id for single object - * @return {SuperFunds} A successful request - */ - UpdateSuperfund(SuperFundID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches SuperfundProducts - * Get SuperfundProducts - * @param {string} ABN The ABN of the Regulated SuperFund - * @param {string} USI The USI of the Regulated SuperFund - * @return {SuperFundProducts} search results matching criteria - */ - GetSuperfundProducts(ABN: string | null | undefined, USI: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'SuperfundProducts?ABN=' + (ABN == null ? '' : encodeURIComponent(ABN)) + '&USI=' + (USI == null ? '' : encodeURIComponent(USI)), {}); - } - - /** - * searches timesheets - * Get Timesheets - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 – Up to 100 timesheets will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Timesheets} search results matching criteria - */ - GetTimesheets(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Timesheets?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Use this method to create a timesheet - * Post Timesheets - * @return {Timesheets} A successful request - */ - CreateTimesheet(requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches for an timesheet by unique id - * Get Timesheets/{TimesheetID} - * @param {string} TimesheetID Timesheet id for single object - * @return {TimesheetObject} search results matching criteria - */ - GetTimesheet(TimesheetID: string): Observable { - return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); - } - - /** - * Update a Timesheet - * Update properties on a single timesheet - * Post Timesheets/{TimesheetID} - * @param {string} TimesheetID Timesheet id for single object - * @return {Timesheets} A successful request - */ - UpdateTimesheet(TimesheetID: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Employees { + Employees1?: Array; + } + + export interface Employee { + + /** + * First name of employee + * Required + */ + FirstName: string; + + /** + * Last name of employee + * Required + */ + LastName: string; + + /** + * Date of birth of the employee (YYYY-MM-DD) + * Required + */ + DateOfBirth: string; + HomeAddress?: HomeAddress; + + /** Start date for an employee (YYYY-MM-DD) */ + StartDate?: string | null; + + /** Title of the employee */ + Title?: string | null; + + /** Middle name(s) of the employee */ + MiddleNames?: string | null; + + /** The email address for the employee */ + Email?: string | null; + + /** The employee’s gender. See Employee Gender */ + Gender?: EmployeeGender | null; + + /** Employee phone number */ + Phone?: string | null; + + /** Employee mobile number */ + Mobile?: string | null; + + /** Employee’s twitter name */ + TwitterUserName?: string | null; + + /** Authorised to approve other employees' leave requests */ + IsAuthorisedToApproveLeave?: boolean | null; + + /** Authorised to approve timesheets */ + IsAuthorisedToApproveTimesheets?: boolean | null; + + /** JobTitle of the employee */ + JobTitle?: string | null; + + /** Employees classification */ + Classification?: string | null; + + /** Xero unique identifier for earnings rate */ + OrdinaryEarningsRateID?: string | null; + + /** Xero unique identifier for payroll calendar for the employee */ + PayrollCalendarID?: string | null; + + /** The Employee Group allows you to report on payroll expenses and liabilities for each group of employees */ + EmployeeGroupName?: string | null; + + /** Xero unique identifier for an Employee */ + EmployeeID?: string | null; + + /** Employee Termination Date (YYYY-MM-DD) */ + TerminationDate?: string | null; + BankAccounts?: Array; + PayTemplate?: PayTemplate; + OpeningBalances?: OpeningBalances; + TaxDeclaration?: TaxDeclaration; + LeaveBalances?: Array; + LeaveLines?: Array; + SuperMemberships?: Array; + + /** Employee Status Types */ + Status?: EmployeeStatus | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface HomeAddress { + + /** + * Address line 1 for employee home address + * Required + */ + AddressLine1: string; + + /** Address line 2 for employee home address */ + AddressLine2?: string | null; + + /** Suburb for employee home address */ + City?: string | null; + + /** State abbreviation for employee home address */ + Region?: HomeAddressRegion | null; + + /** PostCode for employee home address */ + PostalCode?: string | null; + + /** Country of HomeAddress */ + Country?: string | null; + } + + export enum HomeAddressRegion { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } + + export enum EmployeeGender { N = 0, M = 1, F = 2, I = 3 } + + export interface BankAccount { + + /** The text that will appear on your employee's bank statement when they receive payment */ + StatementText?: string | null; + + /** The name of the account */ + AccountName?: string | null; + + /** The BSB number of the account */ + BSB?: string | null; + + /** The account number */ + AccountNumber?: string | null; + + /** If this account is the Remaining bank account */ + Remainder?: boolean | null; + + /** + * Fixed amounts (for example, if an employee wants to have $100 of their salary transferred to one account, and the remaining amount to another) + * Type: double + */ + Amount?: number | null; + } + + export interface PayTemplate { + EarningsLines?: Array; + DeductionLines?: Array; + SuperLines?: Array; + ReimbursementLines?: Array; + LeaveLines?: Array; + } + + export interface EarningsLine { + + /** + * Xero unique id for earnings rate + * Required + */ + EarningsRateID: string; + + /** Required */ + CalculationType: EarningsLineCalculationType; + + /** + * Annual salary for earnings line + * Type: double + */ + AnnualSalary?: number | null; + + /** + * number of units for earning line + * Type: double + */ + NumberOfUnitsPerWeek?: number | null; + + /** + * Rate per unit of the EarningsLine. + * Type: double + */ + RatePerUnit?: number | null; + + /** + * Normal number of units for EarningsLine. Applicable when RateType is "MULTIPLE" + * Type: double + */ + NormalNumberOfUnits?: number | null; + + /** + * Earnings rate amount + * Type: double + */ + Amount?: number | null; + + /** + * Earnings rate number of units. + * Type: double + */ + NumberOfUnits?: number | null; + + /** + * Earnings rate amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + FixedAmount?: number | null; + } + + export enum EarningsLineCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } + + export interface DeductionLine { + + /** + * Xero deduction type identifier + * Required + */ + DeductionTypeID: string; + + /** Required */ + CalculationType: DeductionLineCalculationType; + + /** + * Deduction type amount + * Type: double + */ + Amount?: number | null; + + /** + * The Percentage of the Deduction + * Type: double + */ + Percentage?: number | null; + + /** + * Deduction number of units + * Type: double + */ + NumberOfUnits?: number | null; + } + + export enum DeductionLineCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } + + export interface SuperLine { + + /** Xero super membership ID */ + SuperMembershipID?: string | null; + ContributionType?: SuperLineContributionType | null; + CalculationType?: SuperLineCalculationType | null; + + /** + * amount of mimimum earnings + * Type: double + */ + MinimumMonthlyEarnings?: number | null; + + /** expense account code */ + ExpenseAccountCode?: string | null; + + /** liabilty account code */ + LiabilityAccountCode?: string | null; + + /** + * percentage for super line + * Type: double + */ + Percentage?: number | null; + + /** + * Super membership amount + * Type: double + */ + Amount?: number | null; + } + + export enum SuperLineContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } + + export enum SuperLineCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } + + export interface ReimbursementLine { + + /** Xero reimbursement type identifier */ + ReimbursementTypeID?: string | null; + + /** + * Reimbursement type amount + * Type: double + */ + Amount?: number | null; + + /** + * Reimbursement lines description (max length 50) + * Max length: 50 + */ + Description?: string | null; + + /** Reimbursement expense account. For posted pay run you should be able to see expense account code. */ + ExpenseAccount?: string | null; + } + + export interface LeaveLine { + + /** Xero leave type identifier */ + LeaveTypeID?: string | null; + + /** Calculation type for leave line for Opening Balance on Employee */ + CalculationType?: LeaveLineCalculationType | null; + EntitlementFinalPayPayoutType?: LeaveLineEntitlementFinalPayPayoutType | null; + EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; + + /** amount of leave line */ + IncludeSuperannuationGuaranteeContribution?: boolean | null; + + /** + * Leave number of units + * Type: double + */ + NumberOfUnits?: number | null; + } + + export enum LeaveLineCalculationType { NOCALCULATIONREQUIRED = 0, FIXEDAMOUNTEACHPERIOD = 1, ENTERRATEINPAYTEMPLATE = 2, BASEDONORDINARYEARNINGS = 3, '' = 4 } + + export enum LeaveLineEntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } + + export enum LeaveLineEmploymentTerminationPaymentType { O = 0, R = 1 } + + export interface OpeningBalances { + + /** Opening Balance Date. (YYYY-MM-DD) */ + OpeningBalanceDate?: string | null; + + /** Opening Balance tax */ + Tax?: string | null; + EarningsLines?: Array; + DeductionLines?: Array; + SuperLines?: Array; + ReimbursementLines?: Array; + LeaveLines?: Array; + } + + export interface TaxDeclaration { + + /** + * Address line 1 for employee home address + * Required + */ + EmployeeID: string; + + /** Required */ + EmploymentBasis: TaxDeclarationEmploymentBasis; + TFNExemptionType?: TaxDeclarationTFNExemptionType | null; + + /** The tax file number e.g 123123123. */ + TaxFileNumber?: string | null; + + /** If the employee is Australian resident for tax purposes. e.g true or false */ + AustralianResidentForTaxPurposes?: boolean | null; + ResidencyStatus?: TaxDeclarationResidencyStatus | null; + + /** If tax free threshold claimed. e.g true or false */ + TaxFreeThresholdClaimed?: boolean | null; + + /** If has tax offset estimated then the tax offset estimated amount. e.g 100 */ + TaxOffsetEstimatedAmount?: string | null; + + /** If employee has HECS or HELP debt. e.g true or false */ + HasHELPDebt?: boolean | null; + + /** If employee has financial supplement debt. e.g true or false */ + HasSFSSDebt?: boolean | null; + + /** If employee has trade support loan. e.g true or false */ + HasTradeSupportLoanDebt?: boolean | null; + + /** If the employee has requested that additional tax be withheld each pay run. e.g 50 */ + UpwardVariationTaxWithholdingAmount?: string | null; + + /** If the employee is eligible to receive an additional percentage on top of ordinary earnings when they take leave (typically 17.5%). e.g true or false */ + EligibleToReceiveLeaveLoading?: boolean | null; + + /** If the employee has approved withholding variation. e.g (0 - 100) */ + ApprovedWithholdingVariationPercentage?: string | null; + + /** If the employee is eligible for student startup loan rules */ + HasStudentStartupLoan?: boolean | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + + export enum TaxDeclarationEmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } + + export enum TaxDeclarationTFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } + + export enum TaxDeclarationResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } + + export interface LeaveBalance { + + /** The name of the leave type */ + LeaveName?: string | null; + + /** Identifier of the leave type (see PayItems) */ + LeaveTypeID?: string | null; + + /** + * The balance of the leave available + * Type: double + */ + NumberOfUnits?: number | null; + + /** The type of units as specified by the LeaveType (see PayItems) */ + TypeOfUnits?: string | null; + } + + export interface SuperMembership { + + /** Xero unique identifier for Super membership */ + SuperMembershipID?: string | null; + + /** + * Xero identifier for super fund + * Required + */ + SuperFundID: string; + + /** + * The memberhsip number assigned to the employee by the super fund. + * Required + * Type: double + */ + EmployeeNumber: number; + } + + export enum EmployeeStatus { ACTIVE = 0, TERMINATED = 1 } + + export interface ValidationError { + + /** Validation error message */ + Message?: string | null; + } + + export interface LeaveApplications { + LeaveApplications1?: Array; + } + + export interface LeaveApplication { + + /** The Xero identifier for Payroll Employee */ + LeaveApplicationID?: string | null; + + /** The Xero identifier for Payroll Employee */ + EmployeeID?: string | null; + + /** The Xero identifier for Leave Type */ + LeaveTypeID?: string | null; + + /** The title of the leave */ + Title?: string | null; + + /** Start date of the leave (YYYY-MM-DD) */ + StartDate?: string | null; + + /** End date of the leave (YYYY-MM-DD) */ + EndDate?: string | null; + + /** The Description of the Leave */ + Description?: string | null; + LeavePeriods?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface LeavePeriod { + + /** + * The Number of Units for the leave + * Type: double + */ + NumberOfUnits?: number | null; + + /** The Pay Period End Date (YYYY-MM-DD) */ + PayPeriodEndDate?: string | null; + + /** The Pay Period Start Date (YYYY-MM-DD) */ + PayPeriodStartDate?: string | null; + LeavePeriodStatus?: LeavePeriodLeavePeriodStatus | null; + } + + export enum LeavePeriodLeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } + + export enum LeavePeriodStatus { SCHEDULED = 0, PROCESSED = 1 } + + export interface PayItems { + PayItems1?: PayItem; + } + + export interface PayItem { + EarningsRates?: Array; + DeductionTypes?: Array; + LeaveTypes?: Array; + ReimbursementTypes?: Array; + } + + export interface EarningsRate { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** + * Type of units used to record earnings (max length = 50). Only When RateType is RATEPERUNIT + * Max length: 50 + */ + TypeOfUnits?: string | null; + + /** Most payments are subject to tax, so you should only set this value if you are sure that a payment is exempt from PAYG withholding */ + IsExemptFromTax?: boolean | null; + + /** See the ATO website for details of which payments are exempt from SGC */ + IsExemptFromSuper?: boolean | null; + + /** Boolean to determine if the earnings rate is reportable or exempt from W1 */ + IsReportableAsW1?: boolean | null; + EarningsType?: EarningsRateEarningsType | null; + + /** Xero identifier */ + EarningsRateID?: string | null; + RateType?: EarningsRateRateType | null; + + /** Default rate per unit (optional). Only applicable if RateType is RATEPERUNIT. */ + RatePerUnit?: string | null; + + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + * Type: double + */ + Multiplier?: number | null; + + /** Indicates that this earnings rate should accrue leave. Only applicable if RateType is MULTIPLE */ + AccrueLeave?: boolean | null; + + /** + * Optional Amount for FIXEDAMOUNT RateType EarningsRate + * Type: double + */ + Amount?: number | null; + EmploymentTerminationPaymentType?: LeaveLineEmploymentTerminationPaymentType | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + AllowanceType?: EarningsRateAllowanceType | null; + } + + export enum EarningsRateEarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } + + export enum EarningsRateRateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } + + export enum EarningsRateAllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } + + export interface DeductionType { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** Indicates that this is a pre-tax deduction that will reduce the amount of tax you withhold from an employee. */ + ReducesTax?: boolean | null; + + /** Most deductions don’t reduce your superannuation guarantee contribution liability, so typically you will not set any value for this. */ + ReducesSuper?: boolean | null; + + /** Boolean to determine if the deduction type is reportable or exempt from W1 */ + IsExemptFromW1?: boolean | null; + + /** Xero identifier */ + DeductionTypeID?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + DeductionCategory?: DeductionTypeDeductionCategory | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + } + + export enum DeductionTypeDeductionCategory { NONE = 0, UNIONFEES = 1, WORKPLACEGIVING = 2 } + + export interface LeaveType { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** The type of units by which leave entitlements are normally tracked. These are typically the same as the type of units used for the employee’s ordinary earnings rate */ + TypeOfUnits?: string | null; + + /** Xero identifier */ + LeaveTypeID?: string | null; + + /** + * The number of units the employee is entitled to each year + * Type: double + */ + NormalEntitlement?: number | null; + + /** + * Enter an amount here if your organisation pays an additional percentage on top of ordinary earnings when your employees take leave (typically 17.5%) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + LeaveLoadingRate?: number | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Set this to indicate that an employee will be paid when taking this type of leave */ + IsPaidLeave?: boolean | null; + + /** Set this if you want a balance for this leave type to be shown on your employee’s payslips */ + ShowOnPayslip?: boolean | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + } + + export interface ReimbursementType { + + /** + * Name of the earnings rate (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** Xero identifier */ + ReimbursementTypeID?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Is the current record */ + CurrentRecord?: boolean | null; + } + + export interface PayrollCalendars { + PayrollCalendars1?: Array; + } + + export interface PayrollCalendar { + + /** Name of the Payroll Calendar */ + Name?: string | null; + CalendarType?: PayrollCalendarCalendarType | null; + + /** The start date of the upcoming pay period. The end date will be calculated based upon this date, and the calendar type selected (YYYY-MM-DD) */ + StartDate?: string | null; + + /** The date on which employees will be paid for the upcoming pay period (YYYY-MM-DD) */ + PaymentDate?: string | null; + + /** Xero identifier */ + PayrollCalendarID?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum PayrollCalendarCalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } + + export interface Timesheets { + Timesheets1?: Array; + } + + export interface Timesheet { + + /** + * The Xero identifier for an employee + * Required + */ + EmployeeID: string; + + /** + * Period start date (YYYY-MM-DD) + * Required + */ + StartDate: string; + + /** + * Period end date (YYYY-MM-DD) + * Required + */ + EndDate: string; + Status?: TimesheetStatus | null; + + /** + * Timesheet total hours + * Type: double + */ + Hours?: number | null; + + /** The Xero identifier for a Payroll Timesheet */ + TimesheetID?: string | null; + TimesheetLines?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum TimesheetStatus { DRAFT = 0, PROCESSED = 1, APPROVED = 2 } + + export interface TimesheetLine { + + /** The Xero identifier for an Earnings Rate */ + EarningsRateID?: string | null; + + /** The Xero identifier for a Tracking Category. The TrackingOptionID must belong to the TrackingCategory selected as TimesheetCategories under Payroll Settings. */ + TrackingItemID?: string | null; + + /** The number of units on a timesheet line */ + NumberOfUnits?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + + export interface TimesheetObject { + Timesheet?: Timesheet; + } + + export interface PayRuns { + PayRuns1?: Array; + } + + export interface PayRun { + + /** + * Xero identifier for pay run + * Required + */ + PayrollCalendarID: string; + + /** Xero identifier for pay run */ + PayRunID?: string | null; + + /** Period Start Date for the PayRun (YYYY-MM-DD) */ + PayRunPeriodStartDate?: string | null; + + /** Period End Date for the PayRun (YYYY-MM-DD) */ + PayRunPeriodEndDate?: string | null; + PayRunStatus?: PayRunPayRunStatus | null; + + /** Payment Date for the PayRun (YYYY-MM-DD) */ + PaymentDate?: string | null; + + /** Payslip message for the PayRun */ + PayslipMessage?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** The payslips in the payrun */ + Payslips?: Array; + + /** + * The total Wages for the Payrun + * Type: double + */ + Wages?: number | null; + + /** + * The total Deductions for the Payrun + * Type: double + */ + Deductions?: number | null; + + /** + * The total Tax for the Payrun + * Type: double + */ + Tax?: number | null; + + /** + * The total Super for the Payrun + * Type: double + */ + Super?: number | null; + + /** + * The total Reimbursements for the Payrun + * Type: double + */ + Reimbursement?: number | null; + + /** + * The total NetPay for the Payrun + * Type: double + */ + NetPay?: number | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum PayRunPayRunStatus { DRAFT = 0, POSTED = 1 } + + export interface PayslipSummary { + + /** The Xero identifier for an employee */ + EmployeeID?: string | null; + + /** Xero identifier for the payslip */ + PayslipID?: string | null; + + /** First name of employee */ + FirstName?: string | null; + + /** Last name of employee */ + LastName?: string | null; + + /** Employee group name */ + EmployeeGroup?: string | null; + + /** + * The Wages for the Payslip + * Type: double + */ + Wages?: number | null; + + /** + * The Deductions for the Payslip + * Type: double + */ + Deductions?: number | null; + + /** + * The Tax for the Payslip + * Type: double + */ + Tax?: number | null; + + /** + * The Super for the Payslip + * Type: double + */ + Super?: number | null; + + /** + * The Reimbursements for the Payslip + * Type: double + */ + Reimbursements?: number | null; + + /** + * The NetPay for the Payslip + * Type: double + */ + NetPay?: number | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + + export interface PayslipLines { + EarningsLines?: Array; + LeaveEarningsLines?: Array; + TimesheetEarningsLines?: Array; + DeductionLines?: Array; + LeaveAccrualLines?: Array; + ReimbursementLines?: Array; + SuperannuationLines?: Array; + TaxLines?: Array; + } + + export interface LeaveEarningsLine { + + /** Xero identifier */ + EarningsRateID?: string | null; + + /** + * Rate per unit of the EarningsLine. + * Type: double + */ + RatePerUnit?: number | null; + + /** + * Earnings rate number of units. + * Type: double + */ + NumberOfUnits?: number | null; + } + + export interface LeaveAccrualLine { + + /** Xero identifier for the Leave type. */ + LeaveTypeID?: string | null; + + /** + * Leave Accrual number of units + * Type: double + */ + NumberOfUnits?: number | null; + + /** If you want to auto calculate leave. */ + AutoCalculate?: boolean | null; + } + + export interface SuperannuationLine { + + /** Xero identifier for payroll super fund membership ID. */ + SuperMembershipID?: string | null; + ContributionType?: SuperLineContributionType | null; + CalculationType?: SuperLineCalculationType | null; + + /** + * Superannuation minimum monthly earnings. + * Type: double + */ + MinimumMonthlyEarnings?: number | null; + + /** Superannuation expense account code. */ + ExpenseAccountCode?: string | null; + + /** Superannuation liability account code */ + LiabilityAccountCode?: string | null; + + /** Superannuation payment date for the current period (YYYY-MM-DD) */ + PaymentDateForThisPeriod?: string | null; + + /** + * Superannuation percentage + * Type: double + */ + Percentage?: number | null; + + /** + * Superannuation amount + * Type: double + */ + Amount?: number | null; + } + + export interface TaxLine { + + /** Xero identifier for payslip tax line ID. */ + PayslipTaxLineID?: string | null; + + /** + * The tax line amount + * Type: double + */ + Amount?: number | null; + + /** Name of the tax type. */ + TaxTypeName?: string | null; + + /** Description of the tax line. */ + Description?: string | null; + ManualTaxType?: TaxLineManualTaxType | null; + + /** The tax line liability account code. For posted pay run you should be able to see liability account code */ + LiabilityAccount?: string | null; + } + + export enum TaxLineManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } + + export interface PayslipObject { + Payslip?: Payslip; + } + + export interface Payslip { + + /** The Xero identifier for an employee */ + EmployeeID?: string | null; + + /** Xero identifier for the payslip */ + PayslipID?: string | null; + + /** First name of employee */ + FirstName?: string | null; + + /** Last name of employee */ + LastName?: string | null; + + /** + * The Wages for the Payslip + * Type: double + */ + Wages?: number | null; + + /** + * The Deductions for the Payslip + * Type: double + */ + Deductions?: number | null; + + /** + * The Tax for the Payslip + * Type: double + */ + Tax?: number | null; + + /** + * The Super for the Payslip + * Type: double + */ + Super?: number | null; + + /** + * The Reimbursements for the Payslip + * Type: double + */ + Reimbursements?: number | null; + + /** + * The NetPay for the Payslip + * Type: double + */ + NetPay?: number | null; + EarningsLines?: Array; + LeaveEarningsLines?: Array; + TimesheetEarningsLines?: Array; + DeductionLines?: Array; + LeaveAccrualLines?: Array; + ReimbursementLines?: Array; + SuperannuationLines?: Array; + TaxLines?: Array; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + } + + export interface Payslips { + Payslips1?: Array; + } + + export interface SettingsObject { + Settings?: Settings; + } + + export interface Settings { + + /** Payroll Account details for SuperExpense, SuperLiabilty, WagesExpense, PAYGLiability & WagesPayable. */ + Accounts?: Array; + + /** Tracking categories for Employees and Timesheets */ + TrackingCategories?: SettingsTrackingCategories; + + /** + * Number of days in the Payroll year + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + DaysInPayrollYear?: number | null; + } + + export interface Account { + + /** Xero identifier for accounts */ + AccountID?: string | null; + + /** See Account Types */ + Type?: AccountType | null; + + /** Customer defined account code */ + Code?: string | null; + + /** Name of account */ + Name?: string | null; + } + + export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21, WAGESPAYABLELIABILITY = 22 } + + export interface SettingsTrackingCategories { + + /** The tracking category used for employees */ + EmployeeGroups?: SettingsTrackingCategoriesEmployeeGroups; + + /** The tracking category used for timesheets */ + TimesheetCategories?: SettingsTrackingCategoriesTimesheetCategories; + } + + export interface SettingsTrackingCategoriesEmployeeGroups { + + /** The identifier for the tracking category */ + TrackingCategoryID?: string | null; + + /** Name of the tracking category */ + TrackingCategoryName?: string | null; + } + + export interface SettingsTrackingCategoriesTimesheetCategories { + + /** The identifier for the tracking category */ + TrackingCategoryID?: string | null; + + /** Name of the tracking category */ + TrackingCategoryName?: string | null; + } + + export interface SuperFunds { + SuperFunds1?: Array; + } + + export interface SuperFund { + + /** Xero identifier for a super fund */ + SuperFundID?: string | null; + + /** Required */ + Type: SuperFundType; + + /** Name of the super fund */ + Name?: string | null; + + /** ABN of the self managed super fund */ + ABN?: string | null; + + /** BSB of the self managed super fund */ + BSB?: string | null; + + /** The account number for the self managed super fund. */ + AccountNumber?: string | null; + + /** The account name for the self managed super fund. */ + AccountName?: string | null; + + /** The electronic service address for the self managed super fund. */ + ElectronicServiceAddress?: string | null; + + /** Some funds assign a unique number to each employer */ + EmployerNumber?: string | null; + + /** The SPIN of the Regulated SuperFund. This field has been deprecated. It will only be present for legacy superfunds. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN. */ + SPIN?: string | null; + + /** The USI of the Regulated SuperFund */ + USI?: string | null; + + /** Last modified timestamp */ + UpdatedDateUTC?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum SuperFundType { REGULATED = 0, SMSF = 1 } + + export interface SuperFundProducts { + SuperFundProducts1?: Array; + } + + export interface SuperFundProduct { + + /** The ABN of the Regulated SuperFund */ + ABN?: string | null; + + /** The USI of the Regulated SuperFund */ + USI?: string | null; + + /** The SPIN of the Regulated SuperFund. This field has been deprecated. New superfunds will not have a SPIN value. The USI field should be used instead of SPIN */ + SPIN?: string | null; + + /** The name of the Regulated SuperFund */ + ProductName?: string | null; + } + + + /** The reimbursement type lines */ + export interface ReimbursementLines { + ReimbursementLines1?: Array; + } + + + /** The leave type lines */ + export interface LeaveLines { + Employee?: Array; + } + + export enum RateType { FIXEDAMOUNT = 0, MULTIPLE = 1, RATEPERUNIT = 2 } + + export enum EarningsType { FIXED = 0, ORDINARYTIMEEARNINGS = 1, OVERTIMEEARNINGS = 2, ALLOWANCE = 3, LUMPSUMD = 4, EMPLOYMENTTERMINATIONPAYMENT = 5, LUMPSUMA = 6, LUMPSUMB = 7 } + + export enum EmploymentTerminationPaymentType { O = 0, R = 1 } + + export enum AllowanceType { CAR = 0, TRANSPORT = 1, TRAVEL = 2, LAUNDRY = 3, MEALS = 4, JOBKEEPER = 5, OTHER = 6 } + + export enum CalendarType { WEEKLY = 0, FORTNIGHTLY = 1, FOURWEEKLY = 2, MONTHLY = 3, TWICEMONTHLY = 4, QUARTERLY = 5 } + + export enum EarningsRateCalculationType { USEEARNINGSRATE = 0, ENTEREARNINGSRATE = 1, ANNUALSALARY = 2 } + + export enum DeductionTypeCalculationType { FIXEDAMOUNT = 0, PRETAX = 1, POSTTAX = 2 } + + export enum SuperannuationContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } + + export enum SuperannuationCalculationType { FIXEDAMOUNT = 0, PERCENTAGEOFEARNINGS = 1, STATUTORY = 2 } + + export enum PaymentFrequencyType { WEEKLY = 0, MONTHLY = 1, FORTNIGHTLY = 2, QUARTERLY = 3, TWICEMONTHLY = 4, FOURWEEKLY = 5, YEARLY = 6 } + + export enum LeaveTypeContributionType { SGC = 0, SALARYSACRIFICE = 1, EMPLOYERADDITIONAL = 2, EMPLOYEE = 3 } + + export enum EntitlementFinalPayPayoutType { NOTPAIDOUT = 0, PAIDOUT = 1 } + + export enum PayRunStatus { DRAFT = 0, POSTED = 1 } + + export enum ManualTaxType { PAYGMANUAL = 0, ETPOMANUAL = 1, ETPRMANUAL = 2 } + + export enum EmploymentBasis { FULLTIME = 0, PARTTIME = 1, CASUAL = 2, LABOURHIRE = 3, SUPERINCOMESTREAM = 4 } + + export enum TFNExemptionType { NOTQUOTED = 0, PENDING = 1, PENSIONER = 2, UNDER18 = 3 } + + export enum ResidencyStatus { AUSTRALIANRESIDENT = 0, FOREIGNRESIDENT = 1, WORKINGHOLIDAYMAKER = 2 } + + + /** State abbreviation for employee home address */ + export enum State { ACT = 0, NSW = 1, NT = 2, QLD = 3, SA = 4, TAS = 5, VIC = 6, WA = 7 } + + + /** The object returned for a bad request */ + export interface APIException { + + /** The error number */ + ErrorNumber?: string | null; + + /** The type of error */ + Type?: string | null; + + /** The message describing the error */ + Message?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches employees + * Get Employees + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 employees will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Employees} search results matching criteria + */ + GetEmployees(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a payroll employee + * Post Employees + * @return {Employees} A successful request + */ + CreateEmployee(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an employee by unique id + * Get Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {Employees} search results matching criteria + */ + GetEmployee(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); + } + + /** + * Update an Employee + * Update properties on a single employee + * Post Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {Employees} A successful request + */ + UpdateEmployee(EmployeeId: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Leave Applications + * Get LeaveApplications + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {LeaveApplications} search results matching criteria + */ + GetLeaveApplications(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'LeaveApplications?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a Leave Application + * Post LeaveApplications + * @return {LeaveApplications} A successful request + */ + CreateLeaveApplication(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'LeaveApplications', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an Leave Application by unique id + * Get LeaveApplications/{LeaveApplicationId} + * @param {string} LeaveApplicationId Leave Application id for single object + * @return {LeaveApplications} search results matching criteria + */ + GetLeaveApplication(LeaveApplicationId: string): Observable { + return this.http.get(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), {}); + } + + /** + * Use this method to update a Leave Application + * Post LeaveApplications/{LeaveApplicationId} + * @param {string} LeaveApplicationId Leave Application id for single object + * @return {LeaveApplications} A successful request + */ + UpdateLeaveApplication(LeaveApplicationId: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'LeaveApplications/' + (LeaveApplicationId == null ? '' : encodeURIComponent(LeaveApplicationId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Pay Items + * Get PayItems + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayItems} search results matching criteria + */ + GetPayItems(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayItems?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a Pay Item + * Post PayItems + * @return {PayItems} A successful request - currently returns empty array for JSON + */ + CreatePayItem(requestBody: PayItem): Observable { + return this.http.post(this.baseUri + 'PayItems', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Payroll Calendars + * Get PayrollCalendars + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 objects will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayrollCalendars} search results matching criteria + */ + GetPayrollCalendars(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayrollCalendars?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a Payroll Calendars + * Post PayrollCalendars + * @return {PayrollCalendars} A successful request + */ + CreatePayrollCalendar(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'PayrollCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches Payroll Calendars + * Get PayrollCalendars/{PayrollCalendarID} + * @param {string} PayrollCalendarID Payroll Calendar id for single object + * @return {PayrollCalendars} search results matching criteria + */ + GetPayrollCalendar(PayrollCalendarID: string): Observable { + return this.http.get(this.baseUri + 'PayrollCalendars/' + (PayrollCalendarID == null ? '' : encodeURIComponent(PayrollCalendarID)), {}); + } + + /** + * searches PayRuns + * Get PayRuns + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 PayRuns will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayRuns} search results matching criteria + */ + GetPayRuns(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayRuns?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a PayRun + * Post PayRuns + * @return {PayRuns} A successful request + */ + CreatePayRun(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'PayRuns', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an payrun by unique id + * Get PayRuns/{PayRunID} + * @param {string} PayRunID PayRun id for single object + * @return {PayRuns} search results matching criteria + */ + GetPayRun(PayRunID: string): Observable { + return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); + } + + /** + * Update a PayRun + * Update properties on a single PayRun + * Post PayRuns/{PayRunID} + * @param {string} PayRunID PayRun id for single object + * @return {PayRuns} A successful request + */ + UpdatePayRun(PayRunID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an payslip by unique id + * Get Payslip/{PayslipID} + * @param {string} PayslipID Payslip id for single object + * @return {PayslipObject} search results matching criteria + */ + GetPayslip(PayslipID: string): Observable { + return this.http.get(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); + } + + /** + * Update a Payslip + * Update lines on a single payslips + * Post Payslip/{PayslipID} + * @param {string} PayslipID Payslip id for single object + * @return {Payslips} A successful request - currently returns empty array for JSON + */ + UpdatePayslip(PayslipID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Payslip/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve settings + * Get Settings + * @return {SettingsObject} payroll settings + */ + GetSettings(): Observable { + return this.http.get(this.baseUri + 'Settings', {}); + } + + /** + * searches SuperFunds + * Get Superfunds + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 SuperFunds will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {SuperFunds} search results matching criteria + */ + GetSuperfunds(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Superfunds?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a super fund + * Post Superfunds + * @return {SuperFunds} A successful request + */ + CreateSuperfund(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Superfunds', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an Superfund by unique id + * Get Superfunds/{SuperFundID} + * @param {string} SuperFundID Superfund id for single object + * @return {SuperFunds} search results matching criteria + */ + GetSuperfund(SuperFundID: string): Observable { + return this.http.get(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), {}); + } + + /** + * Update a Superfund + * Update properties on a single Superfund + * Post Superfunds/{SuperFundID} + * @param {string} SuperFundID Superfund id for single object + * @return {SuperFunds} A successful request + */ + UpdateSuperfund(SuperFundID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Superfunds/' + (SuperFundID == null ? '' : encodeURIComponent(SuperFundID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches SuperfundProducts + * Get SuperfundProducts + * @param {string} ABN The ABN of the Regulated SuperFund + * @param {string} USI The USI of the Regulated SuperFund + * @return {SuperFundProducts} search results matching criteria + */ + GetSuperfundProducts(ABN: string | null | undefined, USI: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'SuperfundProducts?ABN=' + (ABN == null ? '' : encodeURIComponent(ABN)) + '&USI=' + (USI == null ? '' : encodeURIComponent(USI)), {}); + } + + /** + * searches timesheets + * Get Timesheets + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 – Up to 100 timesheets will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Timesheets} search results matching criteria + */ + GetTimesheets(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Timesheets?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Use this method to create a timesheet + * Post Timesheets + * @return {Timesheets} A successful request + */ + CreateTimesheet(requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches for an timesheet by unique id + * Get Timesheets/{TimesheetID} + * @param {string} TimesheetID Timesheet id for single object + * @return {TimesheetObject} search results matching criteria + */ + GetTimesheet(TimesheetID: string): Observable { + return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); + } + + /** + * Update a Timesheet + * Update properties on a single timesheet + * Post Timesheets/{TimesheetID} + * @param {string} TimesheetID Timesheet id for single object + * @return {Timesheets} A successful request + */ + UpdateTimesheet(TimesheetID: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/xero-payroll-uk.txt b/Tests/SwagTsTests/NG2Results/xero-payroll-uk.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/xero-payroll-uk.txt rename to Tests/SwagTsTests/NG2Results/xero-payroll-uk.ts index 3a6f56bc..0d92e773 100644 --- a/Tests/SwagTsTests/NG2Results/xero-payroll-uk.txt +++ b/Tests/SwagTsTests/NG2Results/xero-payroll-uk.ts @@ -1,2560 +1,2560 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Pagination { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - page?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageSize?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageCount?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - itemCount?: number | null; - } - - - /** The object returned for a bad request */ - export interface Problem { - - /** The type of error format */ - type?: string | null; - - /** The type of the error */ - title?: string | null; - - /** The error status code */ - status?: string | null; - - /** A description of the error */ - detail?: string | null; - instance?: string | null; - invalidFields?: Array; - } - - export interface InvalidField { - - /** The name of the field that caused the error */ - name?: string | null; - - /** The reason the error occurred */ - reason?: string | null; - } - - export interface Employees { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - employees?: Array; - } - - export interface Employee { - - /** Xero unique identifier for the employee */ - employeeID?: string | null; - - /** Title of the employee */ - title?: string | null; - - /** First name of employee */ - firstName?: string | null; - - /** Last name of employee */ - lastName?: string | null; - - /** - * Date of birth of the employee (YYYY-MM-DD) - * Type: DateOnly - */ - dateOfBirth?: Date | null; - address?: Address; - - /** The email address for the employee */ - email?: string | null; - - /** The employee’s gender */ - gender?: EmployeeGender | null; - - /** Employee phone number */ - phoneNumber?: string | null; - - /** - * Employment start date of the employee at the time it was requested - * Type: DateOnly - */ - startDate?: Date | null; - - /** - * Employment end date of the employee at the time it was requested - * Type: DateOnly - */ - endDate?: Date | null; - - /** Xero unique identifier for the payroll calendar of the employee */ - payrollCalendarID?: string | null; - - /** UTC timestamp of last update to the employee */ - updatedDateUTC?: Date | null; - - /** UTC timestamp when the employee was created in Xero */ - createdDateUTC?: Date | null; - - /** National insurance number of the employee */ - nationalInsuranceNumber?: string | null; - } - - export interface Address { - - /** - * Address line 1 for employee home address - * Required - */ - addressLine1: string; - - /** Address line 2 for employee home address */ - addressLine2?: string | null; - - /** - * Suburb for employee home address - * Required - */ - city: string; - - /** - * PostCode for employee home address - * Required - */ - postCode: string; - - /** Country of HomeAddress */ - countryName?: string | null; - } - - export enum EmployeeGender { M = 0, F = 1 } - - export interface EmployeeObject { - pagination?: Pagination; - employee?: Employee; - - /** The object returned for a bad request */ - problem?: Problem; - } - - export interface EmploymentObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - employment?: Employment; - } - - export interface Employment { - - /** Xero unique identifier for the payroll calendar of the employee */ - payrollCalendarID?: string | null; - - /** - * Start date of the employment (YYYY-MM-DD) - * Type: DateOnly - */ - startDate?: Date | null; - - /** The employment number of the employee */ - employeeNumber?: string | null; - - /** The NI Category of the employee */ - niCategory?: EmploymentNiCategory | null; - } - - export enum EmploymentNiCategory { A = 0, B = 1, C = 2, H = 3, J = 4, M = 5, Z = 6, X = 7 } - - export interface EmployeeTaxObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - employeeTax?: EmployeeTax; - } - - export interface EmployeeTax { - - /** The Starter type. */ - starterType?: string | null; - - /** Starter declaration. */ - starterDeclaration?: string | null; - - /** The Tax code. */ - taxCode?: string | null; - - /** Describes whether the tax settings is W1M1 */ - w1M1?: boolean | null; - - /** - * The previous taxable pay - * Type: double - */ - previousTaxablePay?: number | null; - - /** - * The tax amount previously paid - * Type: double - */ - previousTaxPaid?: number | null; - - /** The employee's student loan deduction type */ - studentLoanDeduction?: string | null; - - /** Describes whether the employee has post graduate loans */ - hasPostGraduateLoans?: boolean | null; - - /** Describes whether the employee is director */ - isDirector?: boolean | null; - - /** - * The directorship start date - * Type: DateOnly - */ - directorshipStartDate?: Date | null; - - /** NICs calculation method */ - nicCalculationMethod?: string | null; - } - - export interface EmployeeOpeningBalancesObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - openingBalances?: EmployeeOpeningBalances; - } - - export interface EmployeeOpeningBalances { - - /** - * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryAdoptionPay?: number | null; - - /** - * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryMaternityPay?: number | null; - - /** - * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutoryPaternityPay?: number | null; - - /** - * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutorySharedParentalPay?: number | null; - - /** - * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date - * Type: double - */ - statutorySickPay?: number | null; - - /** - * The unique employee number issued by the employee's former employer - * Type: double - */ - priorEmployeeNumber?: number | null; - } - - export interface EmployeeLeaves { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leave?: Array; - } - - export interface EmployeeLeave { - - /** The Xero identifier for LeaveType */ - leaveID?: string | null; - - /** - * The Xero identifier for LeaveType - * Required - */ - leaveTypeID: string; - - /** - * The description of the leave (max length = 50) - * Required - */ - description: string; - - /** - * Start date of the leave (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - startDate: Date; - - /** - * End date of the leave (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - endDate: Date; - - /** The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. */ - periods?: Array; - - /** UTC timestamp of last update to the leave type note */ - updatedDateUTC?: Date | null; - } - - export interface LeavePeriod { - - /** - * The Pay Period Start Date (YYYY-MM-DD) - * Type: DateOnly - */ - periodStartDate?: Date | null; - - /** - * The Pay Period End Date (YYYY-MM-DD) - * Type: DateOnly - */ - periodEndDate?: Date | null; - - /** - * The Number of Units for the leave - * Type: double - */ - numberOfUnits?: number | null; - - /** Period Status */ - periodStatus?: LeavePeriodPeriodStatus | null; - } - - export enum LeavePeriodPeriodStatus { Approved = 0, Completed = 1 } - - export interface EmployeeLeaveObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leave?: EmployeeLeave; - } - - export interface LeavePeriods { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - periods?: Array; - } - - export interface EmployeeLeaveBalances { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveBalances?: Array; - } - - export interface EmployeeLeaveBalance { - - /** Name of the leave type. */ - name?: string | null; - - /** The Xero identifier for leave type */ - leaveTypeID?: string | null; - - /** - * The employees current balance for the corresponding leave type. - * Type: double - */ - balance?: number | null; - - /** The type of the units of the leave. */ - typeOfUnits?: string | null; - } - - export interface EmployeeStatutoryLeaveBalanceObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveBalance?: EmployeeStatutoryLeaveBalance; - } - - export interface EmployeeStatutoryLeaveBalance { - - /** The type of statutory leave */ - leaveType?: EmployeeStatutoryLeaveBalanceLeaveType | null; - - /** - * The balance remaining for the corresponding leave type as of specified date. - * Type: double - */ - balanceRemaining?: number | null; - - /** The units will be "Hours" */ - units?: EmployeeStatutoryLeaveBalanceUnits | null; - } - - export enum EmployeeStatutoryLeaveBalanceLeaveType { Sick = 0, Adoption = 1, Maternity = 2, Paternity = 3, Sharedparental = 4 } - - export enum EmployeeStatutoryLeaveBalanceUnits { Hours = 0 } - - export interface EmployeeStatutoryLeavesSummaries { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutoryLeaves?: Array; - } - - export interface EmployeeStatutoryLeaveSummary { - - /** The unique identifier (guid) of a statutory leave. */ - statutoryLeaveID?: string | null; - - /** The unique identifier (guid) of the employee */ - employeeID?: string | null; - - /** The category of statutory leave */ - type?: EmployeeStatutoryLeaveBalanceLeaveType | null; - - /** - * The date when the leave starts - * Type: DateOnly - */ - startDate?: Date | null; - - /** - * The date when the leave ends - * Type: DateOnly - */ - endDate?: Date | null; - - /** Whether the leave was entitled to receive payment */ - isEntitled?: boolean | null; - - /** The status of the leave */ - status?: EmployeeStatutoryLeaveSummaryStatus | null; - } - - export enum EmployeeStatutoryLeaveSummaryStatus { Pending = 0, 'In-Progress' = 1, Completed = 2 } - - export interface EmployeeStatutorySickLeaves { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutorySickLeave?: Array; - } - - export interface EmployeeStatutorySickLeave { - - /** The unique identifier (guid) of a statutory leave */ - statutoryLeaveID?: string | null; - - /** - * The unique identifier (guid) of the employee - * Required - */ - employeeID: string; - - /** - * The unique identifier (guid) of the "Statutory Sick Leave (non-pensionable)" pay item - * Required - */ - leaveTypeID: string; - - /** - * The date when the leave starts - * Required - * Type: DateOnly - */ - startDate: Date; - - /** - * The date when the leave ends - * Required - * Type: DateOnly - */ - endDate: Date; - - /** the type of statutory leave */ - type?: string | null; - - /** the type of statutory leave */ - status?: string | null; - - /** - * The days of the work week the employee is scheduled to work at the time the leave is taken - * Required - */ - workPattern: Array; - - /** - * Whether the sick leave was pregnancy related - * Required - */ - isPregnancyRelated: boolean; - - /** - * Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request - * Required - */ - sufficientNotice: boolean; - - /** Whether the leave was entitled to receive payment */ - isEntitled?: boolean | null; - - /** - * The amount of requested time (in weeks) - * Type: double - */ - entitlementWeeksRequested?: number | null; - - /** - * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested - * Type: double - */ - entitlementWeeksQualified?: number | null; - - /** - * A calculated amount of time (in weeks) that remains for the statutory sick leave period - * Type: double - */ - entitlementWeeksRemaining?: number | null; - - /** Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts */ - overlapsWithOtherLeave?: boolean | null; - - /** If the leave requested was considered "not entitled", the reasons why are listed here. */ - entitlementFailureReasons?: Array; - } - - export interface EmployeeStatutorySickLeaveObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutorySickLeave?: EmployeeStatutorySickLeave; - } - - export interface EmployeeLeaveTypes { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveTypes?: Array; - } - - export interface EmployeeLeaveType { - - /** - * The Xero identifier for leave type - * Required - */ - leaveTypeID: string; - - /** - * The schedule of accrual - * Required - */ - scheduleOfAccrual: EmployeeLeaveTypeScheduleOfAccrual; - - /** - * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is "OnHourWorked" - * Type: double - */ - hoursAccruedAnnually?: number | null; - - /** - * The maximum number of hours that can be accrued for the leave - * Type: double - */ - maximumToAccrue?: number | null; - - /** - * The initial number of hours assigned when the leave was added to the employee - * Type: double - */ - openingBalance?: number | null; - - /** - * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is "OnHourWorked" - * Type: double - */ - rateAccruedHourly?: number | null; - } - - export enum EmployeeLeaveTypeScheduleOfAccrual { BeginningOfCalendarYear = 0, OnAnniversaryDate = 1, EachPayPeriod = 2, OnHourWorked = 3 } - - export interface EmployeeLeaveTypeObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveType?: EmployeeLeaveType; - } - - export interface EmployeePayTemplateObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payTemplate?: EmployeePayTemplate; - } - - export interface EmployeePayTemplate { - - /** Unique identifier for the employee */ - employeeID?: string | null; - earningTemplates?: Array; - } - - export interface EarningsTemplate { - - /** The Xero identifier for the earnings template */ - payTemplateEarningID?: string | null; - - /** - * The rate per unit - * Type: double - */ - ratePerUnit?: number | null; - - /** - * The rate per unit - * Type: double - */ - numberOfUnits?: number | null; - - /** - * The fixed amount per period - * Type: double - */ - fixedAmount?: number | null; - - /** The corresponding earnings rate identifier */ - earningsRateID?: string | null; - - /** The read-only name of the Earning Template. */ - name?: string | null; - } - - export interface EmployeePayTemplates { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningTemplates?: Array; - } - - export interface EarningsTemplateObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningTemplate?: EarningsTemplate; - } - - export interface Benefits { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - benefits?: Array; - } - - export interface Benefit { - - /** unique identifier in Xero */ - id?: string | null; - - /** - * Name of the employer pension - * Required - */ - name: string; - - /** - * Category type of the employer pension - * Required - */ - category: BenefitCategory; - - /** - * Xero identifier for Liability Account - * Required - */ - liabilityAccountId: string; - - /** - * Xero identifier for Expense Account - * Required - */ - expenseAccountId: string; - - /** - * Standard amount of the employer pension - * Required - * Type: double - */ - standardAmount: number; - - /** - * Percentage of gross of the employer pension - * Required - * Type: double - */ - percentage: number; - - /** - * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). - * Required - */ - calculationType: BenefitCalculationType; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - - /** Identifier of subject To NIC */ - subjectToNIC?: boolean | null; - - /** Identifier of subject To pension */ - subjectToPension?: boolean | null; - - /** Identifier of subject To Tax */ - subjectToTax?: boolean | null; - - /** Identifier of calculating on qualifying earnings */ - isCalculatingOnQualifyingEarnings?: boolean | null; - - /** display the balance to employee */ - showBalanceToEmployee?: boolean | null; - } - - export enum BenefitCategory { StakeholderPension = 0, Other = 1 } - - export enum BenefitCalculationType { FixedAmount = 0, PercentageOfGross = 1 } - - export interface BenefitObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - benefit?: Benefit; - } - - export interface Deductions { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - deductions?: Array; - } - - export interface Deduction { - - /** The Xero identifier for Deduction */ - deductionId?: string | null; - - /** - * Name of the deduction - * Required - */ - deductionName: string; - - /** - * Deduction Category type - * Required - */ - deductionCategory: DeductionDeductionCategory; - - /** - * Xero identifier for Liability Account - * Required - */ - liabilityAccountId: string; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - - /** - * Standard amount of the deduction - * Type: double - */ - standardAmount?: number | null; - - /** Identifier of reduces super liability */ - reducesSuperLiability?: boolean | null; - - /** Identifier of reduces tax liability */ - reducesTaxLiability?: boolean | null; - - /** - * determine the calculation type whether fixed amount or percentage of gross - * Required - */ - calculationType: BenefitCalculationType; - - /** - * Percentage of gross - * Type: double - */ - percentage?: number | null; - - /** Identifier of subject To NIC */ - subjectToNIC?: boolean | null; - - /** Identifier of subject To Tax */ - subjectToTax?: boolean | null; - - /** Identifier of reduced by basic rate applicable or not */ - isReducedByBasicRate?: boolean | null; - - /** Identifier for apply to pension calculations */ - applyToPensionCalculations?: boolean | null; - - /** Identifier of calculating on qualifying earnings */ - isCalculatingOnQualifyingEarnings?: boolean | null; - - /** Identifier of applicable for pension or not */ - isPension?: boolean | null; - } - - export enum DeductionDeductionCategory { StakeholderPension = 0, StakeholderPensionPostTax = 1, ChildCareVoucher = 2, SalarySacrifice = 3, UkOther = 4 } - - export interface DeductionObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - deduction?: Deduction; - } - - export interface StatutoryDeduction { - - /** The Xero identifier for earnings order */ - id?: string | null; - - /** Name of the earnings order */ - name?: string | null; - - /** Statutory Deduction Category */ - statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; - - /** Xero identifier for Liability Account */ - liabilityAccountId?: string | null; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - } - - export enum StatutoryDeductionStatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } - - - /** Statutory Deduction Category */ - export enum StatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } - - export interface EarningsOrders { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutoryDeductions?: Array; - } - - export interface EarningsOrder { - - /** Xero unique identifier for an earning rate */ - id?: string | null; - - /** - * Name of the earning order - * Required - */ - name: string; - - /** Statutory Deduction Category */ - statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; - - /** Xero identifier for Liability Account */ - liabilityAccountId?: string | null; - - /** Identifier of a record is active or not. */ - currentRecord?: boolean | null; - } - - export interface EarningsOrderObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - statutoryDeduction?: EarningsOrder; - } - - export interface EarningsRates { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningsRates?: Array; - } - - export interface EarningsRate { - - /** Xero unique identifier for an earning rate */ - earningsRateID?: string | null; - - /** - * Name of the earning rate - * Required - */ - name: string; - - /** - * Indicates how an employee will be paid when taking this type of earning - * Required - */ - earningsType: EarningsRateEarningsType; - - /** - * Indicates the type of the earning rate - * Required - */ - rateType: EarningsRateRateType; - - /** - * The type of units used to record earnings - * Required - */ - typeOfUnits: string; - - /** Indicates whether an earning type is active */ - currentRecord?: boolean | null; - - /** - * The account that will be used for the earnings rate - * Required - */ - expenseAccountID: string; - - /** - * Default rate per unit (optional). Only applicable if RateType is RatePerUnit - * Type: double - */ - ratePerUnit?: number | null; - - /** - * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate - * Type: double - */ - multipleOfOrdinaryEarningsRate?: number | null; - - /** - * Optional Fixed Rate Amount. Applicable for FixedAmount Rate - * Type: double - */ - fixedAmount?: number | null; - } - - export enum EarningsRateEarningsType { OvertimeEarnings = 0, Allowance = 1, RegularEarnings = 2, Commission = 3, Bonus = 4, 'Tips(Direct)' = 5, 'Tips(Non-Direct)' = 6, Backpay = 7, OtherEarnings = 8, LumpSum = 9 } - - export enum EarningsRateRateType { RatePerUnit = 0, MultipleOfOrdinaryEarningsRate = 1, FixedAmount = 2 } - - export interface EarningsRateObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - earningsRate?: EarningsRate; - } - - export interface LeaveTypes { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveTypes?: Array; - } - - export interface LeaveType { - - /** Xero unique identifier for the leave */ - leaveID?: string | null; - - /** Xero unique identifier for the leave type */ - leaveTypeID?: string | null; - - /** - * Name of the leave type - * Required - */ - name: string; - - /** - * Indicate that an employee will be paid when taking this type of leave - * Required - */ - isPaidLeave: boolean; - - /** - * Indicate that a balance for this leave type to be shown on the employee’s payslips - * Required - */ - showOnPayslip: boolean; - - /** UTC timestamp of last update to the leave type note */ - updatedDateUTC?: Date | null; - - /** Shows whether the leave type is active or not */ - isActive?: boolean | null; - - /** Shows whether the leave type is a statutory leave type or not */ - isStatutoryLeave?: boolean | null; - } - - export interface LeaveTypeObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - leaveType?: LeaveType; - } - - export interface Reimbursements { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - reimbursements?: Array; - } - - export interface Reimbursement { - - /** Xero unique identifier for a reimbursement */ - reimbursementID?: string | null; - - /** - * Name of the reimbursement - * Required - */ - name: string; - - /** - * Xero unique identifier for the account used for the reimbursement - * Required - */ - accountID: string; - - /** Indicates that whether the reimbursement is active */ - currentRecord?: boolean | null; - } - - export interface ReimbursementObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - reimbursement?: Reimbursement; - } - - export interface Timesheets { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - timesheets?: Array; - } - - export interface Timesheet { - - /** The Xero identifier for a Timesheet */ - timesheetID?: string | null; - - /** - * The Xero identifier for the Payroll Calandar that the Timesheet applies to - * Required - */ - payrollCalendarID: string; - - /** - * The Xero identifier for the Employee that the Timesheet is for - * Required - */ - employeeID: string; - - /** - * The Start Date of the Timesheet period (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - startDate: Date; - - /** - * The End Date of the Timesheet period (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - endDate: Date; - - /** Status of the timesheet */ - status?: TimesheetStatus | null; - - /** - * The Total Hours of the Timesheet - * Type: double - */ - totalHours?: number | null; - - /** The UTC date time that the Timesheet was last updated */ - updatedDateUTC?: Date | null; - timesheetLines?: Array; - } - - export enum TimesheetStatus { Draft = 0, Approved = 1, Completed = 2 } - - export interface TimesheetLine { - - /** The Xero identifier for a Timesheet Line */ - timesheetLineID?: string | null; - - /** - * The Date that this Timesheet Line is for (YYYY-MM-DD) - * Required - * Type: DateOnly - */ - date: Date; - - /** - * The Xero identifier for the Earnings Rate that the Timesheet is for - * Required - */ - earningsRateID: string; - - /** The Xero identifier for the Tracking Item that the Timesheet is for */ - trackingItemID?: string | null; - - /** - * The Number of Units of the Timesheet Line - * Required - * Type: double - */ - numberOfUnits: number; - } - - export interface TimesheetObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - timesheet?: Timesheet; - } - - export interface TimesheetLineObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - timesheetLine?: TimesheetLine; - } - - export interface PayRunCalendars { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRunCalendars?: Array; - } - - export interface PayRunCalendar { - - /** Xero unique identifier for the payroll calendar */ - payrollCalendarID?: string | null; - - /** - * Name of the calendar - * Required - */ - name: string; - - /** - * Type of the calendar - * Required - */ - calendarType: PayRunCalendarCalendarType; - - /** - * Period start date of the calendar - * Required - * Type: DateOnly - */ - periodStartDate: Date; - - /** - * Period end date of the calendar - * Type: DateOnly - */ - periodEndDate?: Date | null; - - /** - * Payment date of the calendar - * Required - * Type: DateOnly - */ - paymentDate: Date; - - /** UTC timestamp of the last update to the pay run calendar */ - updatedDateUTC?: Date | null; - } - - export enum PayRunCalendarCalendarType { Weekly = 0, Fortnightly = 1, FourWeekly = 2, Monthly = 3, Annual = 4, Quarterly = 5 } - - export interface PayRunCalendarObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRunCalendar?: PayRunCalendar; - } - - export interface PaymentMethodObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - paymentMethod?: PaymentMethod; - } - - export interface PaymentMethod { - - /** - * The payment method code - * Required - */ - paymentMethod: PaymentMethodPaymentMethod; - bankAccounts?: Array; - } - - export enum PaymentMethodPaymentMethod { Cheque = 0, Electronically = 1, Manual = 2 } - - export interface BankAccount { - - /** - * Bank account name (max length = 32) - * Required - */ - accountName: string; - - /** - * Bank account number (digits only; max length = 8) - * Required - */ - accountNumber: string; - - /** - * Bank account sort code (6 digits) - * Required - */ - sortCode: string; - } - - export interface SalaryAndWages { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - salaryAndWages?: Array; - } - - export interface SalaryAndWage { - - /** Xero unique identifier for a salary and wages record */ - salaryAndWagesID?: string | null; - - /** - * Xero unique identifier for an earnings rate - * Required - */ - earningsRateID: string; - - /** - * The Number of Units per week for the corresponding salary and wages - * Required - * Type: double - */ - numberOfUnitsPerWeek: number; - - /** - * The rate of each unit for the corresponding salary and wages - * Required - * Type: double - */ - ratePerUnit: number; - - /** - * The Number of Units per day for the corresponding salary and wages - * Required - * Type: double - */ - numberOfUnitsPerDay: number; - - /** - * The effective date of the corresponding salary and wages - * Required - * Type: DateOnly - */ - effectiveFrom: Date; - - /** - * The annual salary - * Required - * Type: double - */ - annualSalary: number; - - /** - * The current status of the corresponding salary and wages - * Required - */ - status: SalaryAndWageStatus; - - /** - * The type of the payment of the corresponding salary and wages - * Required - */ - paymentType: SalaryAndWagePaymentType; - } - - export enum SalaryAndWageStatus { Active = 0, Pending = 1 } - - export enum SalaryAndWagePaymentType { Salary = 0 } - - export interface SalaryAndWageObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - salaryAndWages?: SalaryAndWage; - } - - export interface PayRuns { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRuns?: Array; - } - - export interface PayRun { - - /** Xero unique identifier for the pay run */ - payRunID?: string | null; - - /** Xero unique identifier for the payroll calendar */ - payrollCalendarID?: string | null; - - /** - * Period start date of the payroll calendar - * Type: DateOnly - */ - periodStartDate?: Date | null; - - /** - * Period end date of the payroll calendar - * Type: DateOnly - */ - periodEndDate?: Date | null; - - /** - * Payment date of the pay run - * Type: DateOnly - */ - paymentDate?: Date | null; - - /** - * Total cost of the pay run - * Type: double - */ - totalCost?: number | null; - - /** - * Total pay of the pay run - * Type: double - */ - totalPay?: number | null; - - /** Pay run status */ - payRunStatus?: PayRunPayRunStatus | null; - - /** Pay run type */ - payRunType?: PayRunPayRunType | null; - - /** Calendar type of the pay run */ - calendarType?: PayRunCalendarCalendarType | null; - - /** - * Posted date time of the pay run - * Type: DateOnly - */ - postedDateTime?: Date | null; - paySlips?: Array; - } - - export enum PayRunPayRunStatus { Draft = 0, Posted = 1 } - - export enum PayRunPayRunType { Scheduled = 0, Unscheduled = 1, EarlierYearUpdate = 2 } - - export interface Payslip { - - /** The Xero identifier for a Payslip */ - paySlipID?: string | null; - - /** The Xero identifier for payroll employee */ - employeeID?: string | null; - - /** The Xero identifier for the associated payrun */ - payRunID?: string | null; - - /** - * The date payslip was last updated - * Type: DateOnly - */ - lastEdited?: Date | null; - - /** Employee first name */ - firstName?: string | null; - - /** Employee last name */ - lastName?: string | null; - - /** - * Total earnings before any deductions. Same as gross earnings for UK. - * Type: double - */ - totalEarnings?: number | null; - - /** - * Total earnings before any deductions. Same as total earnings for UK. - * Type: double - */ - grossEarnings?: number | null; - - /** - * The employee net pay - * Type: double - */ - totalPay?: number | null; - - /** - * The employer's tax obligation - * Type: double - */ - totalEmployerTaxes?: number | null; - - /** - * The part of an employee's earnings that is deducted for tax purposes - * Type: double - */ - totalEmployeeTaxes?: number | null; - - /** - * Total amount subtracted from an employee's earnings to reach total pay - * Type: double - */ - totalDeductions?: number | null; - - /** - * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment - * Type: double - */ - totalReimbursements?: number | null; - - /** - * Total amounts required by law to subtract from the employee's earnings - * Type: double - */ - totalCourtOrders?: number | null; - - /** - * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries - * Type: double - */ - totalBenefits?: number | null; - - /** BACS Service User Number */ - bacsHash?: string | null; - - /** The payment method code */ - paymentMethod?: PaymentMethodPaymentMethod | null; - earningsLines?: Array; - leaveEarningsLines?: Array; - timesheetEarningsLines?: Array; - deductionLines?: Array; - reimbursementLines?: Array; - leaveAccrualLines?: Array; - benefitLines?: Array; - paymentLines?: Array; - employeeTaxLines?: Array; - courtOrderLines?: Array; - } - - export interface EarningsLine { - - /** Xero identifier for payroll earnings line */ - earningsLineID?: string | null; - - /** Xero identifier for payroll earnings rate */ - earningsRateID?: string | null; - - /** name of earnings rate for display in UI */ - displayName?: string | null; - - /** - * Rate per unit for earnings line - * Type: double - */ - ratePerUnit?: number | null; - - /** - * Earnings number of units - * Type: double - */ - numberOfUnits?: number | null; - - /** - * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount?: number | null; - - /** - * The amount of the earnings line. - * Type: double - */ - amount?: number | null; - - /** Identifies if the earnings is taken from the timesheet. False for earnings line */ - isLinkedToTimesheet?: boolean | null; - - /** Identifies if the earnings is using an average daily pay rate */ - isAverageDailyPayRate?: boolean | null; - } - - export interface LeaveEarningsLine { - - /** Xero identifier for payroll leave earnings rate */ - earningsRateID?: string | null; - - /** - * Rate per unit for leave earnings line - * Type: double - */ - ratePerUnit?: number | null; - - /** - * Leave earnings number of units - * Type: double - */ - numberOfUnits?: number | null; - - /** - * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount?: number | null; - - /** - * The amount of the earnings line. - * Type: double - */ - amount?: number | null; - - /** Identifies if the leave earnings is taken from the timesheet. False for leave earnings line */ - isLinkedToTimesheet?: boolean | null; - } - - export interface TimesheetEarningsLine { - - /** Xero identifier for payroll timesheet earnings rate */ - earningsRateID?: string | null; - - /** - * Rate per unit for timesheet earnings line - * Type: double - */ - ratePerUnit?: number | null; - - /** - * Timesheet earnings number of units - * Type: double - */ - numberOfUnits?: number | null; - - /** - * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed - * Type: double - */ - fixedAmount?: number | null; - - /** - * The amount of the timesheet earnings line. - * Type: double - */ - amount?: number | null; - - /** Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line */ - isLinkedToTimesheet?: boolean | null; - } - - export interface DeductionLine { - - /** Xero identifier for payroll deduction */ - deductionTypeID?: string | null; - - /** - * The amount of the deduction line - * Type: double - */ - amount?: number | null; - - /** Identifies if the deduction is subject to tax */ - subjectToTax?: boolean | null; - - /** - * Deduction rate percentage - * Type: double - */ - percentage?: number | null; - } - - export interface ReimbursementLine { - - /** Xero identifier for payroll reimbursement */ - reimbursementTypeID?: string | null; - - /** Reimbursement line description */ - description?: string | null; - - /** - * Reimbursement amount - * Type: double - */ - amount?: number | null; - } - - export interface LeaveAccrualLine { - - /** Xero identifier for the Leave type */ - leaveTypeID?: string | null; - - /** - * Leave accrual number of units - * Type: double - */ - numberOfUnits?: number | null; - } - - export interface BenefitLine { - - /** Xero identifier for payroll benefit type */ - benefitTypeID?: string | null; - - /** Benefit display name */ - displayName?: string | null; - - /** - * The amount of the benefit line. - * Type: double - */ - amount?: number | null; - - /** - * Benefit fixed amount - * Type: double - */ - fixedAmount?: number | null; - - /** - * Benefit rate percentage - * Type: double - */ - percentage?: number | null; - } - - export interface PaymentLine { - - /** Xero identifier for payroll payment line */ - paymentLineID?: string | null; - - /** - * The amount of the payment line - * Type: double - */ - amount?: number | null; - - /** The account number */ - accountNumber?: string | null; - - /** The account sort code */ - sortCode?: string | null; - - /** The account name */ - accountName?: string | null; - } - - export interface TaxLine { - - /** Xero identifier for payroll tax line */ - taxLineID?: string | null; - - /** Tax line description */ - description?: string | null; - - /** Identifies if the amount is paid for by the employee or employer. True if employer pays the tax */ - isEmployerTax?: boolean | null; - - /** - * The amount of the tax line - * Type: double - */ - amount?: number | null; - - /** Tax type ID */ - globalTaxTypeID?: string | null; - - /** Identifies if the tax line is a manual adjustment */ - manualAdjustment?: boolean | null; - } - - export interface CourtOrderLine { - - /** Xero identifier for payroll court order type */ - courtOrderTypeID?: string | null; - - /** - * Amount - * Type: double - */ - amount?: number | null; - } - - export interface PayRunObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - payRun?: PayRun; - } - - export interface PayslipObject { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - paySlip?: Payslip; - } - - export interface Payslips { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - paySlips?: Array; - } - - export interface Settings { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - settings?: Accounts; - } - - export interface Accounts { - accounts?: Array; - } - - export interface Account { - - /** The Xero identifier for Settings. */ - accountID?: string | null; - - /** The assigned AccountType */ - type?: AccountType | null; - - /** A unique 3 digit number for each Account */ - code?: string | null; - - /** Name of the Account. */ - name?: string | null; - } - - export enum AccountType { BANK = 0, EMPLOYERSNIC = 1, NICLIABILITY = 2, PAYEECONTRIBUTION = 3, PAYELIABILITY = 4, WAGESPAYABLE = 5, WAGESEXPENSE = 6 } - - export interface TrackingCategories { - pagination?: Pagination; - - /** The object returned for a bad request */ - problem?: Problem; - trackingCategories?: TrackingCategory; - } - - export interface TrackingCategory { - - /** The Xero identifier for Employee groups tracking category. */ - employeeGroupsTrackingCategoryID?: string | null; - - /** The Xero identifier for Timesheet tracking category. */ - timesheetTrackingCategoryID?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches employees - * Get Employees - * @param {string} firstName Filter by first name - * @param {string} lastName Filter by last name - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Employees} search results matching criteria - */ - GetEmployees(firstName: string | null | undefined, lastName: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees?firstName=' + (firstName == null ? '' : encodeURIComponent(firstName)) + '&lastName=' + (lastName == null ? '' : encodeURIComponent(lastName)) + '&page=' + page, {}); - } - - /** - * creates employees - * Post Employees - * @return {EmployeeObject} search results matching criteria - */ - CreateEmployee(requestBody: Employee): Observable { - return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches employees - * Get Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeObject} search results matching criteria - */ - GetEmployee(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); - } - - /** - * updates employee - * Put Employees/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeObject} successful response - */ - UpdateEmployee(EmployeeId: string, requestBody: Employee): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * creates employment - * Post Employees/{EmployeeId}/Employment - * @param {string} EmployeeId Employee id for single object - * @return {EmploymentObject} search results matching criteria - */ - CreateEmployment(EmployeeId: string, requestBody: Employment): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Employment', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches tax records for an employee - * Get Employees/{EmployeeId}/Tax - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeTaxObject} search results matching criteria - */ - GetEmployeeTax(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Tax', {}); - } - - /** - * retrieve employee openingbalances - * Get Employees/{EmployeeId}/ukopeningbalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeOpeningBalancesObject} search results matching criteria - */ - GetEmployeeOpeningBalances(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', {}); - } - - /** - * creates employee opening balances - * Post Employees/{EmployeeId}/ukopeningbalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeOpeningBalancesObject} search results matching criteria - */ - CreateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * updates employee opening balances - * Put Employees/{EmployeeId}/ukopeningbalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeOpeningBalancesObject} successful response - */ - UpdateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * search employee leave records - * Get Employees/{EmployeeId}/Leave - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaves} search results matching criteria - */ - GetEmployeeLeaves(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', {}); - } - - /** - * creates employee leave records - * Post Employees/{EmployeeId}/Leave - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveObject} search results matching criteria - */ - CreateEmployeeLeave(EmployeeId: string, requestBody: EmployeeLeave): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single employee leave record - * Get Employees/{EmployeeId}/Leave/{LeaveID} - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveID Leave id for single object - * @return {EmployeeLeaveObject} search results matching criteria - */ - GetEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); - } - - /** - * updates employee leave records - * Put Employees/{EmployeeId}/Leave/{LeaveID} - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveID Leave id for single object - * @return {EmployeeLeaveObject} successful response - */ - UpdateEmployeeLeave(EmployeeId: string, LeaveID: string, requestBody: EmployeeLeave): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * deletes an employee leave record - * Delete Employees/{EmployeeId}/Leave/{LeaveID} - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveID Leave id for single object - * @return {EmployeeLeaveObject} successful response - */ - DeleteEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { - return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); - } - - /** - * search employee leave balances - * Get Employees/{EmployeeId}/LeaveBalances - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveBalances} search results matching criteria - */ - GetEmployeeLeaveBalances(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveBalances', {}); - } - - /** - * search employee leave balances - * Get Employees/{EmployeeId}/StatutoryLeaveBalance - * @param {string} EmployeeId Employee id for single object - * @param {string} LeaveType Filter by the type of statutory leave - * @param {Date} AsOfDate The date from which to calculate balance remaining. If not specified, current date UTC is used. - * Type: DateOnly - * @return {EmployeeStatutoryLeaveBalanceObject} search results matching criteria - */ - GetEmployeeStatutoryLeaveBalances(EmployeeId: string, LeaveType: string | null | undefined, AsOfDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/StatutoryLeaveBalance&LeaveType=' + (LeaveType == null ? '' : encodeURIComponent(LeaveType)) + '&AsOfDate=' + AsOfDate?.toISOString(), {}); - } - - /** - * retrieve a summary of statutory leaves for an employee - * Get statutoryleaves/summary/{EmployeeId} - * @param {string} EmployeeId Employee id for single object - * @param {boolean} activeOnly Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned - * @return {EmployeeStatutoryLeavesSummaries} search results matching criteria - */ - GetStatutoryLeaveSummary(EmployeeId: string, activeOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'statutoryleaves/summary/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '&activeOnly=' + activeOnly, {}); - } - - /** - * creates employee statutory sick leave records - * Post StatutoryLeaves/Sick - * @return {EmployeeStatutorySickLeaveObject} search results matching criteria - */ - CreateEmployeeStatutorySickLeave(requestBody: EmployeeStatutorySickLeave): Observable { - return this.http.post(this.baseUri + 'StatutoryLeaves/Sick', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a statutory sick leave for an employee - * Get StatutoryLeaves/Sick/{StatutorySickLeaveID} - * @param {string} StatutorySickLeaveID Statutory sick leave id for single object - * @return {EmployeeStatutorySickLeaveObject} search results matching criteria - */ - GetEmployeeStatutorySickLeave(StatutorySickLeaveID: string): Observable { - return this.http.get(this.baseUri + 'StatutoryLeaves/Sick/' + (StatutorySickLeaveID == null ? '' : encodeURIComponent(StatutorySickLeaveID)), {}); - } - - /** - * searches employee leave periods - * Get Employees/{EmployeeId}/LeavePeriods - * @param {string} EmployeeId Employee id for single object - * @param {Date} startDate Filter by start date - * Type: DateOnly - * @param {Date} endDate Filter by end date - * Type: DateOnly - * @return {LeavePeriods} search results matching criteria - */ - GetEmployeeLeavePeriods(EmployeeId: string, startDate: Date | null | undefined, endDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeavePeriods&startDate=' + startDate?.toISOString() + '&endDate=' + endDate?.toISOString(), {}); - } - - /** - * searches employee leave types - * Get Employees/{EmployeeId}/LeaveTypes - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveTypes} search results matching criteria - */ - GetEmployeeLeaveTypes(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', {}); - } - - /** - * creates employee leave type records - * Post Employees/{EmployeeId}/LeaveTypes - * @param {string} EmployeeId Employee id for single object - * @return {EmployeeLeaveTypeObject} search results matching criteria - */ - CreateEmployeeLeaveType(EmployeeId: string, requestBody: EmployeeLeaveType): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieves an employee's payment method - * Get Employees/{EmployeeId}/PaymentMethods - * @param {string} EmployeeId Employee id for single object - * @return {PaymentMethodObject} search results matching criteria - */ - GetEmployeePaymentMethod(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', {}); - } - - /** - * creates employee payment method - * Post Employees/{EmployeeId}/PaymentMethods - * @param {string} EmployeeId Employee id for single object - * @return {PaymentMethodObject} search results matching criteria - */ - CreateEmployeePaymentMethod(EmployeeId: string, requestBody: PaymentMethod): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches employee pay templates - * Get Employees/{EmployeeId}/PayTemplates - * @param {string} EmployeeId Employee id for single object - * @return {EmployeePayTemplateObject} search results matching criteria - */ - GetEmployeePayTemplate(EmployeeId: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates', {}); - } - - /** - * creates employee earnings template records - * Post Employees/{EmployeeId}/PayTemplates/earnings - * @param {string} EmployeeId Employee id for single object - * @return {EarningsTemplateObject} search results matching criteria - */ - CreateEmployeeEarningsTemplate(EmployeeId: string, requestBody: EarningsTemplate): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * updates employee earnings template records - * Put Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} - * @param {string} EmployeeId Employee id for single object - * @param {string} PayTemplateEarningID Id for single pay template earnings object - * @return {EarningsTemplateObject} search results matching criteria - */ - UpdateEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string, requestBody: EarningsTemplate): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * deletes an employee earnings template record - * Delete Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} - * @param {string} EmployeeId Employee id for single object - * @param {string} PayTemplateEarningID Id for single pay template earnings object - * @return {void} deletion successful - */ - DeleteEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string): Observable> { - return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), { observe: 'response', responseType: 'text' }); - } - - /** - * creates multiple employee earnings template records - * Post Employees/{EmployeeId}/paytemplateearnings - * @param {string} EmployeeId Employee id for single object - * @return {EmployeePayTemplates} search results matching criteria - */ - CreateMultipleEmployeeEarningsTemplate(EmployeeId: string, requestBody: Array): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/paytemplateearnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches benefits - * Get Benefits - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Benefits} search results matching criteria - */ - GetBenefits(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Benefits?page=' + page, {}); - } - - /** - * create a new benefit - * Post Benefits - * @return {BenefitObject} search results matching criteria - */ - CreateBenefit(requestBody: Benefit): Observable { - return this.http.post(this.baseUri + 'Benefits', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single benefit by id - * Get Benefits/{id} - * @param {string} id Identifier for the benefit - * @return {BenefitObject} search results matching criteria - */ - GetBenefit(id: string): Observable { - return this.http.get(this.baseUri + 'Benefits/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * searches deductions - * Get Deductions - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Deductions} search results matching criteria - */ - GetDeductions(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Deductions?page=' + page, {}); - } - - /** - * create a new deduction - * Post Deductions - * @return {DeductionObject} search results matching criteria - */ - CreateDeduction(requestBody: Deduction): Observable { - return this.http.post(this.baseUri + 'Deductions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single deduction by id - * Get Deductions/{deductionId} - * @param {string} deductionId Identifier for the deduction - * @return {DeductionObject} search results matching criteria - */ - GetDeduction(deductionId: string): Observable { - return this.http.get(this.baseUri + 'Deductions/' + (deductionId == null ? '' : encodeURIComponent(deductionId)), {}); - } - - /** - * searches earnings orders - * Get EarningsOrders - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {EarningsOrders} search results matching criteria - */ - GetEarningsOrders(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'EarningsOrders?page=' + page, {}); - } - - /** - * retrieve a single deduction by id - * Get EarningsOrders/{id} - * @param {string} id Identifier for the deduction - * @return {EarningsOrderObject} search results matching criteria - */ - GetEarningsOrder(id: string): Observable { - return this.http.get(this.baseUri + 'EarningsOrders/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * searches earnings rates - * Get EarningsRates - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {EarningsRates} search results matching criteria - */ - GetEarningsRates(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'EarningsRates?page=' + page, {}); - } - - /** - * create a new earnings rate - * Post EarningsRates - * @return {EarningsRateObject} search results matching criteria - */ - CreateEarningsRate(requestBody: EarningsRate): Observable { - return this.http.post(this.baseUri + 'EarningsRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single earnings rates by id - * Get EarningsRates/{EarningsRateID} - * @param {string} EarningsRateID Identifier for the earnings rate - * @return {EarningsRateObject} search results matching criteria - */ - GetEarningsRate(EarningsRateID: string): Observable { - return this.http.get(this.baseUri + 'EarningsRates/' + (EarningsRateID == null ? '' : encodeURIComponent(EarningsRateID)), {}); - } - - /** - * searches leave types - * Get LeaveTypes - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} ActiveOnly Filters leave types by active status. By default the API returns all leave types. - * @return {LeaveTypes} search results matching criteria - */ - GetLeaveTypes(page: number | null | undefined, ActiveOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'LeaveTypes?page=' + page + '&ActiveOnly=' + ActiveOnly, {}); - } - - /** - * create a new leave type - * Post LeaveTypes - * @return {LeaveTypeObject} search results matching criteria - */ - CreateLeaveType(requestBody: LeaveType): Observable { - return this.http.post(this.baseUri + 'LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single leave type by id - * Get LeaveTypes/{LeaveTypeID} - * @param {string} LeaveTypeID Identifier for the leave type - * @return {LeaveTypeObject} search results matching criteria - */ - GetLeaveType(LeaveTypeID: string): Observable { - return this.http.get(this.baseUri + 'LeaveTypes/' + (LeaveTypeID == null ? '' : encodeURIComponent(LeaveTypeID)), {}); - } - - /** - * searches reimbursements - * Get Reimbursements - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Reimbursements} search results matching criteria - */ - GetReimbursements(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reimbursements?page=' + page, {}); - } - - /** - * create a new reimbursement - * Post Reimbursements - * @return {ReimbursementObject} search results matching criteria - */ - CreateReimbursement(requestBody: Reimbursement): Observable { - return this.http.post(this.baseUri + 'Reimbursements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single reimbursement by id - * Get Reimbursements/{ReimbursementID} - * @param {string} ReimbursementID Identifier for the reimbursement - * @return {ReimbursementObject} search results matching criteria - */ - GetReimbursement(ReimbursementID: string): Observable { - return this.http.get(this.baseUri + 'Reimbursements/' + (ReimbursementID == null ? '' : encodeURIComponent(ReimbursementID)), {}); - } - - /** - * searches timesheets - * Get Timesheets - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} employeeId By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. - * @param {string} payrollCalendarId By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id - * @return {Timesheets} search results matching criteria - */ - GetTimesheets(page: number | null | undefined, employeeId: string | null | undefined, payrollCalendarId: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Timesheets?page=' + page + '&employeeId=' + (employeeId == null ? '' : encodeURIComponent(employeeId)) + '&payrollCalendarId=' + (payrollCalendarId == null ? '' : encodeURIComponent(payrollCalendarId)), {}); - } - - /** - * create a new timesheet - * Post Timesheets - * @return {TimesheetObject} search results matching criteria - */ - CreateTimesheet(requestBody: Timesheet): Observable { - return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single timesheet by id - * Get Timesheets/{TimesheetID} - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetObject} search results matching criteria - */ - GetTimesheet(TimesheetID: string): Observable { - return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); - } - - /** - * delete a timesheet - * Delete Timesheets/{TimesheetID} - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetLine} search results matching criteria - */ - DeleteTimesheet(TimesheetID: string): Observable { - return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); - } - - /** - * create a new timesheet line - * Post Timesheets/{TimesheetID}/Lines - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetLineObject} search results matching criteria - */ - CreateTimesheetLine(TimesheetID: string, requestBody: TimesheetLine): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * approve a timesheet - * Post Timesheets/{TimesheetID}/Approve - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetObject} search results matching criteria - */ - ApproveTimesheet(TimesheetID: string): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Approve', null, {}); - } - - /** - * revert a timesheet to draft - * Post Timesheets/{TimesheetID}/RevertToDraft - * @param {string} TimesheetID Identifier for the timesheet - * @return {TimesheetObject} search results matching criteria - */ - RevertTimesheet(TimesheetID: string): Observable { - return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/RevertToDraft', null, {}); - } - - /** - * update a timesheet line - * Put Timesheets/{TimesheetID}/Lines/{TimesheetLineID} - * @param {string} TimesheetID Identifier for the timesheet - * @param {string} TimesheetLineID Identifier for the timesheet line - * @return {TimesheetLineObject} search results matching criteria - */ - UpdateTimesheetLine(TimesheetID: string, TimesheetLineID: string, requestBody: TimesheetLine): Observable { - return this.http.put(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * delete a timesheet line - * Delete Timesheets/{TimesheetID}/Lines/{TimesheetLineID} - * @param {string} TimesheetID Identifier for the timesheet - * @param {string} TimesheetLineID Identifier for the timesheet line - * @return {TimesheetLine} search results matching criteria - */ - DeleteTimesheetLine(TimesheetID: string, TimesheetLineID: string): Observable { - return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), {}); - } - - /** - * searches payrun calendars - * Get PayRunCalendars - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PayRunCalendars} search results matching criteria - */ - GetPayRunCalendars(page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayRunCalendars?page=' + page, {}); - } - - /** - * create a new payrun calendar - * Post PayRunCalendars - * @return {PayRunCalendarObject} search results matching criteria - */ - CreatePayRunCalendar(requestBody: PayRunCalendar): Observable { - return this.http.post(this.baseUri + 'PayRunCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieve a single payrun calendar by id - * Get PayRunCalendars/{PayRunCalendarID} - * @param {string} PayRunCalendarID Identifier for the payrun calendars - * @return {PayRunCalendarObject} search results matching criteria - */ - GetPayRunCalendar(PayRunCalendarID: string): Observable { - return this.http.get(this.baseUri + 'PayRunCalendars/' + (PayRunCalendarID == null ? '' : encodeURIComponent(PayRunCalendarID)), {}); - } - - /** - * retrieves an employee's salary and wages - * Get Employees/{EmployeeId}/SalaryAndWages - * @param {string} EmployeeId Employee id for single object - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {SalaryAndWages} search results matching criteria - */ - GetEmployeeSalaryAndWages(EmployeeId: string, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages&page=' + page, {}); - } - - /** - * creates employee salary and wage record - * Post Employees/{EmployeeId}/SalaryAndWages - * @param {string} EmployeeId Employee id for single object - * @return {SalaryAndWageObject} search results matching criteria - */ - CreateEmployeeSalaryAndWage(EmployeeId: string, requestBody: SalaryAndWage): Observable { - return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * get employee salary and wages record by id - * Get Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} - * @param {string} EmployeeId Employee id for single object - * @param {string} SalaryAndWagesID Id for single pay template earnings object - * @return {SalaryAndWages} search results matching criteria - */ - GetEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), {}); - } - - /** - * updates employee salary and wages record - * Put Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} - * @param {string} EmployeeId Employee id for single object - * @param {string} SalaryAndWagesID Id for single pay template earnings object - * @return {SalaryAndWageObject} search results matching criteria - */ - UpdateEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string, requestBody: SalaryAndWage): Observable { - return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * deletes an employee salary and wages record - * Delete Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} - * @param {string} EmployeeId Employee id for single object - * @param {string} SalaryAndWagesID Id for single salary and wages object - * @return {void} deletion successful - */ - DeleteEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable> { - return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), { observe: 'response', responseType: 'text' }); - } - - /** - * searches pay runs - * Get PayRuns - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {PayRunPayRunStatus} status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. - * @return {PayRuns} search results matching criteria - */ - GetPayRuns(page: number | null | undefined, status: PayRunPayRunStatus | null | undefined): Observable { - return this.http.get(this.baseUri + 'PayRuns?page=' + page + '&status=' + status, {}); - } - - /** - * retrieve a single pay run by id - * Get PayRuns/{PayRunID} - * @param {string} PayRunID Identifier for the pay run - * @return {PayRunObject} search results matching criteria - */ - GetPayRun(PayRunID: string): Observable { - return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); - } - - /** - * update a pay run - * Put PayRuns/{PayRunID} - * @param {string} PayRunID Identifier for the pay run - * @return {PayRunObject} search results matching criteria - */ - UpdatePayRun(PayRunID: string, requestBody: PayRun): Observable { - return this.http.put(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches payslips - * Get Payslips - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} PayRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. - * @return {Payslips} search results matching criteria - */ - GetPayslips(page: number | null | undefined, PayRunID: string): Observable { - return this.http.get(this.baseUri + 'Payslips?page=' + page + '&PayRunID=' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); - } - - /** - * retrieve a single payslip by id - * Get Payslips/{PayslipID} - * @param {string} PayslipID Identifier for the payslip - * @return {PayslipObject} search results matching criteria - */ - GetPaySlip(PayslipID: string): Observable { - return this.http.get(this.baseUri + 'Payslips/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); - } - - /** - * searches settings - * Get Settings - * @return {Settings} search results matching criteria - */ - GetSettings(): Observable { - return this.http.get(this.baseUri + 'Settings', {}); - } - - /** - * searches tracking categories - * Get settings/trackingCategories - * @return {TrackingCategories} search results matching criteria - */ - GetTrackingCategories(): Observable { - return this.http.get(this.baseUri + 'settings/trackingCategories', {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Pagination { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + page?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageSize?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageCount?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + itemCount?: number | null; + } + + + /** The object returned for a bad request */ + export interface Problem { + + /** The type of error format */ + type?: string | null; + + /** The type of the error */ + title?: string | null; + + /** The error status code */ + status?: string | null; + + /** A description of the error */ + detail?: string | null; + instance?: string | null; + invalidFields?: Array; + } + + export interface InvalidField { + + /** The name of the field that caused the error */ + name?: string | null; + + /** The reason the error occurred */ + reason?: string | null; + } + + export interface Employees { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + employees?: Array; + } + + export interface Employee { + + /** Xero unique identifier for the employee */ + employeeID?: string | null; + + /** Title of the employee */ + title?: string | null; + + /** First name of employee */ + firstName?: string | null; + + /** Last name of employee */ + lastName?: string | null; + + /** + * Date of birth of the employee (YYYY-MM-DD) + * Type: DateOnly + */ + dateOfBirth?: Date | null; + address?: Address; + + /** The email address for the employee */ + email?: string | null; + + /** The employee’s gender */ + gender?: EmployeeGender | null; + + /** Employee phone number */ + phoneNumber?: string | null; + + /** + * Employment start date of the employee at the time it was requested + * Type: DateOnly + */ + startDate?: Date | null; + + /** + * Employment end date of the employee at the time it was requested + * Type: DateOnly + */ + endDate?: Date | null; + + /** Xero unique identifier for the payroll calendar of the employee */ + payrollCalendarID?: string | null; + + /** UTC timestamp of last update to the employee */ + updatedDateUTC?: Date | null; + + /** UTC timestamp when the employee was created in Xero */ + createdDateUTC?: Date | null; + + /** National insurance number of the employee */ + nationalInsuranceNumber?: string | null; + } + + export interface Address { + + /** + * Address line 1 for employee home address + * Required + */ + addressLine1: string; + + /** Address line 2 for employee home address */ + addressLine2?: string | null; + + /** + * Suburb for employee home address + * Required + */ + city: string; + + /** + * PostCode for employee home address + * Required + */ + postCode: string; + + /** Country of HomeAddress */ + countryName?: string | null; + } + + export enum EmployeeGender { M = 0, F = 1 } + + export interface EmployeeObject { + pagination?: Pagination; + employee?: Employee; + + /** The object returned for a bad request */ + problem?: Problem; + } + + export interface EmploymentObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + employment?: Employment; + } + + export interface Employment { + + /** Xero unique identifier for the payroll calendar of the employee */ + payrollCalendarID?: string | null; + + /** + * Start date of the employment (YYYY-MM-DD) + * Type: DateOnly + */ + startDate?: Date | null; + + /** The employment number of the employee */ + employeeNumber?: string | null; + + /** The NI Category of the employee */ + niCategory?: EmploymentNiCategory | null; + } + + export enum EmploymentNiCategory { A = 0, B = 1, C = 2, H = 3, J = 4, M = 5, Z = 6, X = 7 } + + export interface EmployeeTaxObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + employeeTax?: EmployeeTax; + } + + export interface EmployeeTax { + + /** The Starter type. */ + starterType?: string | null; + + /** Starter declaration. */ + starterDeclaration?: string | null; + + /** The Tax code. */ + taxCode?: string | null; + + /** Describes whether the tax settings is W1M1 */ + w1M1?: boolean | null; + + /** + * The previous taxable pay + * Type: double + */ + previousTaxablePay?: number | null; + + /** + * The tax amount previously paid + * Type: double + */ + previousTaxPaid?: number | null; + + /** The employee's student loan deduction type */ + studentLoanDeduction?: string | null; + + /** Describes whether the employee has post graduate loans */ + hasPostGraduateLoans?: boolean | null; + + /** Describes whether the employee is director */ + isDirector?: boolean | null; + + /** + * The directorship start date + * Type: DateOnly + */ + directorshipStartDate?: Date | null; + + /** NICs calculation method */ + nicCalculationMethod?: string | null; + } + + export interface EmployeeOpeningBalancesObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + openingBalances?: EmployeeOpeningBalances; + } + + export interface EmployeeOpeningBalances { + + /** + * The total accumulated statutory adoption pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryAdoptionPay?: number | null; + + /** + * The total accumulated statutory maternity pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryMaternityPay?: number | null; + + /** + * The total accumulated statutory paternity pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutoryPaternityPay?: number | null; + + /** + * The total accumulated statutory shared parental pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutorySharedParentalPay?: number | null; + + /** + * The total accumulated statutory sick pay amount received by the employee for current fiscal year to date + * Type: double + */ + statutorySickPay?: number | null; + + /** + * The unique employee number issued by the employee's former employer + * Type: double + */ + priorEmployeeNumber?: number | null; + } + + export interface EmployeeLeaves { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leave?: Array; + } + + export interface EmployeeLeave { + + /** The Xero identifier for LeaveType */ + leaveID?: string | null; + + /** + * The Xero identifier for LeaveType + * Required + */ + leaveTypeID: string; + + /** + * The description of the leave (max length = 50) + * Required + */ + description: string; + + /** + * Start date of the leave (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + startDate: Date; + + /** + * End date of the leave (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + endDate: Date; + + /** The leave period information. The StartDate, EndDate and NumberOfUnits needs to be specified when you do not want to calculate NumberOfUnits automatically. Using incorrect period StartDate and EndDate will result in automatic computation of the NumberOfUnits. */ + periods?: Array; + + /** UTC timestamp of last update to the leave type note */ + updatedDateUTC?: Date | null; + } + + export interface LeavePeriod { + + /** + * The Pay Period Start Date (YYYY-MM-DD) + * Type: DateOnly + */ + periodStartDate?: Date | null; + + /** + * The Pay Period End Date (YYYY-MM-DD) + * Type: DateOnly + */ + periodEndDate?: Date | null; + + /** + * The Number of Units for the leave + * Type: double + */ + numberOfUnits?: number | null; + + /** Period Status */ + periodStatus?: LeavePeriodPeriodStatus | null; + } + + export enum LeavePeriodPeriodStatus { Approved = 0, Completed = 1 } + + export interface EmployeeLeaveObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leave?: EmployeeLeave; + } + + export interface LeavePeriods { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + periods?: Array; + } + + export interface EmployeeLeaveBalances { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveBalances?: Array; + } + + export interface EmployeeLeaveBalance { + + /** Name of the leave type. */ + name?: string | null; + + /** The Xero identifier for leave type */ + leaveTypeID?: string | null; + + /** + * The employees current balance for the corresponding leave type. + * Type: double + */ + balance?: number | null; + + /** The type of the units of the leave. */ + typeOfUnits?: string | null; + } + + export interface EmployeeStatutoryLeaveBalanceObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveBalance?: EmployeeStatutoryLeaveBalance; + } + + export interface EmployeeStatutoryLeaveBalance { + + /** The type of statutory leave */ + leaveType?: EmployeeStatutoryLeaveBalanceLeaveType | null; + + /** + * The balance remaining for the corresponding leave type as of specified date. + * Type: double + */ + balanceRemaining?: number | null; + + /** The units will be "Hours" */ + units?: EmployeeStatutoryLeaveBalanceUnits | null; + } + + export enum EmployeeStatutoryLeaveBalanceLeaveType { Sick = 0, Adoption = 1, Maternity = 2, Paternity = 3, Sharedparental = 4 } + + export enum EmployeeStatutoryLeaveBalanceUnits { Hours = 0 } + + export interface EmployeeStatutoryLeavesSummaries { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutoryLeaves?: Array; + } + + export interface EmployeeStatutoryLeaveSummary { + + /** The unique identifier (guid) of a statutory leave. */ + statutoryLeaveID?: string | null; + + /** The unique identifier (guid) of the employee */ + employeeID?: string | null; + + /** The category of statutory leave */ + type?: EmployeeStatutoryLeaveBalanceLeaveType | null; + + /** + * The date when the leave starts + * Type: DateOnly + */ + startDate?: Date | null; + + /** + * The date when the leave ends + * Type: DateOnly + */ + endDate?: Date | null; + + /** Whether the leave was entitled to receive payment */ + isEntitled?: boolean | null; + + /** The status of the leave */ + status?: EmployeeStatutoryLeaveSummaryStatus | null; + } + + export enum EmployeeStatutoryLeaveSummaryStatus { Pending = 0, 'In-Progress' = 1, Completed = 2 } + + export interface EmployeeStatutorySickLeaves { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutorySickLeave?: Array; + } + + export interface EmployeeStatutorySickLeave { + + /** The unique identifier (guid) of a statutory leave */ + statutoryLeaveID?: string | null; + + /** + * The unique identifier (guid) of the employee + * Required + */ + employeeID: string; + + /** + * The unique identifier (guid) of the "Statutory Sick Leave (non-pensionable)" pay item + * Required + */ + leaveTypeID: string; + + /** + * The date when the leave starts + * Required + * Type: DateOnly + */ + startDate: Date; + + /** + * The date when the leave ends + * Required + * Type: DateOnly + */ + endDate: Date; + + /** the type of statutory leave */ + type?: string | null; + + /** the type of statutory leave */ + status?: string | null; + + /** + * The days of the work week the employee is scheduled to work at the time the leave is taken + * Required + */ + workPattern: Array; + + /** + * Whether the sick leave was pregnancy related + * Required + */ + isPregnancyRelated: boolean; + + /** + * Whether the employee provided sufficent notice and documentation as required by the employer supporting the sick leave request + * Required + */ + sufficientNotice: boolean; + + /** Whether the leave was entitled to receive payment */ + isEntitled?: boolean | null; + + /** + * The amount of requested time (in weeks) + * Type: double + */ + entitlementWeeksRequested?: number | null; + + /** + * The amount of statutory sick leave time off (in weeks) that is available to take at the time the leave was requested + * Type: double + */ + entitlementWeeksQualified?: number | null; + + /** + * A calculated amount of time (in weeks) that remains for the statutory sick leave period + * Type: double + */ + entitlementWeeksRemaining?: number | null; + + /** Whether another leave (Paternity, Shared Parental specifically) occurs during the requested leave's period. While this is allowed it could affect payment amounts */ + overlapsWithOtherLeave?: boolean | null; + + /** If the leave requested was considered "not entitled", the reasons why are listed here. */ + entitlementFailureReasons?: Array; + } + + export interface EmployeeStatutorySickLeaveObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutorySickLeave?: EmployeeStatutorySickLeave; + } + + export interface EmployeeLeaveTypes { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveTypes?: Array; + } + + export interface EmployeeLeaveType { + + /** + * The Xero identifier for leave type + * Required + */ + leaveTypeID: string; + + /** + * The schedule of accrual + * Required + */ + scheduleOfAccrual: EmployeeLeaveTypeScheduleOfAccrual; + + /** + * The number of hours accrued for the leave annually. This is 0 when the scheduleOfAccrual chosen is "OnHourWorked" + * Type: double + */ + hoursAccruedAnnually?: number | null; + + /** + * The maximum number of hours that can be accrued for the leave + * Type: double + */ + maximumToAccrue?: number | null; + + /** + * The initial number of hours assigned when the leave was added to the employee + * Type: double + */ + openingBalance?: number | null; + + /** + * The number of hours added to the leave balance for every hour worked by the employee. This is normally 0, unless the scheduleOfAccrual chosen is "OnHourWorked" + * Type: double + */ + rateAccruedHourly?: number | null; + } + + export enum EmployeeLeaveTypeScheduleOfAccrual { BeginningOfCalendarYear = 0, OnAnniversaryDate = 1, EachPayPeriod = 2, OnHourWorked = 3 } + + export interface EmployeeLeaveTypeObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveType?: EmployeeLeaveType; + } + + export interface EmployeePayTemplateObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payTemplate?: EmployeePayTemplate; + } + + export interface EmployeePayTemplate { + + /** Unique identifier for the employee */ + employeeID?: string | null; + earningTemplates?: Array; + } + + export interface EarningsTemplate { + + /** The Xero identifier for the earnings template */ + payTemplateEarningID?: string | null; + + /** + * The rate per unit + * Type: double + */ + ratePerUnit?: number | null; + + /** + * The rate per unit + * Type: double + */ + numberOfUnits?: number | null; + + /** + * The fixed amount per period + * Type: double + */ + fixedAmount?: number | null; + + /** The corresponding earnings rate identifier */ + earningsRateID?: string | null; + + /** The read-only name of the Earning Template. */ + name?: string | null; + } + + export interface EmployeePayTemplates { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningTemplates?: Array; + } + + export interface EarningsTemplateObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningTemplate?: EarningsTemplate; + } + + export interface Benefits { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + benefits?: Array; + } + + export interface Benefit { + + /** unique identifier in Xero */ + id?: string | null; + + /** + * Name of the employer pension + * Required + */ + name: string; + + /** + * Category type of the employer pension + * Required + */ + category: BenefitCategory; + + /** + * Xero identifier for Liability Account + * Required + */ + liabilityAccountId: string; + + /** + * Xero identifier for Expense Account + * Required + */ + expenseAccountId: string; + + /** + * Standard amount of the employer pension + * Required + * Type: double + */ + standardAmount: number; + + /** + * Percentage of gross of the employer pension + * Required + * Type: double + */ + percentage: number; + + /** + * Calculation Type of the employer pension (FixedAmount or PercentageOfGross). + * Required + */ + calculationType: BenefitCalculationType; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + + /** Identifier of subject To NIC */ + subjectToNIC?: boolean | null; + + /** Identifier of subject To pension */ + subjectToPension?: boolean | null; + + /** Identifier of subject To Tax */ + subjectToTax?: boolean | null; + + /** Identifier of calculating on qualifying earnings */ + isCalculatingOnQualifyingEarnings?: boolean | null; + + /** display the balance to employee */ + showBalanceToEmployee?: boolean | null; + } + + export enum BenefitCategory { StakeholderPension = 0, Other = 1 } + + export enum BenefitCalculationType { FixedAmount = 0, PercentageOfGross = 1 } + + export interface BenefitObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + benefit?: Benefit; + } + + export interface Deductions { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + deductions?: Array; + } + + export interface Deduction { + + /** The Xero identifier for Deduction */ + deductionId?: string | null; + + /** + * Name of the deduction + * Required + */ + deductionName: string; + + /** + * Deduction Category type + * Required + */ + deductionCategory: DeductionDeductionCategory; + + /** + * Xero identifier for Liability Account + * Required + */ + liabilityAccountId: string; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + + /** + * Standard amount of the deduction + * Type: double + */ + standardAmount?: number | null; + + /** Identifier of reduces super liability */ + reducesSuperLiability?: boolean | null; + + /** Identifier of reduces tax liability */ + reducesTaxLiability?: boolean | null; + + /** + * determine the calculation type whether fixed amount or percentage of gross + * Required + */ + calculationType: BenefitCalculationType; + + /** + * Percentage of gross + * Type: double + */ + percentage?: number | null; + + /** Identifier of subject To NIC */ + subjectToNIC?: boolean | null; + + /** Identifier of subject To Tax */ + subjectToTax?: boolean | null; + + /** Identifier of reduced by basic rate applicable or not */ + isReducedByBasicRate?: boolean | null; + + /** Identifier for apply to pension calculations */ + applyToPensionCalculations?: boolean | null; + + /** Identifier of calculating on qualifying earnings */ + isCalculatingOnQualifyingEarnings?: boolean | null; + + /** Identifier of applicable for pension or not */ + isPension?: boolean | null; + } + + export enum DeductionDeductionCategory { StakeholderPension = 0, StakeholderPensionPostTax = 1, ChildCareVoucher = 2, SalarySacrifice = 3, UkOther = 4 } + + export interface DeductionObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + deduction?: Deduction; + } + + export interface StatutoryDeduction { + + /** The Xero identifier for earnings order */ + id?: string | null; + + /** Name of the earnings order */ + name?: string | null; + + /** Statutory Deduction Category */ + statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; + + /** Xero identifier for Liability Account */ + liabilityAccountId?: string | null; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + } + + export enum StatutoryDeductionStatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } + + + /** Statutory Deduction Category */ + export enum StatutoryDeductionCategory { AdditionalStudentLoan = 0, ChildSupport = 1, CourtFines = 2, Creditor = 3, FederalLevy = 4, InlandRevenueArrears = 5, KiwiSaver = 6, MsdRepayments = 7, NonPriorityOrder = 8, PriorityOrder = 9, TableBased = 10, StudentLoan = 11, VoluntaryStudentLoan = 12, USChildSupport = 13 } + + export interface EarningsOrders { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutoryDeductions?: Array; + } + + export interface EarningsOrder { + + /** Xero unique identifier for an earning rate */ + id?: string | null; + + /** + * Name of the earning order + * Required + */ + name: string; + + /** Statutory Deduction Category */ + statutoryDeductionCategory?: StatutoryDeductionStatutoryDeductionCategory | null; + + /** Xero identifier for Liability Account */ + liabilityAccountId?: string | null; + + /** Identifier of a record is active or not. */ + currentRecord?: boolean | null; + } + + export interface EarningsOrderObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + statutoryDeduction?: EarningsOrder; + } + + export interface EarningsRates { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningsRates?: Array; + } + + export interface EarningsRate { + + /** Xero unique identifier for an earning rate */ + earningsRateID?: string | null; + + /** + * Name of the earning rate + * Required + */ + name: string; + + /** + * Indicates how an employee will be paid when taking this type of earning + * Required + */ + earningsType: EarningsRateEarningsType; + + /** + * Indicates the type of the earning rate + * Required + */ + rateType: EarningsRateRateType; + + /** + * The type of units used to record earnings + * Required + */ + typeOfUnits: string; + + /** Indicates whether an earning type is active */ + currentRecord?: boolean | null; + + /** + * The account that will be used for the earnings rate + * Required + */ + expenseAccountID: string; + + /** + * Default rate per unit (optional). Only applicable if RateType is RatePerUnit + * Type: double + */ + ratePerUnit?: number | null; + + /** + * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MultipleOfOrdinaryEarningsRate + * Type: double + */ + multipleOfOrdinaryEarningsRate?: number | null; + + /** + * Optional Fixed Rate Amount. Applicable for FixedAmount Rate + * Type: double + */ + fixedAmount?: number | null; + } + + export enum EarningsRateEarningsType { OvertimeEarnings = 0, Allowance = 1, RegularEarnings = 2, Commission = 3, Bonus = 4, 'Tips(Direct)' = 5, 'Tips(Non-Direct)' = 6, Backpay = 7, OtherEarnings = 8, LumpSum = 9 } + + export enum EarningsRateRateType { RatePerUnit = 0, MultipleOfOrdinaryEarningsRate = 1, FixedAmount = 2 } + + export interface EarningsRateObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + earningsRate?: EarningsRate; + } + + export interface LeaveTypes { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveTypes?: Array; + } + + export interface LeaveType { + + /** Xero unique identifier for the leave */ + leaveID?: string | null; + + /** Xero unique identifier for the leave type */ + leaveTypeID?: string | null; + + /** + * Name of the leave type + * Required + */ + name: string; + + /** + * Indicate that an employee will be paid when taking this type of leave + * Required + */ + isPaidLeave: boolean; + + /** + * Indicate that a balance for this leave type to be shown on the employee’s payslips + * Required + */ + showOnPayslip: boolean; + + /** UTC timestamp of last update to the leave type note */ + updatedDateUTC?: Date | null; + + /** Shows whether the leave type is active or not */ + isActive?: boolean | null; + + /** Shows whether the leave type is a statutory leave type or not */ + isStatutoryLeave?: boolean | null; + } + + export interface LeaveTypeObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + leaveType?: LeaveType; + } + + export interface Reimbursements { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + reimbursements?: Array; + } + + export interface Reimbursement { + + /** Xero unique identifier for a reimbursement */ + reimbursementID?: string | null; + + /** + * Name of the reimbursement + * Required + */ + name: string; + + /** + * Xero unique identifier for the account used for the reimbursement + * Required + */ + accountID: string; + + /** Indicates that whether the reimbursement is active */ + currentRecord?: boolean | null; + } + + export interface ReimbursementObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + reimbursement?: Reimbursement; + } + + export interface Timesheets { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + timesheets?: Array; + } + + export interface Timesheet { + + /** The Xero identifier for a Timesheet */ + timesheetID?: string | null; + + /** + * The Xero identifier for the Payroll Calandar that the Timesheet applies to + * Required + */ + payrollCalendarID: string; + + /** + * The Xero identifier for the Employee that the Timesheet is for + * Required + */ + employeeID: string; + + /** + * The Start Date of the Timesheet period (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + startDate: Date; + + /** + * The End Date of the Timesheet period (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + endDate: Date; + + /** Status of the timesheet */ + status?: TimesheetStatus | null; + + /** + * The Total Hours of the Timesheet + * Type: double + */ + totalHours?: number | null; + + /** The UTC date time that the Timesheet was last updated */ + updatedDateUTC?: Date | null; + timesheetLines?: Array; + } + + export enum TimesheetStatus { Draft = 0, Approved = 1, Completed = 2 } + + export interface TimesheetLine { + + /** The Xero identifier for a Timesheet Line */ + timesheetLineID?: string | null; + + /** + * The Date that this Timesheet Line is for (YYYY-MM-DD) + * Required + * Type: DateOnly + */ + date: Date; + + /** + * The Xero identifier for the Earnings Rate that the Timesheet is for + * Required + */ + earningsRateID: string; + + /** The Xero identifier for the Tracking Item that the Timesheet is for */ + trackingItemID?: string | null; + + /** + * The Number of Units of the Timesheet Line + * Required + * Type: double + */ + numberOfUnits: number; + } + + export interface TimesheetObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + timesheet?: Timesheet; + } + + export interface TimesheetLineObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + timesheetLine?: TimesheetLine; + } + + export interface PayRunCalendars { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRunCalendars?: Array; + } + + export interface PayRunCalendar { + + /** Xero unique identifier for the payroll calendar */ + payrollCalendarID?: string | null; + + /** + * Name of the calendar + * Required + */ + name: string; + + /** + * Type of the calendar + * Required + */ + calendarType: PayRunCalendarCalendarType; + + /** + * Period start date of the calendar + * Required + * Type: DateOnly + */ + periodStartDate: Date; + + /** + * Period end date of the calendar + * Type: DateOnly + */ + periodEndDate?: Date | null; + + /** + * Payment date of the calendar + * Required + * Type: DateOnly + */ + paymentDate: Date; + + /** UTC timestamp of the last update to the pay run calendar */ + updatedDateUTC?: Date | null; + } + + export enum PayRunCalendarCalendarType { Weekly = 0, Fortnightly = 1, FourWeekly = 2, Monthly = 3, Annual = 4, Quarterly = 5 } + + export interface PayRunCalendarObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRunCalendar?: PayRunCalendar; + } + + export interface PaymentMethodObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + paymentMethod?: PaymentMethod; + } + + export interface PaymentMethod { + + /** + * The payment method code + * Required + */ + paymentMethod: PaymentMethodPaymentMethod; + bankAccounts?: Array; + } + + export enum PaymentMethodPaymentMethod { Cheque = 0, Electronically = 1, Manual = 2 } + + export interface BankAccount { + + /** + * Bank account name (max length = 32) + * Required + */ + accountName: string; + + /** + * Bank account number (digits only; max length = 8) + * Required + */ + accountNumber: string; + + /** + * Bank account sort code (6 digits) + * Required + */ + sortCode: string; + } + + export interface SalaryAndWages { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + salaryAndWages?: Array; + } + + export interface SalaryAndWage { + + /** Xero unique identifier for a salary and wages record */ + salaryAndWagesID?: string | null; + + /** + * Xero unique identifier for an earnings rate + * Required + */ + earningsRateID: string; + + /** + * The Number of Units per week for the corresponding salary and wages + * Required + * Type: double + */ + numberOfUnitsPerWeek: number; + + /** + * The rate of each unit for the corresponding salary and wages + * Required + * Type: double + */ + ratePerUnit: number; + + /** + * The Number of Units per day for the corresponding salary and wages + * Required + * Type: double + */ + numberOfUnitsPerDay: number; + + /** + * The effective date of the corresponding salary and wages + * Required + * Type: DateOnly + */ + effectiveFrom: Date; + + /** + * The annual salary + * Required + * Type: double + */ + annualSalary: number; + + /** + * The current status of the corresponding salary and wages + * Required + */ + status: SalaryAndWageStatus; + + /** + * The type of the payment of the corresponding salary and wages + * Required + */ + paymentType: SalaryAndWagePaymentType; + } + + export enum SalaryAndWageStatus { Active = 0, Pending = 1 } + + export enum SalaryAndWagePaymentType { Salary = 0 } + + export interface SalaryAndWageObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + salaryAndWages?: SalaryAndWage; + } + + export interface PayRuns { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRuns?: Array; + } + + export interface PayRun { + + /** Xero unique identifier for the pay run */ + payRunID?: string | null; + + /** Xero unique identifier for the payroll calendar */ + payrollCalendarID?: string | null; + + /** + * Period start date of the payroll calendar + * Type: DateOnly + */ + periodStartDate?: Date | null; + + /** + * Period end date of the payroll calendar + * Type: DateOnly + */ + periodEndDate?: Date | null; + + /** + * Payment date of the pay run + * Type: DateOnly + */ + paymentDate?: Date | null; + + /** + * Total cost of the pay run + * Type: double + */ + totalCost?: number | null; + + /** + * Total pay of the pay run + * Type: double + */ + totalPay?: number | null; + + /** Pay run status */ + payRunStatus?: PayRunPayRunStatus | null; + + /** Pay run type */ + payRunType?: PayRunPayRunType | null; + + /** Calendar type of the pay run */ + calendarType?: PayRunCalendarCalendarType | null; + + /** + * Posted date time of the pay run + * Type: DateOnly + */ + postedDateTime?: Date | null; + paySlips?: Array; + } + + export enum PayRunPayRunStatus { Draft = 0, Posted = 1 } + + export enum PayRunPayRunType { Scheduled = 0, Unscheduled = 1, EarlierYearUpdate = 2 } + + export interface Payslip { + + /** The Xero identifier for a Payslip */ + paySlipID?: string | null; + + /** The Xero identifier for payroll employee */ + employeeID?: string | null; + + /** The Xero identifier for the associated payrun */ + payRunID?: string | null; + + /** + * The date payslip was last updated + * Type: DateOnly + */ + lastEdited?: Date | null; + + /** Employee first name */ + firstName?: string | null; + + /** Employee last name */ + lastName?: string | null; + + /** + * Total earnings before any deductions. Same as gross earnings for UK. + * Type: double + */ + totalEarnings?: number | null; + + /** + * Total earnings before any deductions. Same as total earnings for UK. + * Type: double + */ + grossEarnings?: number | null; + + /** + * The employee net pay + * Type: double + */ + totalPay?: number | null; + + /** + * The employer's tax obligation + * Type: double + */ + totalEmployerTaxes?: number | null; + + /** + * The part of an employee's earnings that is deducted for tax purposes + * Type: double + */ + totalEmployeeTaxes?: number | null; + + /** + * Total amount subtracted from an employee's earnings to reach total pay + * Type: double + */ + totalDeductions?: number | null; + + /** + * Total reimbursements are nontaxable payments to an employee used to repay out-of-pocket expenses when the person incurs those expenses through employment + * Type: double + */ + totalReimbursements?: number | null; + + /** + * Total amounts required by law to subtract from the employee's earnings + * Type: double + */ + totalCourtOrders?: number | null; + + /** + * Benefits (also called fringe benefits, perquisites or perks) are various non-earnings compensations provided to employees in addition to their normal earnings or salaries + * Type: double + */ + totalBenefits?: number | null; + + /** BACS Service User Number */ + bacsHash?: string | null; + + /** The payment method code */ + paymentMethod?: PaymentMethodPaymentMethod | null; + earningsLines?: Array; + leaveEarningsLines?: Array; + timesheetEarningsLines?: Array; + deductionLines?: Array; + reimbursementLines?: Array; + leaveAccrualLines?: Array; + benefitLines?: Array; + paymentLines?: Array; + employeeTaxLines?: Array; + courtOrderLines?: Array; + } + + export interface EarningsLine { + + /** Xero identifier for payroll earnings line */ + earningsLineID?: string | null; + + /** Xero identifier for payroll earnings rate */ + earningsRateID?: string | null; + + /** name of earnings rate for display in UI */ + displayName?: string | null; + + /** + * Rate per unit for earnings line + * Type: double + */ + ratePerUnit?: number | null; + + /** + * Earnings number of units + * Type: double + */ + numberOfUnits?: number | null; + + /** + * Earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount?: number | null; + + /** + * The amount of the earnings line. + * Type: double + */ + amount?: number | null; + + /** Identifies if the earnings is taken from the timesheet. False for earnings line */ + isLinkedToTimesheet?: boolean | null; + + /** Identifies if the earnings is using an average daily pay rate */ + isAverageDailyPayRate?: boolean | null; + } + + export interface LeaveEarningsLine { + + /** Xero identifier for payroll leave earnings rate */ + earningsRateID?: string | null; + + /** + * Rate per unit for leave earnings line + * Type: double + */ + ratePerUnit?: number | null; + + /** + * Leave earnings number of units + * Type: double + */ + numberOfUnits?: number | null; + + /** + * Leave earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount?: number | null; + + /** + * The amount of the earnings line. + * Type: double + */ + amount?: number | null; + + /** Identifies if the leave earnings is taken from the timesheet. False for leave earnings line */ + isLinkedToTimesheet?: boolean | null; + } + + export interface TimesheetEarningsLine { + + /** Xero identifier for payroll timesheet earnings rate */ + earningsRateID?: string | null; + + /** + * Rate per unit for timesheet earnings line + * Type: double + */ + ratePerUnit?: number | null; + + /** + * Timesheet earnings number of units + * Type: double + */ + numberOfUnits?: number | null; + + /** + * Timesheet earnings fixed amount. Only applicable if the EarningsRate RateType is Fixed + * Type: double + */ + fixedAmount?: number | null; + + /** + * The amount of the timesheet earnings line. + * Type: double + */ + amount?: number | null; + + /** Identifies if the timesheet earnings is taken from the timesheet. False for leave earnings line */ + isLinkedToTimesheet?: boolean | null; + } + + export interface DeductionLine { + + /** Xero identifier for payroll deduction */ + deductionTypeID?: string | null; + + /** + * The amount of the deduction line + * Type: double + */ + amount?: number | null; + + /** Identifies if the deduction is subject to tax */ + subjectToTax?: boolean | null; + + /** + * Deduction rate percentage + * Type: double + */ + percentage?: number | null; + } + + export interface ReimbursementLine { + + /** Xero identifier for payroll reimbursement */ + reimbursementTypeID?: string | null; + + /** Reimbursement line description */ + description?: string | null; + + /** + * Reimbursement amount + * Type: double + */ + amount?: number | null; + } + + export interface LeaveAccrualLine { + + /** Xero identifier for the Leave type */ + leaveTypeID?: string | null; + + /** + * Leave accrual number of units + * Type: double + */ + numberOfUnits?: number | null; + } + + export interface BenefitLine { + + /** Xero identifier for payroll benefit type */ + benefitTypeID?: string | null; + + /** Benefit display name */ + displayName?: string | null; + + /** + * The amount of the benefit line. + * Type: double + */ + amount?: number | null; + + /** + * Benefit fixed amount + * Type: double + */ + fixedAmount?: number | null; + + /** + * Benefit rate percentage + * Type: double + */ + percentage?: number | null; + } + + export interface PaymentLine { + + /** Xero identifier for payroll payment line */ + paymentLineID?: string | null; + + /** + * The amount of the payment line + * Type: double + */ + amount?: number | null; + + /** The account number */ + accountNumber?: string | null; + + /** The account sort code */ + sortCode?: string | null; + + /** The account name */ + accountName?: string | null; + } + + export interface TaxLine { + + /** Xero identifier for payroll tax line */ + taxLineID?: string | null; + + /** Tax line description */ + description?: string | null; + + /** Identifies if the amount is paid for by the employee or employer. True if employer pays the tax */ + isEmployerTax?: boolean | null; + + /** + * The amount of the tax line + * Type: double + */ + amount?: number | null; + + /** Tax type ID */ + globalTaxTypeID?: string | null; + + /** Identifies if the tax line is a manual adjustment */ + manualAdjustment?: boolean | null; + } + + export interface CourtOrderLine { + + /** Xero identifier for payroll court order type */ + courtOrderTypeID?: string | null; + + /** + * Amount + * Type: double + */ + amount?: number | null; + } + + export interface PayRunObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + payRun?: PayRun; + } + + export interface PayslipObject { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + paySlip?: Payslip; + } + + export interface Payslips { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + paySlips?: Array; + } + + export interface Settings { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + settings?: Accounts; + } + + export interface Accounts { + accounts?: Array; + } + + export interface Account { + + /** The Xero identifier for Settings. */ + accountID?: string | null; + + /** The assigned AccountType */ + type?: AccountType | null; + + /** A unique 3 digit number for each Account */ + code?: string | null; + + /** Name of the Account. */ + name?: string | null; + } + + export enum AccountType { BANK = 0, EMPLOYERSNIC = 1, NICLIABILITY = 2, PAYEECONTRIBUTION = 3, PAYELIABILITY = 4, WAGESPAYABLE = 5, WAGESEXPENSE = 6 } + + export interface TrackingCategories { + pagination?: Pagination; + + /** The object returned for a bad request */ + problem?: Problem; + trackingCategories?: TrackingCategory; + } + + export interface TrackingCategory { + + /** The Xero identifier for Employee groups tracking category. */ + employeeGroupsTrackingCategoryID?: string | null; + + /** The Xero identifier for Timesheet tracking category. */ + timesheetTrackingCategoryID?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches employees + * Get Employees + * @param {string} firstName Filter by first name + * @param {string} lastName Filter by last name + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Employees} search results matching criteria + */ + GetEmployees(firstName: string | null | undefined, lastName: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees?firstName=' + (firstName == null ? '' : encodeURIComponent(firstName)) + '&lastName=' + (lastName == null ? '' : encodeURIComponent(lastName)) + '&page=' + page, {}); + } + + /** + * creates employees + * Post Employees + * @return {EmployeeObject} search results matching criteria + */ + CreateEmployee(requestBody: Employee): Observable { + return this.http.post(this.baseUri + 'Employees', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches employees + * Get Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeObject} search results matching criteria + */ + GetEmployee(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), {}); + } + + /** + * updates employee + * Put Employees/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeObject} successful response + */ + UpdateEmployee(EmployeeId: string, requestBody: Employee): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * creates employment + * Post Employees/{EmployeeId}/Employment + * @param {string} EmployeeId Employee id for single object + * @return {EmploymentObject} search results matching criteria + */ + CreateEmployment(EmployeeId: string, requestBody: Employment): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Employment', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches tax records for an employee + * Get Employees/{EmployeeId}/Tax + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeTaxObject} search results matching criteria + */ + GetEmployeeTax(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Tax', {}); + } + + /** + * retrieve employee openingbalances + * Get Employees/{EmployeeId}/ukopeningbalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeOpeningBalancesObject} search results matching criteria + */ + GetEmployeeOpeningBalances(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', {}); + } + + /** + * creates employee opening balances + * Post Employees/{EmployeeId}/ukopeningbalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeOpeningBalancesObject} search results matching criteria + */ + CreateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * updates employee opening balances + * Put Employees/{EmployeeId}/ukopeningbalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeOpeningBalancesObject} successful response + */ + UpdateEmployeeOpeningBalances(EmployeeId: string, requestBody: EmployeeOpeningBalances): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/ukopeningbalances', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * search employee leave records + * Get Employees/{EmployeeId}/Leave + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaves} search results matching criteria + */ + GetEmployeeLeaves(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', {}); + } + + /** + * creates employee leave records + * Post Employees/{EmployeeId}/Leave + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveObject} search results matching criteria + */ + CreateEmployeeLeave(EmployeeId: string, requestBody: EmployeeLeave): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single employee leave record + * Get Employees/{EmployeeId}/Leave/{LeaveID} + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveID Leave id for single object + * @return {EmployeeLeaveObject} search results matching criteria + */ + GetEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); + } + + /** + * updates employee leave records + * Put Employees/{EmployeeId}/Leave/{LeaveID} + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveID Leave id for single object + * @return {EmployeeLeaveObject} successful response + */ + UpdateEmployeeLeave(EmployeeId: string, LeaveID: string, requestBody: EmployeeLeave): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * deletes an employee leave record + * Delete Employees/{EmployeeId}/Leave/{LeaveID} + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveID Leave id for single object + * @return {EmployeeLeaveObject} successful response + */ + DeleteEmployeeLeave(EmployeeId: string, LeaveID: string): Observable { + return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/Leave/' + (LeaveID == null ? '' : encodeURIComponent(LeaveID)), {}); + } + + /** + * search employee leave balances + * Get Employees/{EmployeeId}/LeaveBalances + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveBalances} search results matching criteria + */ + GetEmployeeLeaveBalances(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveBalances', {}); + } + + /** + * search employee leave balances + * Get Employees/{EmployeeId}/StatutoryLeaveBalance + * @param {string} EmployeeId Employee id for single object + * @param {string} LeaveType Filter by the type of statutory leave + * @param {Date} AsOfDate The date from which to calculate balance remaining. If not specified, current date UTC is used. + * Type: DateOnly + * @return {EmployeeStatutoryLeaveBalanceObject} search results matching criteria + */ + GetEmployeeStatutoryLeaveBalances(EmployeeId: string, LeaveType: string | null | undefined, AsOfDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/StatutoryLeaveBalance&LeaveType=' + (LeaveType == null ? '' : encodeURIComponent(LeaveType)) + '&AsOfDate=' + AsOfDate?.toISOString(), {}); + } + + /** + * retrieve a summary of statutory leaves for an employee + * Get statutoryleaves/summary/{EmployeeId} + * @param {string} EmployeeId Employee id for single object + * @param {boolean} activeOnly Filter response with leaves that are currently active or yet to be taken. If not specified, all leaves (past, current, and future scheduled) are returned + * @return {EmployeeStatutoryLeavesSummaries} search results matching criteria + */ + GetStatutoryLeaveSummary(EmployeeId: string, activeOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'statutoryleaves/summary/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '&activeOnly=' + activeOnly, {}); + } + + /** + * creates employee statutory sick leave records + * Post StatutoryLeaves/Sick + * @return {EmployeeStatutorySickLeaveObject} search results matching criteria + */ + CreateEmployeeStatutorySickLeave(requestBody: EmployeeStatutorySickLeave): Observable { + return this.http.post(this.baseUri + 'StatutoryLeaves/Sick', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a statutory sick leave for an employee + * Get StatutoryLeaves/Sick/{StatutorySickLeaveID} + * @param {string} StatutorySickLeaveID Statutory sick leave id for single object + * @return {EmployeeStatutorySickLeaveObject} search results matching criteria + */ + GetEmployeeStatutorySickLeave(StatutorySickLeaveID: string): Observable { + return this.http.get(this.baseUri + 'StatutoryLeaves/Sick/' + (StatutorySickLeaveID == null ? '' : encodeURIComponent(StatutorySickLeaveID)), {}); + } + + /** + * searches employee leave periods + * Get Employees/{EmployeeId}/LeavePeriods + * @param {string} EmployeeId Employee id for single object + * @param {Date} startDate Filter by start date + * Type: DateOnly + * @param {Date} endDate Filter by end date + * Type: DateOnly + * @return {LeavePeriods} search results matching criteria + */ + GetEmployeeLeavePeriods(EmployeeId: string, startDate: Date | null | undefined, endDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeavePeriods&startDate=' + startDate?.toISOString() + '&endDate=' + endDate?.toISOString(), {}); + } + + /** + * searches employee leave types + * Get Employees/{EmployeeId}/LeaveTypes + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveTypes} search results matching criteria + */ + GetEmployeeLeaveTypes(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', {}); + } + + /** + * creates employee leave type records + * Post Employees/{EmployeeId}/LeaveTypes + * @param {string} EmployeeId Employee id for single object + * @return {EmployeeLeaveTypeObject} search results matching criteria + */ + CreateEmployeeLeaveType(EmployeeId: string, requestBody: EmployeeLeaveType): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieves an employee's payment method + * Get Employees/{EmployeeId}/PaymentMethods + * @param {string} EmployeeId Employee id for single object + * @return {PaymentMethodObject} search results matching criteria + */ + GetEmployeePaymentMethod(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', {}); + } + + /** + * creates employee payment method + * Post Employees/{EmployeeId}/PaymentMethods + * @param {string} EmployeeId Employee id for single object + * @return {PaymentMethodObject} search results matching criteria + */ + CreateEmployeePaymentMethod(EmployeeId: string, requestBody: PaymentMethod): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PaymentMethods', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches employee pay templates + * Get Employees/{EmployeeId}/PayTemplates + * @param {string} EmployeeId Employee id for single object + * @return {EmployeePayTemplateObject} search results matching criteria + */ + GetEmployeePayTemplate(EmployeeId: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates', {}); + } + + /** + * creates employee earnings template records + * Post Employees/{EmployeeId}/PayTemplates/earnings + * @param {string} EmployeeId Employee id for single object + * @return {EarningsTemplateObject} search results matching criteria + */ + CreateEmployeeEarningsTemplate(EmployeeId: string, requestBody: EarningsTemplate): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * updates employee earnings template records + * Put Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} + * @param {string} EmployeeId Employee id for single object + * @param {string} PayTemplateEarningID Id for single pay template earnings object + * @return {EarningsTemplateObject} search results matching criteria + */ + UpdateEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string, requestBody: EarningsTemplate): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * deletes an employee earnings template record + * Delete Employees/{EmployeeId}/PayTemplates/earnings/{PayTemplateEarningID} + * @param {string} EmployeeId Employee id for single object + * @param {string} PayTemplateEarningID Id for single pay template earnings object + * @return {void} deletion successful + */ + DeleteEmployeeEarningsTemplate(EmployeeId: string, PayTemplateEarningID: string): Observable> { + return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/PayTemplates/earnings/' + (PayTemplateEarningID == null ? '' : encodeURIComponent(PayTemplateEarningID)), { observe: 'response', responseType: 'text' }); + } + + /** + * creates multiple employee earnings template records + * Post Employees/{EmployeeId}/paytemplateearnings + * @param {string} EmployeeId Employee id for single object + * @return {EmployeePayTemplates} search results matching criteria + */ + CreateMultipleEmployeeEarningsTemplate(EmployeeId: string, requestBody: Array): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/paytemplateearnings', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches benefits + * Get Benefits + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Benefits} search results matching criteria + */ + GetBenefits(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Benefits?page=' + page, {}); + } + + /** + * create a new benefit + * Post Benefits + * @return {BenefitObject} search results matching criteria + */ + CreateBenefit(requestBody: Benefit): Observable { + return this.http.post(this.baseUri + 'Benefits', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single benefit by id + * Get Benefits/{id} + * @param {string} id Identifier for the benefit + * @return {BenefitObject} search results matching criteria + */ + GetBenefit(id: string): Observable { + return this.http.get(this.baseUri + 'Benefits/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * searches deductions + * Get Deductions + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Deductions} search results matching criteria + */ + GetDeductions(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Deductions?page=' + page, {}); + } + + /** + * create a new deduction + * Post Deductions + * @return {DeductionObject} search results matching criteria + */ + CreateDeduction(requestBody: Deduction): Observable { + return this.http.post(this.baseUri + 'Deductions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single deduction by id + * Get Deductions/{deductionId} + * @param {string} deductionId Identifier for the deduction + * @return {DeductionObject} search results matching criteria + */ + GetDeduction(deductionId: string): Observable { + return this.http.get(this.baseUri + 'Deductions/' + (deductionId == null ? '' : encodeURIComponent(deductionId)), {}); + } + + /** + * searches earnings orders + * Get EarningsOrders + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {EarningsOrders} search results matching criteria + */ + GetEarningsOrders(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'EarningsOrders?page=' + page, {}); + } + + /** + * retrieve a single deduction by id + * Get EarningsOrders/{id} + * @param {string} id Identifier for the deduction + * @return {EarningsOrderObject} search results matching criteria + */ + GetEarningsOrder(id: string): Observable { + return this.http.get(this.baseUri + 'EarningsOrders/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * searches earnings rates + * Get EarningsRates + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {EarningsRates} search results matching criteria + */ + GetEarningsRates(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'EarningsRates?page=' + page, {}); + } + + /** + * create a new earnings rate + * Post EarningsRates + * @return {EarningsRateObject} search results matching criteria + */ + CreateEarningsRate(requestBody: EarningsRate): Observable { + return this.http.post(this.baseUri + 'EarningsRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single earnings rates by id + * Get EarningsRates/{EarningsRateID} + * @param {string} EarningsRateID Identifier for the earnings rate + * @return {EarningsRateObject} search results matching criteria + */ + GetEarningsRate(EarningsRateID: string): Observable { + return this.http.get(this.baseUri + 'EarningsRates/' + (EarningsRateID == null ? '' : encodeURIComponent(EarningsRateID)), {}); + } + + /** + * searches leave types + * Get LeaveTypes + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} ActiveOnly Filters leave types by active status. By default the API returns all leave types. + * @return {LeaveTypes} search results matching criteria + */ + GetLeaveTypes(page: number | null | undefined, ActiveOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'LeaveTypes?page=' + page + '&ActiveOnly=' + ActiveOnly, {}); + } + + /** + * create a new leave type + * Post LeaveTypes + * @return {LeaveTypeObject} search results matching criteria + */ + CreateLeaveType(requestBody: LeaveType): Observable { + return this.http.post(this.baseUri + 'LeaveTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single leave type by id + * Get LeaveTypes/{LeaveTypeID} + * @param {string} LeaveTypeID Identifier for the leave type + * @return {LeaveTypeObject} search results matching criteria + */ + GetLeaveType(LeaveTypeID: string): Observable { + return this.http.get(this.baseUri + 'LeaveTypes/' + (LeaveTypeID == null ? '' : encodeURIComponent(LeaveTypeID)), {}); + } + + /** + * searches reimbursements + * Get Reimbursements + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Reimbursements} search results matching criteria + */ + GetReimbursements(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reimbursements?page=' + page, {}); + } + + /** + * create a new reimbursement + * Post Reimbursements + * @return {ReimbursementObject} search results matching criteria + */ + CreateReimbursement(requestBody: Reimbursement): Observable { + return this.http.post(this.baseUri + 'Reimbursements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single reimbursement by id + * Get Reimbursements/{ReimbursementID} + * @param {string} ReimbursementID Identifier for the reimbursement + * @return {ReimbursementObject} search results matching criteria + */ + GetReimbursement(ReimbursementID: string): Observable { + return this.http.get(this.baseUri + 'Reimbursements/' + (ReimbursementID == null ? '' : encodeURIComponent(ReimbursementID)), {}); + } + + /** + * searches timesheets + * Get Timesheets + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} employeeId By default get Timesheets will return the timesheets for all employees in an organization. You can add GET https://…/timesheets?filter=employeeId=={EmployeeId} to get only the timesheets of a particular employee. + * @param {string} payrollCalendarId By default get Timesheets will return all the timesheets for an organization. You can add GET https://…/timesheets?filter=payrollCalendarId=={PayrollCalendarID} to filter the timesheets by payroll calendar id + * @return {Timesheets} search results matching criteria + */ + GetTimesheets(page: number | null | undefined, employeeId: string | null | undefined, payrollCalendarId: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Timesheets?page=' + page + '&employeeId=' + (employeeId == null ? '' : encodeURIComponent(employeeId)) + '&payrollCalendarId=' + (payrollCalendarId == null ? '' : encodeURIComponent(payrollCalendarId)), {}); + } + + /** + * create a new timesheet + * Post Timesheets + * @return {TimesheetObject} search results matching criteria + */ + CreateTimesheet(requestBody: Timesheet): Observable { + return this.http.post(this.baseUri + 'Timesheets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single timesheet by id + * Get Timesheets/{TimesheetID} + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetObject} search results matching criteria + */ + GetTimesheet(TimesheetID: string): Observable { + return this.http.get(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); + } + + /** + * delete a timesheet + * Delete Timesheets/{TimesheetID} + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetLine} search results matching criteria + */ + DeleteTimesheet(TimesheetID: string): Observable { + return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)), {}); + } + + /** + * create a new timesheet line + * Post Timesheets/{TimesheetID}/Lines + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetLineObject} search results matching criteria + */ + CreateTimesheetLine(TimesheetID: string, requestBody: TimesheetLine): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * approve a timesheet + * Post Timesheets/{TimesheetID}/Approve + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetObject} search results matching criteria + */ + ApproveTimesheet(TimesheetID: string): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Approve', null, {}); + } + + /** + * revert a timesheet to draft + * Post Timesheets/{TimesheetID}/RevertToDraft + * @param {string} TimesheetID Identifier for the timesheet + * @return {TimesheetObject} search results matching criteria + */ + RevertTimesheet(TimesheetID: string): Observable { + return this.http.post(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/RevertToDraft', null, {}); + } + + /** + * update a timesheet line + * Put Timesheets/{TimesheetID}/Lines/{TimesheetLineID} + * @param {string} TimesheetID Identifier for the timesheet + * @param {string} TimesheetLineID Identifier for the timesheet line + * @return {TimesheetLineObject} search results matching criteria + */ + UpdateTimesheetLine(TimesheetID: string, TimesheetLineID: string, requestBody: TimesheetLine): Observable { + return this.http.put(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * delete a timesheet line + * Delete Timesheets/{TimesheetID}/Lines/{TimesheetLineID} + * @param {string} TimesheetID Identifier for the timesheet + * @param {string} TimesheetLineID Identifier for the timesheet line + * @return {TimesheetLine} search results matching criteria + */ + DeleteTimesheetLine(TimesheetID: string, TimesheetLineID: string): Observable { + return this.http.delete(this.baseUri + 'Timesheets/' + (TimesheetID == null ? '' : encodeURIComponent(TimesheetID)) + '/Lines/' + (TimesheetLineID == null ? '' : encodeURIComponent(TimesheetLineID)), {}); + } + + /** + * searches payrun calendars + * Get PayRunCalendars + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PayRunCalendars} search results matching criteria + */ + GetPayRunCalendars(page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayRunCalendars?page=' + page, {}); + } + + /** + * create a new payrun calendar + * Post PayRunCalendars + * @return {PayRunCalendarObject} search results matching criteria + */ + CreatePayRunCalendar(requestBody: PayRunCalendar): Observable { + return this.http.post(this.baseUri + 'PayRunCalendars', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieve a single payrun calendar by id + * Get PayRunCalendars/{PayRunCalendarID} + * @param {string} PayRunCalendarID Identifier for the payrun calendars + * @return {PayRunCalendarObject} search results matching criteria + */ + GetPayRunCalendar(PayRunCalendarID: string): Observable { + return this.http.get(this.baseUri + 'PayRunCalendars/' + (PayRunCalendarID == null ? '' : encodeURIComponent(PayRunCalendarID)), {}); + } + + /** + * retrieves an employee's salary and wages + * Get Employees/{EmployeeId}/SalaryAndWages + * @param {string} EmployeeId Employee id for single object + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {SalaryAndWages} search results matching criteria + */ + GetEmployeeSalaryAndWages(EmployeeId: string, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages&page=' + page, {}); + } + + /** + * creates employee salary and wage record + * Post Employees/{EmployeeId}/SalaryAndWages + * @param {string} EmployeeId Employee id for single object + * @return {SalaryAndWageObject} search results matching criteria + */ + CreateEmployeeSalaryAndWage(EmployeeId: string, requestBody: SalaryAndWage): Observable { + return this.http.post(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * get employee salary and wages record by id + * Get Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} + * @param {string} EmployeeId Employee id for single object + * @param {string} SalaryAndWagesID Id for single pay template earnings object + * @return {SalaryAndWages} search results matching criteria + */ + GetEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), {}); + } + + /** + * updates employee salary and wages record + * Put Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} + * @param {string} EmployeeId Employee id for single object + * @param {string} SalaryAndWagesID Id for single pay template earnings object + * @return {SalaryAndWageObject} search results matching criteria + */ + UpdateEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string, requestBody: SalaryAndWage): Observable { + return this.http.put(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * deletes an employee salary and wages record + * Delete Employees/{EmployeeId}/SalaryAndWages/{SalaryAndWagesID} + * @param {string} EmployeeId Employee id for single object + * @param {string} SalaryAndWagesID Id for single salary and wages object + * @return {void} deletion successful + */ + DeleteEmployeeSalaryAndWage(EmployeeId: string, SalaryAndWagesID: string): Observable> { + return this.http.delete(this.baseUri + 'Employees/' + (EmployeeId == null ? '' : encodeURIComponent(EmployeeId)) + '/SalaryAndWages/' + (SalaryAndWagesID == null ? '' : encodeURIComponent(SalaryAndWagesID)), { observe: 'response', responseType: 'text' }); + } + + /** + * searches pay runs + * Get PayRuns + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {PayRunPayRunStatus} status By default get payruns will return all the payruns for an organization. You can add GET https://api.xero.com/payroll.xro/2.0/payRuns?statu={PayRunStatus} to filter the payruns by status. + * @return {PayRuns} search results matching criteria + */ + GetPayRuns(page: number | null | undefined, status: PayRunPayRunStatus | null | undefined): Observable { + return this.http.get(this.baseUri + 'PayRuns?page=' + page + '&status=' + status, {}); + } + + /** + * retrieve a single pay run by id + * Get PayRuns/{PayRunID} + * @param {string} PayRunID Identifier for the pay run + * @return {PayRunObject} search results matching criteria + */ + GetPayRun(PayRunID: string): Observable { + return this.http.get(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); + } + + /** + * update a pay run + * Put PayRuns/{PayRunID} + * @param {string} PayRunID Identifier for the pay run + * @return {PayRunObject} search results matching criteria + */ + UpdatePayRun(PayRunID: string, requestBody: PayRun): Observable { + return this.http.put(this.baseUri + 'PayRuns/' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches payslips + * Get Payslips + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} PayRunID PayrunID which specifies the containing payrun of payslips to retrieve. By default, the API does not group payslips by payrun. + * @return {Payslips} search results matching criteria + */ + GetPayslips(page: number | null | undefined, PayRunID: string): Observable { + return this.http.get(this.baseUri + 'Payslips?page=' + page + '&PayRunID=' + (PayRunID == null ? '' : encodeURIComponent(PayRunID)), {}); + } + + /** + * retrieve a single payslip by id + * Get Payslips/{PayslipID} + * @param {string} PayslipID Identifier for the payslip + * @return {PayslipObject} search results matching criteria + */ + GetPaySlip(PayslipID: string): Observable { + return this.http.get(this.baseUri + 'Payslips/' + (PayslipID == null ? '' : encodeURIComponent(PayslipID)), {}); + } + + /** + * searches settings + * Get Settings + * @return {Settings} search results matching criteria + */ + GetSettings(): Observable { + return this.http.get(this.baseUri + 'Settings', {}); + } + + /** + * searches tracking categories + * Get settings/trackingCategories + * @return {TrackingCategories} search results matching criteria + */ + GetTrackingCategories(): Observable { + return this.http.get(this.baseUri + 'settings/trackingCategories', {}); + } + } + +} + diff --git a/Tests/SwagTsTests/NG2Results/xero_accounting.txt b/Tests/SwagTsTests/NG2Results/xero_accounting.ts similarity index 97% rename from Tests/SwagTsTests/NG2Results/xero_accounting.txt rename to Tests/SwagTsTests/NG2Results/xero_accounting.ts index e367f39b..e303a4b7 100644 --- a/Tests/SwagTsTests/NG2Results/xero_accounting.txt +++ b/Tests/SwagTsTests/NG2Results/xero_accounting.ts @@ -1,5032 +1,5032 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Address { - - /** define the type of address */ - AddressType?: AddressAddressType | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine1?: string | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine2?: string | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine3?: string | null; - - /** - * max length = 500 - * Max length: 500 - */ - AddressLine4?: string | null; - - /** - * max length = 255 - * Max length: 255 - */ - City?: string | null; - - /** - * max length = 255 - * Max length: 255 - */ - Region?: string | null; - - /** - * max length = 50 - * Max length: 50 - */ - PostalCode?: string | null; - - /** - * max length = 50, [A-Z], [a-z] only - * Max length: 50 - */ - Country?: string | null; - - /** - * max length = 255 - * Max length: 255 - */ - AttentionTo?: string | null; - } - - export enum AddressAddressType { POBOX = 0, STREET = 1, DELIVERY = 2 } - - export interface Phone { - PhoneType?: PhonePhoneType | null; - - /** - * max length = 50 - * Max length: 50 - */ - PhoneNumber?: string | null; - - /** - * max length = 10 - * Max length: 10 - */ - PhoneAreaCode?: string | null; - - /** - * max length = 20 - * Max length: 20 - */ - PhoneCountryCode?: string | null; - } - - export enum PhonePhoneType { DEFAULT = 0, DDI = 1, MOBILE = 2, FAX = 3, OFFICE = 4 } - - export interface Accounts { - Accounts1?: Array; - } - - export interface Account { - - /** - * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - * Max length: 10 - */ - Code?: string | null; - - /** - * Name of account (max length = 150) - * Max length: 150 - */ - Name?: string | null; - - /** The Xero identifier for an account � specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - AccountID?: string | null; - - /** See Account Types */ - Type?: AccountType | null; - - /** For bank accounts only (Account Type BANK) */ - BankAccountNumber?: string | null; - - /** Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes */ - Status?: AccountStatus | null; - - /** Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) */ - Description?: string | null; - - /** For bank accounts only. See Bank Account types */ - BankAccountType?: AccountBankAccountType | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** Boolean � describes whether account can have payments applied to it */ - EnablePaymentsToAccount?: boolean | null; - - /** Boolean � describes whether account code is available for use with expense claims */ - ShowInExpenseClaims?: boolean | null; - - /** See Account Class Types */ - Class?: AccountClass | null; - - /** If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either �� or null. */ - SystemAccount?: AccountSystemAccount | null; - - /** Shown if set */ - ReportingCode?: string | null; - - /** Shown if set */ - ReportingCodeName?: string | null; - - /** boolean to indicate if an account has an attachment (read only) */ - HasAttachments?: boolean | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Boolean � describes whether the account is shown in the watchlist widget on the dashboard */ - AddToWatchlist?: boolean | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21 } - - export enum AccountStatus { ACTIVE = 0, ARCHIVED = 1, DELETED = 2 } - - export enum AccountBankAccountType { BANK = 0, CREDITCARD = 1, PAYPAL = 2, NONE = 3, '' = 4 } - - export enum AccountCurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - export enum AccountClass { ASSET = 0, EQUITY = 1, EXPENSE = 2, LIABILITY = 3, REVENUE = 4 } - - export enum AccountSystemAccount { DEBTORS = 0, CREDITORS = 1, BANKCURRENCYGAIN = 2, GST = 3, GSTONIMPORTS = 4, HISTORICAL = 5, REALISEDCURRENCYGAIN = 6, RETAINEDEARNINGS = 7, ROUNDING = 8, TRACKINGTRANSFERS = 9, UNPAIDEXPCLM = 10, UNREALISEDCURRENCYGAIN = 11, WAGEPAYABLES = 12, CISASSETS = 13, CISASSET = 14, CISLABOUR = 15, CISLABOUREXPENSE = 16, CISLABOURINCOME = 17, CISLIABILITY = 18, CISMATERIALS = 19, '' = 20 } - - export interface ValidationError { - - /** Validation error message */ - Message?: string | null; - } - - export interface Attachments { - Attachments1?: Array; - } - - export interface Attachment { - - /** Unique ID for the file */ - AttachmentID?: string | null; - - /** Name of the file */ - FileName?: string | null; - - /** URL to the file on xero.com */ - Url?: string | null; - - /** Type of file */ - MimeType?: string | null; - - /** - * Length of the file content - * Type: double - */ - ContentLength?: number | null; - - /** Include the file with the online invoice */ - IncludeOnline?: boolean | null; - } - - export interface BankTransactions { - BankTransactions1?: Array; - } - - export interface BankTransaction { - - /** - * See Bank Transaction Types - * Required - */ - Type: BankTransactionType; - - /** Required */ - Contact: Contact; - - /** - * See LineItems - * Required - */ - LineItems: Array; - - /** Required */ - BankAccount: Account; - - /** Boolean to show if transaction is reconciled */ - IsReconciled?: boolean | null; - - /** - * Date of transaction � YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** Reference for the transaction. Only supported for SPEND and RECEIVE transactions. */ - Reference?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn�t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. - * Type: double - */ - CurrencyRate?: number | null; - - /** URL link to a source document � shown as �Go to App Name� */ - Url?: string | null; - - /** See Bank Transaction Status Codes */ - Status?: BankTransactionStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** - * Total of bank transaction excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on bank transaction - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of bank transaction tax inclusive - * Type: double - */ - Total?: number | null; - - /** Xero generated unique identifier for bank transaction */ - BankTransactionID?: string | null; - - /** Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT */ - PrepaymentID?: string | null; - - /** Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT */ - OverpaymentID?: string | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Boolean to indicate if a bank transaction has an attachment */ - HasAttachments?: boolean | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum BankTransactionType { RECEIVE = 0, 'RECEIVE-OVERPAYMENT' = 1, 'RECEIVE-PREPAYMENT' = 2, SPEND = 3, 'SPEND-OVERPAYMENT' = 4, 'SPEND-PREPAYMENT' = 5, 'RECEIVE-TRANSFER' = 6, 'SPEND-TRANSFER' = 7 } - - export interface Contact { - - /** Xero identifier */ - ContactID?: string | null; - - /** - * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. - * Max length: 50 - */ - ContactNumber?: string | null; - - /** - * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) - * Max length: 50 - */ - AccountNumber?: string | null; - - /** Current status of a contact � see contact status types */ - ContactStatus?: ContactContactStatus | null; - - /** - * Full name of contact/organisation (max length = 255) - * Max length: 255 - */ - Name?: string | null; - - /** - * First name of contact person (max length = 255) - * Max length: 255 - */ - FirstName?: string | null; - - /** - * Last name of contact person (max length = 255) - * Max length: 255 - */ - LastName?: string | null; - - /** - * Email address of contact person (umlauts not supported) (max length = 255) - * Max length: 255 - */ - EmailAddress?: string | null; - - /** Skype user name of contact */ - SkypeUserName?: string | null; - - /** See contact persons */ - ContactPersons?: Array; - - /** Bank account number of contact */ - BankAccountDetails?: string | null; - - /** - * Tax number of contact � this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) - * Max length: 50 - */ - TaxNumber?: string | null; - - /** The tax type from TaxRates */ - AccountsReceivableTaxType?: string | null; - - /** The tax type from TaxRates */ - AccountsPayableTaxType?: string | null; - - /** Store certain address types for a contact � see address types */ - Addresses?: Array
; - - /** Store certain phone types for a contact � see phone types */ - Phones?: Array; - - /** true or false � Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts payable invoice is generated against this contact. */ - IsSupplier?: boolean | null; - - /** true or false � Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts receivable invoice is generated against this contact. */ - IsCustomer?: boolean | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - DefaultCurrency?: AccountCurrencyCode | null; - - /** Store XeroNetworkKey for contacts. */ - XeroNetworkKey?: string | null; - - /** The default sales account code for contacts */ - SalesDefaultAccountCode?: string | null; - - /** The default purchases account code for contacts */ - PurchasesDefaultAccountCode?: string | null; - - /** The default sales tracking categories for contacts */ - SalesTrackingCategories?: Array; - - /** The default purchases tracking categories for contacts */ - PurchasesTrackingCategories?: Array; - - /** The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ - TrackingCategoryName?: string | null; - - /** The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ - TrackingCategoryOption?: string | null; - PaymentTerms?: PaymentTerm; - - /** UTC timestamp of last update to contact */ - UpdatedDateUTC?: Date | null; - - /** Displays which contact groups a contact is included in */ - ContactGroups?: Array; - - /** Website address for contact (read only) */ - Website?: string | null; - BrandingTheme?: BrandingTheme; - - /** Bank details for use on a batch payment stored with each contact */ - BatchPayments?: BatchPaymentDetails; - - /** - * The default discount rate for the contact (read only) - * Type: double - */ - Discount?: number | null; - - /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ - Balances?: Balances; - - /** Displays array of attachments from the API */ - Attachments?: Array; - - /** A boolean to indicate if a contact has an attachment */ - HasAttachments?: boolean | null; - - /** Displays validation errors returned from the API */ - ValidationErrors?: Array; - - /** A boolean to indicate if a contact has an validation errors */ - HasValidationErrors?: boolean | null; - - /** Status of object */ - StatusAttributeString?: string | null; - } - - export enum ContactContactStatus { ACTIVE = 0, ARCHIVED = 1, GDPRREQUEST = 2 } - - export interface ContactPerson { - - /** First name of person */ - FirstName?: string | null; - - /** Last name of person */ - LastName?: string | null; - - /** Email address of person */ - EmailAddress?: string | null; - - /** boolean to indicate whether contact should be included on emails with invoices etc. */ - IncludeInEmails?: boolean | null; - } - - export interface SalesTrackingCategory { - - /** The default sales tracking category name for contacts */ - TrackingCategoryName?: string | null; - - /** The default purchase tracking category name for contacts */ - TrackingOptionName?: string | null; - } - - export interface PaymentTerm { - Bills?: Bill; - Sales?: Bill; - } - - export interface Bill { - - /** - * Day of Month (0-31) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Day?: number | null; - Type?: BillType | null; - } - - export enum BillType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } - - export interface ContactGroup { - - /** The Name of the contact group. Required when creating a new contact group */ - Name?: string | null; - - /** The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. */ - Status?: ContactGroupStatus | null; - - /** The Xero identifier for an contact group � specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - ContactGroupID?: string | null; - - /** The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. */ - Contacts?: Array; - } - - export enum ContactGroupStatus { ACTIVE = 0, DELETED = 1 } - - export interface BrandingTheme { - - /** Xero identifier */ - BrandingThemeID?: string | null; - - /** Name of branding theme */ - Name?: string | null; - - /** The location of the image file used as the logo on this branding theme */ - LogoUrl?: string | null; - - /** Always INVOICE */ - Type?: BrandingThemeType | null; - - /** - * Integer � ranked order of branding theme. The default branding theme has a value of 0 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - SortOrder?: number | null; - - /** UTC timestamp of creation date of branding theme */ - CreatedDateUTC?: Date | null; - } - - export enum BrandingThemeType { INVOICE = 0 } - - - /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ - export interface Balances { - AccountsReceivable?: AccountsReceivable; - AccountsPayable?: AccountsPayable; - } - - export interface AccountsReceivable { - - /** Type: double */ - Outstanding?: number | null; - - /** Type: double */ - Overdue?: number | null; - } - - export interface AccountsPayable { - - /** Type: double */ - Outstanding?: number | null; - - /** Type: double */ - Overdue?: number | null; - } - - export interface LineItem { - - /** LineItem unique ID */ - LineItemID?: string | null; - - /** Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character */ - Description?: string | null; - - /** - * LineItem Quantity - * Type: double - */ - Quantity?: number | null; - - /** - * LineItem Unit Amount - * Type: double - */ - UnitAmount?: number | null; - - /** See Items */ - ItemCode?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** - * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. - * Type: double - */ - TaxAmount?: number | null; - - /** - * If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 � DiscountRate)/100) - * Type: double - */ - LineAmount?: number | null; - - /** Optional Tracking Category � see Tracking. Any LineItem can have a maximum of 2 elements. */ - Tracking?: Array; - - /** - * Percentage discount being applied to a line item (only supported on ACCREC invoices � ACC PAY invoices and credit notes in Xero do not support discounts - * Type: double - */ - DiscountRate?: number | null; - - /** - * Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. - * Type: double - */ - DiscountAmount?: number | null; - - /** The Xero identifier for a Repeating Invoice */ - RepeatingInvoiceID?: string | null; - } - - export interface LineItemTracking { - - /** The Xero identifier for a tracking category */ - TrackingCategoryID?: string | null; - - /** The Xero identifier for a tracking category option */ - TrackingOptionID?: string | null; - - /** - * The name of the tracking category - * Max length: 100 - */ - Name?: string | null; - - /** See Tracking Options */ - Option?: string | null; - } - - export enum BankTransactionStatus { AUTHORISED = 0, DELETED = 1, VOIDED = 2 } - - export enum BankTransactionLineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } - - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - export enum LineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } - - export interface BankTransfers { - BankTransfers1?: Array; - } - - export interface BankTransfer { - - /** Required */ - FromBankAccount: Account; - - /** Required */ - ToBankAccount: Account; - - /** - * amount of the transaction - * Required - * Type: double - */ - Amount: number; - - /** - * The date of the Transfer YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** The identifier of the Bank Transfer */ - BankTransferID?: string | null; - - /** - * The currency rate - * Type: double - */ - CurrencyRate?: number | null; - - /** The Bank Transaction ID for the source account */ - FromBankTransactionID?: string | null; - - /** The Bank Transaction ID for the destination account */ - ToBankTransactionID?: string | null; - - /** Boolean to indicate if a Bank Transfer has an attachment */ - HasAttachments?: boolean | null; - - /** UTC timestamp of creation date of bank transfer */ - CreatedDateUTC?: Date | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface BatchPayments { - BatchPayments1?: Array; - } - - export interface BatchPayment { - Account?: Account; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Reference?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Particulars?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Code?: string | null; - - /** - * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - * Max length: 18 - */ - Details?: string | null; - - /** - * (UK Only) Only shows on the statement line in Xero. Max length =18 - * Max length: 18 - */ - Narrative?: string | null; - - /** The Xero generated unique identifier for the bank transaction (read-only) */ - BatchPaymentID?: string | null; - - /** Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 */ - DateString?: string | null; - - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * Type: DateOnly - */ - Date?: Date | null; - - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - * Type: double - */ - Amount?: number | null; - Payments?: Array; - - /** PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) */ - Type?: BatchPaymentType | null; - - /** AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. */ - Status?: PaymentStatus | null; - - /** The total of the payments that make up the batch (read-only) */ - TotalAmount?: string | null; - - /** UTC timestamp of last update to the payment */ - UpdatedDateUTC?: Date | null; - - /** Booelan that tells you if the batch payment has been reconciled (read-only) */ - IsReconciled?: string | null; - } - - export interface Payment { - Invoice?: Invoice; - CreditNote?: CreditNote; - Prepayment?: Prepayment; - Overpayment?: Overpayment; - - /** Number of invoice or credit note you are applying payment to e.g.INV-4003 */ - InvoiceNumber?: string | null; - - /** Number of invoice or credit note you are applying payment to e.g. INV-4003 */ - CreditNoteNumber?: string | null; - Account?: Account; - - /** Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) */ - Code?: string | null; - - /** - * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - * Type: DateOnly - */ - Date?: Date | null; - - /** - * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - * Type: double - */ - Amount?: number | null; - - /** An optional description for the payment e.g. Direct Debit */ - Reference?: string | null; - - /** An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET */ - IsReconciled?: boolean | null; - - /** The status of the payment. */ - Status?: PaymentStatus | null; - - /** See Payment Types. */ - PaymentType?: PaymentPaymentType | null; - - /** UTC timestamp of last update to the payment */ - UpdatedDateUTC?: Date | null; - - /** The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - PaymentID?: string | null; - - /** The suppliers bank account number the payment is being made to */ - BankAccountNumber?: string | null; - - /** The suppliers bank account number the payment is being made to */ - Particulars?: string | null; - - /** The information to appear on the supplier's bank account */ - Details?: string | null; - - /** A boolean to indicate if a contact has an validation errors */ - HasAccount?: boolean | null; - - /** A boolean to indicate if a contact has an validation errors */ - HasValidationErrors?: boolean | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface Invoice { - - /** See Invoice Types */ - Type?: InvoiceType | null; - Contact?: Contact; - - /** See LineItems */ - LineItems?: Array; - - /** - * Date invoice was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** - * Date invoice is due � YYYY-MM-DD - * Type: DateOnly - */ - DueDate?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** - * ACCREC � Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) - * Max length: 255 - */ - InvoiceNumber?: string | null; - - /** - * ACCREC only � additional reference number (max length = 255) - * Max length: 255 - */ - Reference?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ - Url?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) - * Type: double - */ - CurrencyRate?: number | null; - - /** See Invoice Status Codes */ - Status?: InvoiceStatus | null; - - /** Boolean to set whether the invoice in the Xero app should be marked as �sent�. This can be set only on invoices that have been approved */ - SentToContact?: boolean | null; - - /** - * Shown on sales invoices (Accounts Receivable) when this has been set - * Type: DateOnly - */ - ExpectedPaymentDate?: Date | null; - - /** - * Shown on bills (Accounts Payable) when this has been set - * Type: DateOnly - */ - PlannedPaymentDate?: Date | null; - - /** - * CIS deduction for UK contractors - * Type: double - */ - CISDeduction?: number | null; - - /** - * Total of invoice excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on invoice - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts - * Type: double - */ - Total?: number | null; - - /** - * Total of discounts applied on the invoice line items - * Type: double - */ - TotalDiscount?: number | null; - - /** Xero generated unique identifier for invoice */ - InvoiceID?: string | null; - - /** boolean to indicate if an invoice has an attachment */ - HasAttachments?: boolean | null; - - /** boolean to indicate if an invoice has a discount */ - IsDiscounted?: boolean | null; - - /** See Payments */ - Payments?: Array; - - /** See Prepayments */ - Prepayments?: Array; - - /** See Overpayments */ - Overpayments?: Array; - - /** - * Amount remaining to be paid on invoice - * Type: double - */ - AmountDue?: number | null; - - /** - * Sum of payments received for invoice - * Type: double - */ - AmountPaid?: number | null; - - /** - * The date the invoice was fully paid. Only returned on fully paid invoices - * Type: DateOnly - */ - FullyPaidOnDate?: Date | null; - - /** - * Sum of all credit notes, over-payments and pre-payments applied to invoice - * Type: double - */ - AmountCredited?: number | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Details of credit notes that have been applied to an invoice */ - CreditNotes?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - - /** A boolean to indicate if a invoice has an validation errors */ - HasErrors?: boolean | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - } - - export enum InvoiceType { ACCPAY = 0, ACCPAYCREDIT = 1, APOVERPAYMENT = 2, APPREPAYMENT = 3, ACCREC = 4, ACCRECCREDIT = 5, AROVERPAYMENT = 6, ARPREPAYMENT = 7 } - - export enum InvoiceStatus { DRAFT = 0, SUBMITTED = 1, DELETED = 2, AUTHORISED = 3, PAID = 4, VOIDED = 5 } - - export interface Prepayment { - - /** See Prepayment Types */ - Type?: PrepaymentType | null; - Contact?: Contact; - - /** - * The date the prepayment is created YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** See Prepayment Status Codes */ - Status?: PrepaymentStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Prepayment Line Items */ - LineItems?: Array; - - /** - * The subtotal of the prepayment excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * The total tax on the prepayment - * Type: double - */ - TotalTax?: number | null; - - /** - * The total of the prepayment(subtotal + total tax) - * Type: double - */ - Total?: number | null; - - /** Returns Invoice number field. Reference field isn't available. */ - Reference?: string | null; - - /** UTC timestamp of last update to the prepayment */ - UpdatedDateUTC?: Date | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** Xero generated unique identifier */ - PrepaymentID?: string | null; - - /** - * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The remaining credit balance on the prepayment - * Type: double - */ - RemainingCredit?: number | null; - - /** See Allocations */ - Allocations?: Array; - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount?: number | null; - - /** boolean to indicate if a prepayment has an attachment */ - HasAttachments?: boolean | null; - - /** See Attachments */ - Attachments?: Array; - } - - export enum PrepaymentType { 'RECEIVE-PREPAYMENT' = 0, 'SPEND-PREPAYMENT' = 1, ARPREPAYMENT = 2, APPREPAYMENT = 3 } - - export enum PrepaymentStatus { AUTHORISED = 0, PAID = 1, VOIDED = 2 } - - export interface Allocation { - - /** Required */ - Invoice: Invoice; - Overpayment?: Overpayment; - Prepayment?: Prepayment; - CreditNote?: CreditNote; - - /** - * the amount being applied to the invoice - * Required - * Type: double - */ - Amount: number; - - /** - * the date the allocation is applied YYYY-MM-DD. - * Required - * Type: DateOnly - */ - Date: Date; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface Overpayment { - - /** See Overpayment Types */ - Type?: OverpaymentType | null; - Contact?: Contact; - - /** - * The date the overpayment is created YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** See Overpayment Status Codes */ - Status?: PrepaymentStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Overpayment Line Items */ - LineItems?: Array; - - /** - * The subtotal of the overpayment excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * The total tax on the overpayment - * Type: double - */ - TotalTax?: number | null; - - /** - * The total of the overpayment (subtotal + total tax) - * Type: double - */ - Total?: number | null; - - /** UTC timestamp of last update to the overpayment */ - UpdatedDateUTC?: Date | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** Xero generated unique identifier */ - OverpaymentID?: string | null; - - /** - * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The remaining credit balance on the overpayment - * Type: double - */ - RemainingCredit?: number | null; - - /** See Allocations */ - Allocations?: Array; - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount?: number | null; - - /** See Payments */ - Payments?: Array; - - /** boolean to indicate if a overpayment has an attachment */ - HasAttachments?: boolean | null; - - /** See Attachments */ - Attachments?: Array; - } - - export enum OverpaymentType { 'RECEIVE-OVERPAYMENT' = 0, 'SPEND-OVERPAYMENT' = 1, AROVERPAYMENT = 2 } - - export interface CreditNote { - - /** See Credit Note Types */ - Type?: CreditNoteType | null; - Contact?: Contact; - - /** - * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** See Credit Note Status Codes */ - Status?: InvoiceStatus | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Invoice Line Items */ - LineItems?: Array; - - /** - * The subtotal of the credit note excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * The total tax on the credit note - * Type: double - */ - TotalTax?: number | null; - - /** - * The total of the Credit Note(subtotal + total tax) - * Type: double - */ - Total?: number | null; - - /** UTC timestamp of last update to the credit note */ - UpdatedDateUTC?: Date | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * Date when credit note was fully paid(UTC format) - * Type: DateOnly - */ - FullyPaidOnDate?: Date | null; - - /** Xero generated unique identifier */ - CreditNoteID?: string | null; - - /** ACCRECCREDIT � Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) */ - CreditNoteNumber?: string | null; - - /** ACCRECCREDIT only � additional reference number */ - Reference?: string | null; - - /** boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) */ - SentToContact?: boolean | null; - - /** - * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used - * Type: double - */ - CurrencyRate?: number | null; - - /** - * The remaining credit balance on the Credit Note - * Type: double - */ - RemainingCredit?: number | null; - - /** See Allocations */ - Allocations?: Array; - - /** - * The amount of applied to an invoice - * Type: double - */ - AppliedAmount?: number | null; - - /** See Payments */ - Payments?: Array; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** boolean to indicate if a credit note has an attachment */ - HasAttachments?: boolean | null; - - /** A boolean to indicate if a credit note has an validation errors */ - HasErrors?: boolean | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum CreditNoteType { ACCPAYCREDIT = 0, ACCRECCREDIT = 1 } - - export enum PaymentStatus { AUTHORISED = 0, DELETED = 1 } - - export enum PaymentPaymentType { ACCRECPAYMENT = 0, ACCPAYPAYMENT = 1, ARCREDITPAYMENT = 2, APCREDITPAYMENT = 3, AROVERPAYMENTPAYMENT = 4, ARPREPAYMENTPAYMENT = 5, APPREPAYMENTPAYMENT = 6, APOVERPAYMENTPAYMENT = 7 } - - export enum BatchPaymentType { PAYBATCH = 0, RECBATCH = 1 } - - - /** Bank details for use on a batch payment stored with each contact */ - export interface BatchPaymentDetails { - - /** Bank account number for use with Batch Payments */ - BankAccountNumber?: string | null; - - /** Name of bank for use with Batch Payments */ - BankAccountName?: string | null; - - /** - * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - * Max length: 18 - */ - Details?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Code?: string | null; - - /** - * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - * Max length: 12 - */ - Reference?: string | null; - } - - export interface BrandingThemes { - BrandingThemes1?: Array; - } - - export interface PaymentServices { - PaymentServices1?: Array; - } - - export interface PaymentService { - - /** Xero identifier */ - PaymentServiceID?: string | null; - - /** Name of payment service */ - PaymentServiceName?: string | null; - - /** The custom payment URL */ - PaymentServiceUrl?: string | null; - - /** The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card */ - PayNowText?: string | null; - - /** This will always be CUSTOM for payment services created via the API. */ - PaymentServiceType?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface Contacts { - Contacts1?: Array; - } - - export interface CISSettings { - CISSettings1?: Array; - } - - export interface CISSetting { - - /** Boolean that describes if the contact is a CIS Subcontractor */ - CISEnabled?: boolean | null; - - /** - * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Rate?: number | null; - } - - export interface CISOrgSetting { - - /** true or false - Boolean that describes if the organisation is a CIS Contractor */ - CISContractorEnabled?: boolean | null; - - /** true or false - Boolean that describes if the organisation is a CIS SubContractor */ - CISSubContractorEnabled?: boolean | null; - - /** - * CIS Deduction rate for the organisation - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Rate?: number | null; - } - - export interface ContactGroups { - ContactGroups1?: Array; - } - - export interface RequestEmpty { - - /** Need at least one field to create an empty JSON payload */ - Status?: string | null; - } - - export interface CreditNotes { - CreditNotes1?: Array; - } - - export interface Allocations { - Allocations1?: Array; - } - - export interface Currencies { - Currencies1?: Array; - } - - export interface Currency { - - /** 3 letter alpha code for the currency � see list of currency codes */ - Code?: AccountCurrencyCode | null; - - /** Name of Currency */ - Description?: string | null; - } - - - /** 3 letter alpha code for the currency � see list of currency codes */ - export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - export interface Employees { - Employees1?: Array; - } - - export interface Employee { - - /** The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - EmployeeID?: string | null; - - /** Current status of an employee � see contact status types */ - Status?: ContactContactStatus | null; - - /** - * First name of an employee (max length = 255) - * Max length: 255 - */ - FirstName?: string | null; - - /** - * Last name of an employee (max length = 255) - * Max length: 255 - */ - LastName?: string | null; - ExternalLink?: ExternalLink; - UpdatedDateUTC?: Date | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface ExternalLink { - - /** See External link types */ - LinkType?: ExternalLinkLinkType | null; - - /** URL for service e.g. http://twitter.com/xeroapi */ - Url?: string | null; - Description?: string | null; - } - - export enum ExternalLinkLinkType { Facebook = 0, GooglePlus = 1, LinkedIn = 2, Twitter = 3, Website = 4 } - - export interface ExpenseClaims { - ExpenseClaims1?: Array; - } - - export interface ExpenseClaim { - - /** Xero generated unique identifier for an expense claim */ - ExpenseClaimID?: string | null; - - /** Current status of an expense claim � see status types */ - Status?: ExpenseClaimStatus | null; - - /** See Payments */ - Payments?: Array; - User?: User; - Receipts?: Array; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** - * The total of an expense claim being paid - * Type: double - */ - Total?: number | null; - - /** - * The amount due to be paid for an expense claim - * Type: double - */ - AmountDue?: number | null; - - /** - * The amount still to pay for an expense claim - * Type: double - */ - AmountPaid?: number | null; - - /** - * The date when the expense claim is due to be paid YYYY-MM-DD - * Type: DateOnly - */ - PaymentDueDate?: Date | null; - - /** - * The date the expense claim will be reported in Xero YYYY-MM-DD - * Type: DateOnly - */ - ReportingDate?: Date | null; - - /** The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 */ - ReceiptID?: string | null; - } - - export enum ExpenseClaimStatus { SUBMITTED = 0, AUTHORISED = 1, PAID = 2, VOIDED = 3, DELETED = 4 } - - export interface User { - - /** Xero identifier */ - UserID?: string | null; - - /** Email address of user */ - EmailAddress?: string | null; - - /** First name of user */ - FirstName?: string | null; - - /** Last name of user */ - LastName?: string | null; - - /** Timestamp of last change to user */ - UpdatedDateUTC?: Date | null; - - /** Boolean to indicate if user is the subscriber */ - IsSubscriber?: boolean | null; - - /** User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) */ - OrganisationRole?: UserOrganisationRole | null; - } - - export enum UserOrganisationRole { READONLY = 0, INVOICEONLY = 1, STANDARD = 2, FINANCIALADVISER = 3, MANAGEDCLIENT = 4, CASHBOOKCLIENT = 5, UNKNOWN = 6 } - - export interface Receipt { - - /** - * Date of receipt � YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - Contact?: Contact; - LineItems?: Array; - User?: User; - - /** Additional reference number */ - Reference?: string | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** - * Total of receipt excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on receipt - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total?: number | null; - - /** Xero generated unique identifier for receipt */ - ReceiptID?: string | null; - - /** Current status of receipt � see status types */ - Status?: ReceiptStatus | null; - - /** Xero generated sequence number for receipt in current claim for a given user */ - ReceiptNumber?: string | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** boolean to indicate if a receipt has an attachment */ - HasAttachments?: boolean | null; - - /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ - Url?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - - export enum ReceiptStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, DECLINED = 3, VOIDED = 4 } - - export interface HistoryRecords { - HistoryRecords1?: Array; - } - - export interface HistoryRecord { - - /** details */ - Details?: string | null; - - /** Name of branding theme */ - Changes?: string | null; - - /** has a value of 0 */ - User?: string | null; - - /** UTC timestamp of creation date of branding theme */ - DateUTC?: Date | null; - } - - export interface Invoices { - Invoices1?: Array; - } - - export interface OnlineInvoices { - OnlineInvoices1?: Array; - } - - export interface OnlineInvoice { - - /** the URL to an online invoice */ - OnlineInvoiceUrl?: string | null; - } - - export interface InvoiceReminders { - InvoiceReminders1?: Array; - } - - export interface InvoiceReminder { - - /** setting for on or off */ - Enabled?: boolean | null; - } - - export interface Items { - Items1?: Array; - } - - export interface Item { - - /** - * User defined item code (max length = 30) - * Required - * Max length: 30 - */ - Code: string; - - /** The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item */ - InventoryAssetAccountCode?: string | null; - - /** - * The name of the item (max length = 50) - * Max length: 50 - */ - Name?: string | null; - - /** Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. */ - IsSold?: boolean | null; - - /** Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. */ - IsPurchased?: boolean | null; - - /** - * The sales description of the item (max length = 4000) - * Max length: 4000 - */ - Description?: string | null; - - /** - * The purchase description of the item (max length = 4000) - * Max length: 4000 - */ - PurchaseDescription?: string | null; - PurchaseDetails?: Purchase; - SalesDetails?: Purchase; - - /** True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. */ - IsTrackedAsInventory?: boolean | null; - - /** - * The value of the item on hand. Calculated using average cost accounting. - * Type: double - */ - TotalCostPool?: number | null; - - /** - * The quantity of the item on hand - * Type: double - */ - QuantityOnHand?: number | null; - - /** Last modified date in UTC format */ - UpdatedDateUTC?: Date | null; - - /** The Xero identifier for an Item */ - ItemID?: string | null; - - /** Status of object */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export interface Purchase { - - /** - * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. - * Type: double - */ - UnitPrice?: number | null; - - /** Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items */ - AccountCode?: string | null; - - /** Cost of goods sold account. Only applicable to the purchase details of tracked items. */ - COGSAccountCode?: string | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - } - - export interface Journals { - Journals1?: Array; - } - - export interface Journal { - - /** Xero identifier */ - JournalID?: string | null; - - /** - * Date the journal was posted - * Type: DateOnly - */ - JournalDate?: Date | null; - - /** - * Xero generated journal number - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - JournalNumber?: number | null; - - /** Created date UTC format */ - CreatedDateUTC?: Date | null; - - /** reference field for additional indetifying information */ - Reference?: string | null; - - /** The identifier for the source transaction (e.g. InvoiceID) */ - SourceID?: string | null; - - /** The journal source type. The type of transaction that created the journal */ - SourceType?: JournalSourceType | null; - - /** See JournalLines */ - JournalLines?: Array; - } - - export enum JournalSourceType { ACCREC = 0, ACCPAY = 1, ACCRECCREDIT = 2, ACCPAYCREDIT = 3, ACCRECPAYMENT = 4, ACCPAYPAYMENT = 5, ARCREDITPAYMENT = 6, APCREDITPAYMENT = 7, CASHREC = 8, CASHPAID = 9, TRANSFER = 10, ARPREPAYMENT = 11, APPREPAYMENT = 12, AROVERPAYMENT = 13, APOVERPAYMENT = 14, EXPCLAIM = 15, EXPPAYMENT = 16, MANJOURNAL = 17, PAYSLIP = 18, WAGEPAYABLE = 19, INTEGRATEDPAYROLLPE = 20, INTEGRATEDPAYROLLPT = 21, EXTERNALSPENDMONEY = 22, INTEGRATEDPAYROLLPTPAYMENT = 23, INTEGRATEDPAYROLLCN = 24 } - - export interface JournalLine { - - /** Xero identifier for Journal */ - JournalLineID?: string | null; - - /** See Accounts */ - AccountID?: string | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** See Account Types */ - AccountType?: AccountType | null; - - /** See AccountCodes */ - AccountName?: string | null; - - /** The description from the source transaction line item. Only returned if populated. */ - Description?: string | null; - - /** - * Net amount of journal line. This will be a positive value for a debit and negative for a credit - * Type: double - */ - NetAmount?: number | null; - - /** - * Gross amount of journal line (NetAmount + TaxAmount). - * Type: double - */ - GrossAmount?: number | null; - - /** - * Total tax on a journal line - * Type: double - */ - TaxAmount?: number | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** see TaxRates */ - TaxName?: string | null; - - /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ - TrackingCategories?: Array; - } - - export interface TrackingCategory { - - /** The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - TrackingCategoryID?: string | null; - - /** The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f */ - TrackingOptionID?: string | null; - - /** - * The name of the tracking category e.g. Department, Region (max length = 100) - * Max length: 100 - */ - Name?: string | null; - - /** - * The option name of the tracking option e.g. East, West (max length = 100) - * Max length: 100 - */ - Option?: string | null; - - /** The status of a tracking category */ - Status?: AccountStatus | null; - - /** See Tracking Options */ - Options?: Array; - } - - export interface TrackingOption { - - /** The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a */ - TrackingOptionID?: string | null; - - /** - * The name of the tracking option e.g. Marketing, East (max length = 50) - * Max length: 50 - */ - Name?: string | null; - - /** The status of a tracking option */ - Status?: AccountStatus | null; - - /** Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - TrackingCategoryID?: string | null; - } - - export interface LinkedTransactions { - LinkedTransactions1?: Array; - } - - export interface LinkedTransaction { - - /** Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice */ - SourceTransactionID?: string | null; - - /** The line item identifier from the source transaction. */ - SourceLineItemID?: string | null; - - /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ - ContactID?: string | null; - - /** Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice */ - TargetTransactionID?: string | null; - - /** The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. */ - TargetLineItemID?: string | null; - - /** The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ - LinkedTransactionID?: string | null; - - /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ - Status?: LinkedTransactionStatus | null; - - /** This will always be BILLABLEEXPENSE. More types may be added in future. */ - Type?: LinkedTransactionType | null; - - /** The last modified date in UTC format */ - UpdatedDateUTC?: Date | null; - - /** The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. */ - SourceTransactionTypeCode?: LinkedTransactionSourceTransactionTypeCode | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum LinkedTransactionStatus { APPROVED = 0, DRAFT = 1, ONDRAFT = 2, BILLED = 3, VOIDED = 4 } - - export enum LinkedTransactionType { BILLABLEEXPENSE = 0 } - - export enum LinkedTransactionSourceTransactionTypeCode { ACCPAY = 0, SPEND = 1 } - - export interface ManualJournals { - ManualJournals1?: Array; - } - - export interface ManualJournal { - - /** - * Description of journal being posted - * Required - */ - Narration: string; - - /** See JournalLines */ - JournalLines?: Array; - - /** - * Date journal was posted � YYYY-MM-DD - * Type: DateOnly - */ - Date?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** See Manual Journal Status Codes */ - Status?: ManualJournalStatus | null; - - /** Url link to a source document � shown as �Go to [appName]� in the Xero app */ - Url?: string | null; - - /** Boolean � default is true if not specified */ - ShowOnCashBasisReports?: boolean | null; - - /** Boolean to indicate if a manual journal has an attachment */ - HasAttachments?: boolean | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** The Xero identifier for a Manual Journal */ - ManualJournalID?: string | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - - export interface ManualJournalLine { - - /** - * total for line. Debits are positive, credits are negative value - * Type: double - */ - LineAmount?: number | null; - - /** See Accounts */ - AccountCode?: string | null; - - /** Description for journal line */ - Description?: string | null; - - /** The tax type from TaxRates */ - TaxType?: string | null; - - /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ - Tracking?: Array; - - /** - * The calculated tax amount based on the TaxType and LineAmount - * Type: double - */ - TaxAmount?: number | null; - - /** is the line blank */ - IsBlank?: boolean | null; - } - - export enum ManualJournalStatus { DRAFT = 0, POSTED = 1, DELETED = 2, VOIDED = 3, ARCHIVED = 4 } - - export interface Organisations { - Organisations1?: Array; - } - - export interface Organisation { - - /** Unique Xero identifier */ - OrganisationID?: string | null; - - /** Display a unique key used for Xero-to-Xero transactions */ - APIKey?: string | null; - - /** Display name of organisation shown in Xero */ - Name?: string | null; - - /** Organisation name shown on Reports */ - LegalName?: string | null; - - /** Boolean to describe if organisation is registered with a local tax authority i.e. true, false */ - PaysTax?: boolean | null; - - /** See Version Types */ - Version?: OrganisationVersion | null; - - /** Organisation Type */ - OrganisationType?: OrganisationOrganisationType | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - BaseCurrency?: AccountCurrencyCode | null; - CountryCode?: OrganisationCountryCode | null; - - /** Boolean to describe if organisation is a demo company. */ - IsDemoCompany?: boolean | null; - - /** Will be set to ACTIVE if you can connect to organisation via the Xero API */ - OrganisationStatus?: string | null; - - /** Shows for New Zealand, Australian and UK organisations */ - RegistrationNumber?: string | null; - - /** Shown if set. US Only. */ - EmployerIdentificationNumber?: string | null; - - /** Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). */ - TaxNumber?: string | null; - - /** - * Calendar day e.g. 0-31 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - FinancialYearEndDay?: number | null; - - /** - * Calendar Month e.g. 1-12 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - FinancialYearEndMonth?: number | null; - - /** The accounting basis used for tax returns. See Sales Tax Basis */ - SalesTaxBasis?: OrganisationSalesTaxBasis | null; - - /** The frequency with which tax returns are processed. See Sales Tax Period */ - SalesTaxPeriod?: OrganisationSalesTaxPeriod | null; - - /** The default for LineAmountTypes on sales transactions */ - DefaultSalesTax?: string | null; - - /** The default for LineAmountTypes on purchase transactions */ - DefaultPurchasesTax?: string | null; - - /** - * Shown if set. See lock dates - * Type: DateOnly - */ - PeriodLockDate?: Date | null; - - /** - * Shown if set. See lock dates - * Type: DateOnly - */ - EndOfYearLockDate?: Date | null; - - /** Timestamp when the organisation was created in Xero */ - CreatedDateUTC?: Date | null; - - /** Timezone specifications */ - Timezone?: OrganisationTimezone | null; - - /** Organisation Type */ - OrganisationEntityType?: OrganisationOrganisationType | null; - - /** A unique identifier for the organisation. Potential uses. */ - ShortCode?: string | null; - - /** Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) */ - Class?: OrganisationClass | null; - - /** BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) */ - Edition?: OrganisationEdition | null; - - /** Description of business type as defined in Organisation settings */ - LineOfBusiness?: string | null; - - /** Address details for organisation � see Addresses */ - Addresses?: Array
; - - /** Phones details for organisation � see Phones */ - Phones?: Array; - - /** Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below */ - ExternalLinks?: Array; - PaymentTerms?: PaymentTerm; - } - - export enum OrganisationVersion { AU = 0, NZ = 1, GLOBAL = 2, UK = 3, US = 4, AUONRAMP = 5, NZONRAMP = 6, GLOBALONRAMP = 7, UKONRAMP = 8, USONRAMP = 9 } - - export enum OrganisationOrganisationType { ACCOUNTING_PRACTICE = 0, COMPANY = 1, CHARITY = 2, CLUB_OR_SOCIETY = 3, LOOK_THROUGH_COMPANY = 4, NOT_FOR_PROFIT = 5, PARTNERSHIP = 6, S_CORPORATION = 7, SELF_MANAGED_SUPERANNUATION_FUND = 8, SOLE_TRADER = 9, SUPERANNUATION_FUND = 10, TRUST = 11 } - - export enum OrganisationCountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - export enum OrganisationSalesTaxBasis { PAYMENTS = 0, INVOICE = 1, NONE = 2, CASH = 3, ACCRUAL = 4, FLATRATECASH = 5, FLATRATEACCRUAL = 6, ACCRUALS = 7 } - - export enum OrganisationSalesTaxPeriod { MONTHLY = 0, QUARTERLY1 = 1, QUARTERLY2 = 2, QUARTERLY3 = 3, ANNUALLY = 4, ONEMONTHS = 5, TWOMONTHS = 6, SIXMONTHS = 7, '1MONTHLY' = 8, '2MONTHLY' = 9, '3MONTHLY' = 10, '6MONTHLY' = 11, QUARTERLY = 12, YEARLY = 13, NONE = 14 } - - export enum OrganisationTimezone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } - - export enum OrganisationClass { DEMO = 0, TRIAL = 1, STARTER = 2, STANDARD = 3, PREMIUM = 4, PREMIUM_20 = 5, PREMIUM_50 = 6, PREMIUM_100 = 7, LEDGER = 8, GST_CASHBOOK = 9, NON_GST_CASHBOOK = 10 } - - export enum OrganisationEdition { BUSINESS = 0, PARTNER = 1 } - - export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - - /** Timezone specifications */ - export enum TimeZone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } - - export enum PaymentTermType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } - - export interface Overpayments { - Overpayments1?: Array; - } - - export interface Payments { - Payments1?: Array; - } - - export interface PaymentDelete { - - /** - * The status of the payment. - * Required - */ - Status: string; - } - - export interface Prepayments { - Prepayments1?: Array; - } - - export interface PurchaseOrders { - PurchaseOrders1?: Array; - } - - export interface PurchaseOrder { - Contact?: Contact; - - /** See LineItems */ - LineItems?: Array; - - /** - * Date purchase order was issued � YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** - * Date the goods are to be delivered � YYYY-MM-DD - * Type: DateOnly - */ - DeliveryDate?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) */ - PurchaseOrderNumber?: string | null; - - /** Additional reference number */ - Reference?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** See Purchase Order Status Codes */ - Status?: PurchaseOrderStatus | null; - - /** Boolean to set whether the purchase order should be marked as �sent�. This can be set only on purchase orders that have been approved or billed */ - SentToContact?: boolean | null; - - /** The address the goods are to be delivered to */ - DeliveryAddress?: string | null; - - /** The person that the delivery is going to */ - AttentionTo?: string | null; - - /** The phone number for the person accepting the delivery */ - Telephone?: string | null; - - /** A free text feild for instructions (500 characters max) */ - DeliveryInstructions?: string | null; - - /** - * The date the goods are expected to arrive. - * Type: DateOnly - */ - ExpectedArrivalDate?: Date | null; - - /** Xero generated unique identifier for purchase order */ - PurchaseOrderID?: string | null; - - /** - * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. - * Type: double - */ - CurrencyRate?: number | null; - - /** - * Total of purchase order excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on purchase order - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total?: number | null; - - /** - * Total of discounts applied on the purchase order line items - * Type: double - */ - TotalDiscount?: number | null; - - /** boolean to indicate if a purchase order has an attachment */ - HasAttachments?: boolean | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - - /** Displays array of warning messages from the API */ - Warnings?: Array; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - - export enum PurchaseOrderStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, BILLED = 3, DELETED = 4 } - - export interface Quotes { - Quotes1?: Array; - } - - export interface Quote { - - /** QuoteID GUID is automatically generated and is returned after create or GET. */ - QuoteID?: string | null; - - /** - * Unique alpha numeric code identifying a quote (Max Length = 255) - * Max length: 255 - */ - QuoteNumber?: string | null; - - /** - * Additional reference number - * Max length: 4000 - */ - Reference?: string | null; - - /** - * Terms of the quote - * Max length: 4000 - */ - Terms?: string | null; - Contact?: Contact; - - /** See LineItems */ - LineItems?: Array; - - /** - * Date quote was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - * Type: DateOnly - */ - Date?: Date | null; - - /** Date the quote was issued (YYYY-MM-DD) */ - DateString?: string | null; - - /** - * Date the quote expires � YYYY-MM-DD. - * Type: DateOnly - */ - ExpiryDate?: Date | null; - - /** Date the quote expires � YYYY-MM-DD. */ - ExpiryDateString?: string | null; - - /** The status of the quote. */ - Status?: QuoteStatus | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** - * The currency rate for a multicurrency quote - * Type: double - */ - CurrencyRate?: number | null; - - /** - * Total of quote excluding taxes. - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on quote - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts - * Type: double - */ - Total?: number | null; - - /** - * Total of discounts applied on the quote line items - * Type: double - */ - TotalDiscount?: number | null; - - /** - * Title text for the quote - * Max length: 100 - */ - Title?: string | null; - - /** - * Summary text for the quote - * Max length: 3000 - */ - Summary?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** Last modified date UTC format */ - UpdatedDateUTC?: Date | null; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: QuoteLineAmountTypes | null; - - /** A string to indicate if a invoice status */ - StatusAttributeString?: string | null; - - /** Displays array of validation error messages from the API */ - ValidationErrors?: Array; - } - - export enum QuoteStatus { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } - - export enum QuoteLineAmountTypes { EXCLUSIVE = 0, INCLUSIVE = 1, NOTAX = 2 } - - - /** The status of the quote. */ - export enum QuoteStatusCodes { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } - - export interface Receipts { - Receipts1?: Array; - } - - export interface RepeatingInvoices { - RepeatingInvoices1?: Array; - } - - export interface RepeatingInvoice { - - /** See Invoice Types */ - Type?: RepeatingInvoiceType | null; - Contact?: Contact; - Schedule?: Schedule; - - /** See LineItems */ - LineItems?: Array; - - /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ - LineAmountTypes?: BankTransactionLineAmountTypes | null; - - /** ACCREC only � additional reference number */ - Reference?: string | null; - - /** See BrandingThemes */ - BrandingThemeID?: string | null; - - /** 3 letter alpha code for the currency � see list of currency codes */ - CurrencyCode?: AccountCurrencyCode | null; - - /** One of the following - DRAFT or AUTHORISED � See Invoice Status Codes */ - Status?: RepeatingInvoiceStatus | null; - - /** - * Total of invoice excluding taxes - * Type: double - */ - SubTotal?: number | null; - - /** - * Total tax on invoice - * Type: double - */ - TotalTax?: number | null; - - /** - * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - * Type: double - */ - Total?: number | null; - - /** Xero generated unique identifier for repeating invoice template */ - RepeatingInvoiceID?: string | null; - - /** Xero generated unique identifier for repeating invoice template */ - ID?: string | null; - - /** boolean to indicate if an invoice has an attachment */ - HasAttachments?: boolean | null; - - /** Displays array of attachments from the API */ - Attachments?: Array; - } - - export enum RepeatingInvoiceType { ACCPAY = 0, ACCREC = 1 } - - export interface Schedule { - - /** - * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - Period?: number | null; - - /** One of the following - WEEKLY or MONTHLY */ - Unit?: ScheduleUnit | null; - - /** - * Integer used with due date type e.g 20 (of following month), 31 (of current month) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - DueDate?: number | null; - - /** the payment terms */ - DueDateType?: ScheduleDueDateType | null; - - /** - * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) - * Type: DateOnly - */ - StartDate?: Date | null; - - /** - * The calendar date of the next invoice in the schedule to be generated - * Type: DateOnly - */ - NextScheduledDate?: Date | null; - - /** - * Invoice end date � only returned if the template has an end date set - * Type: DateOnly - */ - EndDate?: Date | null; - } - - export enum ScheduleUnit { WEEKLY = 0, MONTHLY = 1 } - - export enum ScheduleDueDateType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, DAYSAFTERINVOICEDATE = 2, DAYSAFTERINVOICEMONTH = 3, OFCURRENTMONTH = 4, OFFOLLOWINGMONTH = 5 } - - export enum RepeatingInvoiceStatus { DRAFT = 0, AUTHORISED = 1, DELETED = 2 } - - export interface ReportWithRows { - Reports?: Array; - } - - export interface ReportWithRow { - - /** Report id */ - ReportID?: string | null; - - /** Name of the report */ - ReportName?: string | null; - - /** Title of the report */ - ReportTitle?: string | null; - - /** The type of report (BalanceSheet,ProfitLoss, etc) */ - ReportType?: string | null; - - /** Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) */ - ReportTitles?: Array; - - /** Date of report */ - ReportDate?: string | null; - Rows?: Array; - - /** Updated Date */ - UpdatedDateUTC?: Date | null; - Fields?: Array; - } - - export interface ReportRows { - RowType?: ReportRowsRowType | null; - Title?: string | null; - Cells?: Array; - Rows?: Array; - } - - export enum ReportRowsRowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } - - export interface ReportCell { - Value?: string | null; - Attributes?: Array; - } - - export interface ReportAttribute { - Id?: string | null; - Value?: string | null; - } - - export interface ReportRow { - RowType?: ReportRowsRowType | null; - Title?: string | null; - Cells?: Array; - } - - export interface ReportFields { - FieldID?: string | null; - Description?: string | null; - Value?: string | null; - } - - export enum RowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } - - export interface Reports { - Reports1?: Array; - } - - export interface Report { - - /** See Prepayment Types */ - ReportID?: string | null; - - /** See Prepayment Types */ - ReportName?: string | null; - - /** See Prepayment Types */ - ReportType?: ReportReportType | null; - - /** See Prepayment Types */ - ReportTitle?: string | null; - - /** Date of report */ - ReportDate?: string | null; - - /** Updated Date */ - UpdatedDateUTC?: Date | null; - Contacts?: Array; - } - - export enum ReportReportType { AgedPayablesByContact = 0 } - - export interface TenNinteyNineContact { - - /** - * Box 1 on 1099 Form - * Type: double - */ - Box1?: number | null; - - /** - * Box 2 on 1099 Form - * Type: double - */ - Box2?: number | null; - - /** - * Box 3 on 1099 Form - * Type: double - */ - Box3?: number | null; - - /** - * Box 4 on 1099 Form - * Type: double - */ - Box4?: number | null; - - /** - * Box 5 on 1099 Form - * Type: double - */ - Box5?: number | null; - - /** - * Box 6 on 1099 Form - * Type: double - */ - Box6?: number | null; - - /** - * Box 7 on 1099 Form - * Type: double - */ - Box7?: number | null; - - /** - * Box 8 on 1099 Form - * Type: double - */ - Box8?: number | null; - - /** - * Box 9 on 1099 Form - * Type: double - */ - Box9?: number | null; - - /** - * Box 10 on 1099 Form - * Type: double - */ - Box10?: number | null; - - /** - * Box 11 on 1099 Form - * Type: double - */ - Box11?: number | null; - - /** - * Box 13 on 1099 Form - * Type: double - */ - Box13?: number | null; - - /** - * Box 14 on 1099 Form - * Type: double - */ - Box14?: number | null; - - /** Contact name on 1099 Form */ - Name?: string | null; - - /** Contact Fed Tax ID type */ - FederalTaxIDType?: string | null; - - /** Contact city on 1099 Form */ - City?: string | null; - - /** Contact zip on 1099 Form */ - Zip?: string | null; - - /** Contact State on 1099 Form */ - State?: string | null; - - /** Contact email on 1099 Form */ - Email?: string | null; - - /** Contact address on 1099 Form */ - StreetAddress?: string | null; - - /** Contact tax id on 1099 Form */ - TaxID?: string | null; - - /** Contact contact id */ - ContactId?: string | null; - } - - export interface TaxRates { - TaxRates1?: Array; - } - - export interface TaxRate { - - /** Name of tax rate */ - Name?: string | null; - - /** The tax type */ - TaxType?: string | null; - - /** See TaxComponents */ - TaxComponents?: Array; - - /** See Status Codes */ - Status?: TaxRateStatus | null; - - /** See ReportTaxTypes */ - ReportTaxType?: TaxRateReportTaxType | null; - - /** Boolean to describe if tax rate can be used for asset accounts i.e. true,false */ - CanApplyToAssets?: boolean | null; - - /** Boolean to describe if tax rate can be used for equity accounts i.e true,false */ - CanApplyToEquity?: boolean | null; - - /** Boolean to describe if tax rate can be used for expense accounts i.e. true,false */ - CanApplyToExpenses?: boolean | null; - - /** Boolean to describe if tax rate can be used for liability accounts i.e. true,false */ - CanApplyToLiabilities?: boolean | null; - - /** Boolean to describe if tax rate can be used for revenue accounts i.e. true,false */ - CanApplyToRevenue?: boolean | null; - - /** - * Tax Rate (decimal to 4dp) e.g 12.5000 - * Type: double - */ - DisplayTaxRate?: number | null; - - /** - * Effective Tax Rate (decimal to 4dp) e.g 12.5000 - * Type: double - */ - EffectiveRate?: number | null; - } - - export interface TaxComponent { - - /** Name of Tax Component */ - Name?: string | null; - - /** - * Tax Rate (up to 4dp) - * Type: double - */ - Rate?: number | null; - - /** Boolean to describe if Tax rate is compounded. */ - IsCompound?: boolean | null; - - /** Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations */ - IsNonRecoverable?: boolean | null; - } - - export enum TaxRateStatus { ACTIVE = 0, DELETED = 1, ARCHIVED = 2, PENDING = 3 } - - export enum TaxRateReportTaxType { AVALARA = 0, BASEXCLUDED = 1, CAPITALSALESOUTPUT = 2, CAPITALEXPENSESINPUT = 3, ECOUTPUT = 4, ECOUTPUTSERVICES = 5, ECINPUT = 6, ECACQUISITIONS = 7, EXEMPTEXPENSES = 8, EXEMPTINPUT = 9, EXEMPTOUTPUT = 10, GSTONIMPORTS = 11, INPUT = 12, INPUTTAXED = 13, MOSSSALES = 14, NONE = 15, NONEOUTPUT = 16, OUTPUT = 17, PURCHASESINPUT = 18, SALESOUTPUT = 19, EXEMPTCAPITAL = 20, EXEMPTEXPORT = 21, CAPITALEXINPUT = 22, GSTONCAPIMPORTS = 23, GSTONCAPITALIMPORTS = 24, REVERSECHARGES = 25, PAYMENTS = 26, INVOICE = 27, CASH = 28, ACCRUAL = 29, FLATRATECASH = 30, FLATRATEACCRUAL = 31, ACCRUALS = 32, TXCA = 33, SRCAS = 34, DSOUTPUT = 35, BLINPUT2 = 36, EPINPUT = 37, IMINPUT2 = 38, MEINPUT = 39, IGDSINPUT2 = 40, ESN33OUTPUT = 41, OPINPUT = 42, OSOUTPUT = 43, TXN33INPUT = 44, TXESSINPUT = 45, TXREINPUT = 46, TXPETINPUT = 47, NRINPUT = 48, ES33OUTPUT = 49, ZERORATEDINPUT = 50, ZERORATEDOUTPUT = 51, DRCHARGESUPPLY = 52, DRCHARGE = 53, CAPINPUT = 54, CAPIMPORTS = 55, IMINPUT = 56, INPUT2 = 57, CIUINPUT = 58, SRINPUT = 59, OUTPUT2 = 60, SROUTPUT = 61, CAPOUTPUT = 62, SROUTPUT2 = 63, CIUOUTPUT = 64, ZROUTPUT = 65, ZREXPORT = 66, ACC28PLUS = 67, ACCUPTO28 = 68, OTHEROUTPUT = 69, SHOUTPUT = 70, ZRINPUT = 71, BADDEBT = 72, OTHERINPUT = 73 } - - - /** See Tax Types � can only be used on update calls */ - export enum TaxType { OUTPUT = 0, INPUT = 1, CAPEXINPUT = 2, EXEMPTEXPORT = 3, EXEMPTEXPENSES = 4, EXEMPTCAPITAL = 5, EXEMPTOUTPUT = 6, INPUTTAXED = 7, BASEXCLUDED = 8, GSTONCAPIMPORTS = 9, GSTONIMPORTS = 10, NONE = 11, INPUT2 = 12, ZERORATED = 13, OUTPUT2 = 14, CAPEXINPUT2 = 15, CAPEXOUTPUT = 16, CAPEXOUTPUT2 = 17, CAPEXSRINPUT = 18, CAPEXSROUTPUT = 19, ECACQUISITIONS = 20, ECZRINPUT = 21, ECZROUTPUT = 22, ECZROUTPUTSERVICES = 23, EXEMPTINPUT = 24, REVERSECHARGES = 25, RRINPUT = 26, RROUTPUT = 27, SRINPUT = 28, SROUTPUT = 29, ZERORATEDINPUT = 30, ZERORATEDOUTPUT = 31, BLINPUT = 32, DSOUTPUT = 33, EPINPUT = 34, ES33OUTPUT = 35, ESN33OUTPUT = 36, IGDSINPUT2 = 37, IMINPUT2 = 38, MEINPUT = 39, NRINPUT = 40, OPINPUT = 41, OSOUTPUT = 42, TXESSINPUT = 43, TXN33INPUT = 44, TXPETINPUT = 45, TXREINPUT = 46, INPUT3 = 47, INPUT4 = 48, OUTPUT3 = 49, OUTPUT4 = 50, SROUTPUT2 = 51, TXCA = 52, SRCAS = 53, BLINPUT2 = 54, DRCHARGESUPPLY20 = 55, DRCHARGE20 = 56, DRCHARGESUPPLY5 = 57, DRCHARGE5 = 58 } - - export interface TrackingCategories { - TrackingCategories1?: Array; - } - - export interface TrackingOptions { - Options?: Array; - } - - export interface Users { - Users1?: Array; - } - - export interface Error { - - /** - * Exception number - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - ErrorNumber?: number | null; - - /** Exception type */ - Type?: string | null; - - /** Exception message */ - Message?: string | null; - - /** Array of Elements of validation Errors */ - Elements?: Array; - } - - export interface Element { - - /** Array of Validation Error message */ - ValidationErrors?: Array; - - /** Unique ID for batch payment object with validation error */ - BatchPaymentID?: string | null; - BankTransactionID?: string | null; - CreditNoteID?: string | null; - ContactID?: string | null; - InvoiceID?: string | null; - ItemID?: string | null; - PurchaseOrderID?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * Allows you to retrieve the full chart of accounts - * Get Accounts - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Accounts} Success - return response of type Accounts array with 0 to n Account - */ - GetAccounts(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Accounts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create a new chart of accounts - * Put Accounts - * @param {Account} requestBody Account object in body of request - * @return {Accounts} Success - created new Account and return response of type Accounts array with new Account - */ - CreateAccount(requestBody: Account): Observable { - return this.http.put(this.baseUri + 'Accounts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a single chart of accounts - * Get Accounts/{AccountID} - * @param {string} AccountID Unique identifier for retrieving single object - * @return {Accounts} Success - return response of type Accounts array with one Account - */ - GetAccount(AccountID: string): Observable { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); - } - - /** - * Allows you to update a chart of accounts - * Post Accounts/{AccountID} - * @param {string} AccountID Unique identifier for retrieving single object - * @param {Accounts} requestBody Request of type Accounts array with one Account - * @return {Accounts} Success - update existing Account and return response of type Accounts array with updated Account - */ - UpdateAccount(AccountID: string, requestBody: Accounts): Observable { - return this.http.post(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a chart of accounts - * Delete Accounts/{AccountID} - * @param {string} AccountID Unique identifier for retrieving single object - * @return {Accounts} Success - delete existing Account and return response of type Accounts array with deleted Account - */ - DeleteAccount(AccountID: string): Observable { - return this.http.delete(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); - } - - /** - * Allows you to retrieve Attachments for accounts - * Get Accounts/{AccountID}/Attachments - * @param {string} AccountID Unique identifier for Account object - * @return {Attachments} Success - return response of type Attachments array of Attachment - */ - GetAccountAttachments(AccountID: string): Observable { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve specific Attachment on Account - * Get Accounts/{AccountID}/Attachments/{AttachmentID} - * @param {string} AccountID Unique identifier for Account object - * @param {string} AttachmentID Unique identifier for Attachment object - * @return {void} Success - return response of attachment for Account as binary data - */ - GetAccountAttachmentById(AccountID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachment on Account by Filename - * Get Accounts/{AccountID}/Attachments/{FileName} - * @param {string} AccountID Unique identifier for Account object - * @param {string} FileName Name of the attachment - * @return {void} Success - return response of attachment for Account as binary data - */ - GetAccountAttachmentByFileName(AccountID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Retrieve either one or many BatchPayments for invoices - * Get BatchPayments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects - */ - GetBatchPayments(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'BatchPayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Create one or many BatchPayments for invoices - * Put BatchPayments - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {BatchPayments} requestBody BatchPayments with an array of Payments in body of request - * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects - */ - CreateBatchPayment(summarizeErrors: boolean | null | undefined, requestBody: BatchPayments): Observable { - return this.http.put(this.baseUri + 'BatchPayments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve history from a Batch Payment - * Get BatchPayments/{BatchPaymentID}/History - * @param {string} BatchPaymentID Unique identifier for BatchPayment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetBatchPaymentHistory(BatchPaymentID: string): Observable { - return this.http.get(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', {}); - } - - /** - * Allows you to create a history record for a Batch Payment - * Put BatchPayments/{BatchPaymentID}/History - * @param {string} BatchPaymentID Unique identifier for BatchPayment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateBatchPaymentHistoryRecord(BatchPaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any spend or receive money transactions - * Get BankTransactions - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page Up to 100 bank transactions will be returned in a single API call with line items details - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with 0 to n BankTransaction - */ - GetBankTransactions(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'BankTransactions?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create one or more spend or receive money transaction - * Put BankTransactions - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {BankTransactions} requestBody BankTransactions with an array of BankTransaction objects in body of request - * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction - */ - CreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { - return this.http.put(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update or create one or more spend or receive money transaction - * Post BankTransactions - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction - */ - UpdateOrCreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { - return this.http.post(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a single spend or receive money transaction - * Get BankTransactions/{BankTransactionID} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with a specific BankTransaction - */ - GetBankTransaction(BankTransactionID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a single spend or receive money transaction - * Post BankTransactions/{BankTransactionID} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {BankTransactions} Success - return response of type BankTransactions array with updated BankTransaction - */ - UpdateBankTransaction(BankTransactionID: string, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { - return this.http.post(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any attachments to bank transactions - * Get BankTransactions/{BankTransactionID}/Attachments - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @return {Attachments} Success - return response of type Attachments array with 0 to n Attachment - */ - GetBankTransactionAttachments(BankTransactionID: string): Observable { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on a specific BankTransaction - * Get BankTransactions/{BankTransactionID}/Attachments/{AttachmentID} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {string} AttachmentID Xero generated unique identifier for an attachment - * @return {void} Success - return response of attachment for BankTransaction as binary data - */ - GetBankTransactionAttachmentById(BankTransactionID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on BankTransaction by Filename - * Get BankTransactions/{BankTransactionID}/Attachments/{FileName} - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {string} FileName The name of the file being attached - * @return {void} Success - return response of attachment for BankTransaction as binary data - */ - GetBankTransactionAttachmentByFileName(BankTransactionID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history from a bank transactions - * Get BankTransactions/{BankTransactionID}/History - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetBankTransactionsHistory(BankTransactionID: string): Observable { - return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', {}); - } - - /** - * Allows you to create history record for a bank transactions - * Put BankTransactions/{BankTransactionID}/History - * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateBankTransactionHistoryRecord(BankTransactionID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve all bank transfers - * Get BankTransfers - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {BankTransfers} Success - return response of BankTransfers array of 0 to N BankTransfer - */ - GetBankTransfers(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'BankTransfers?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create a bank transfers - * Put BankTransfers - * @param {BankTransfers} requestBody BankTransfers with array of BankTransfer objects in request body - * @return {BankTransfers} Success - return response of BankTransfers array of one BankTransfer - */ - CreateBankTransfer(requestBody: BankTransfers): Observable { - return this.http.put(this.baseUri + 'BankTransfers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any bank transfers - * Get BankTransfers/{BankTransferID} - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @return {BankTransfers} Success - return response of BankTransfers array with one BankTransfer - */ - GetBankTransfer(BankTransferID: string): Observable { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)), {}); - } - - /** - * Allows you to retrieve Attachments from bank transfers - * Get BankTransfers/{BankTransferID}/Attachments - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @return {Attachments} Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer - */ - GetBankTransferAttachments(BankTransferID: string): Observable { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on BankTransfer - * Get BankTransfers/{BankTransferID}/Attachments/{AttachmentID} - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @param {string} AttachmentID Xero generated unique identifier for an Attachment to a bank transfer - * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer - */ - GetBankTransferAttachmentById(BankTransferID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on BankTransfer by file name - * Get BankTransfers/{BankTransferID}/Attachments/{FileName} - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @param {string} FileName The name of the file being attached to a Bank Transfer - * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer - */ - GetBankTransferAttachmentByFileName(BankTransferID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history from a bank transfers - * Get BankTransfers/{BankTransferID}/History - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetBankTransferHistory(BankTransferID: string): Observable { - return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', {}); - } - - /** - * Put BankTransfers/{BankTransferID}/History - * @param {string} BankTransferID Xero generated unique identifier for a bank transfer - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateBankTransferHistoryRecord(BankTransferID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve all the BrandingThemes - * Get BrandingThemes - * @return {BrandingThemes} Success - return response of type BrandingThemes - */ - GetBrandingThemes(): Observable { - return this.http.get(this.baseUri + 'BrandingThemes', {}); - } - - /** - * Allows you to retrieve a specific BrandingThemes - * Get BrandingThemes/{BrandingThemeID} - * @param {string} BrandingThemeID Unique identifier for a Branding Theme - * @return {BrandingThemes} Success - return response of type BrandingThemes with one BrandingTheme - */ - GetBrandingTheme(BrandingThemeID: string): Observable { - return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)), {}); - } - - /** - * Allows you to retrieve the Payment services for a Branding Theme - * Get BrandingThemes/{BrandingThemeID}/PaymentServices - * @param {string} BrandingThemeID Unique identifier for a Branding Theme - * @return {PaymentServices} Success - return response of type PaymentServices array with 0 to N PaymentService - */ - GetBrandingThemePaymentServices(BrandingThemeID: string): Observable { - return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', {}); - } - - /** - * Allow for the creation of new custom payment service for specified Branding Theme - * Post BrandingThemes/{BrandingThemeID}/PaymentServices - * @param {string} BrandingThemeID Unique identifier for a Branding Theme - * @param {PaymentService} requestBody PaymentService object in body of request - * @return {PaymentServices} Success - return response of type PaymentServices array with newly created PaymentService - */ - CreateBrandingThemePaymentServices(BrandingThemeID: string, requestBody: PaymentService): Observable { - return this.http.post(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve all contacts in a Xero organisation - * Get Contacts - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {Array} IDs Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. - * @param {number} page e.g. page=1 - Up to 100 contacts will be returned in a single API call. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - * @return {Contacts} Success - return response of type Contacts array with 0 to N Contact - */ - GetContacts(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Contacts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived, {}); - } - - /** - * Allows you to create a multiple contacts (bulk) in a Xero organisation - * Put Contacts - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Contacts} requestBody Contacts with an array of Contact objects to create in body of request - * @return {Contacts} Success - return response of type Contacts array with newly created Contact - */ - CreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { - return this.http.put(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more contacts in a Xero organisation - * Post Contacts - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @return {Contacts} Success - return response of type Contacts array with newly created Contact - */ - UpdateOrCreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { - return this.http.post(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a single contact by Contact Number in a Xero organisation - * Get Contacts/{ContactNumber} - * @param {string} ContactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). - * @return {Contacts} Success - return response of type Contacts array with a unique Contact - */ - GetContactByContactNumber(ContactNumber: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactNumber == null ? '' : encodeURIComponent(ContactNumber)), {}); - } - - /** - * Allows you to retrieve a single contacts in a Xero organisation - * Get Contacts/{ContactID} - * @param {string} ContactID Unique identifier for a Contact - * @return {Contacts} Success - return response of type Contacts array with a unique Contact - */ - GetContact(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), {}); - } - - /** - * Post Contacts/{ContactID} - * @param {string} ContactID Unique identifier for a Contact - * @param {Contacts} requestBody an array of Contacts containing single Contact object with properties to update - * @return {Contacts} Success - return response of type Contacts array with an updated Contact - */ - UpdateContact(ContactID: string, requestBody: Contacts): Observable { - return this.http.post(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve, add and update contacts in a Xero organisation - * Get Contacts/{ContactID}/Attachments - * @param {string} ContactID Unique identifier for a Contact - * @return {Attachments} Success - return response of type Attachments array with 0 to N Attachment - */ - GetContactAttachments(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on Contacts - * Get Contacts/{ContactID}/Attachments/{AttachmentID} - * @param {string} ContactID Unique identifier for a Contact - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Contact as binary data - */ - GetContactAttachmentById(ContactID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on Contacts by file name - * Get Contacts/{ContactID}/Attachments/{FileName} - * @param {string} ContactID Unique identifier for a Contact - * @param {string} FileName Name for the file you are attaching - * @return {void} Success - return response of attachment for Contact as binary data - */ - GetContactAttachmentByFileName(ContactID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve CISSettings for a contact in a Xero organisation - * Get Contacts/{ContactID}/CISSettings - * @param {string} ContactID Unique identifier for a Contact - * @return {CISSettings} Success - return response of type CISSettings for a specific Contact - */ - GetContactCISSettings(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/CISSettings', {}); - } - - /** - * Allows you to retrieve a history records of an Contact - * Get Contacts/{ContactID}/History - * @param {string} ContactID Unique identifier for a Contact - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetContactHistory(ContactID: string): Observable { - return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an Contact - * Put Contacts/{ContactID}/History - * @param {string} ContactID Unique identifier for a Contact - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateContactHistory(ContactID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve the ContactID and Name of all the contacts in a contact group - * Get ContactGroups - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {ContactGroups} Success - return response of type Contact Groups array of Contact Group - */ - GetContactGroups(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ContactGroups?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create a contact group - * Put ContactGroups - * @param {ContactGroups} requestBody ContactGroups with an array of names in request body - * @return {ContactGroups} Success - return response of type Contact Groups array of newly created Contact Group - */ - CreateContactGroup(requestBody: ContactGroups): Observable { - return this.http.put(this.baseUri + 'ContactGroups', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a unique Contact Group by ID - * Get ContactGroups/{ContactGroupID} - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @return {ContactGroups} Success - return response of type Contact Groups array with a specific Contact Group - */ - GetContactGroup(ContactGroupID: string): Observable { - return this.http.get(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), {}); - } - - /** - * Allows you to update a Contact Group - * Post ContactGroups/{ContactGroupID} - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @param {ContactGroups} requestBody an array of Contact groups with Name of specific group to update - * @return {ContactGroups} Success - return response of type Contact Groups array of updated Contact Group - */ - UpdateContactGroup(ContactGroupID: string, requestBody: ContactGroups): Observable { - return this.http.post(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to add Contacts to a Contact Group - * Put ContactGroups/{ContactGroupID}/Contacts - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @param {Contacts} requestBody Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request - * @return {Contacts} Success - return response of type Contacts array of added Contacts - */ - CreateContactGroupContacts(ContactGroupID: string, requestBody: Contacts): Observable { - return this.http.put(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete all Contacts from a Contact Group - * Delete ContactGroups/{ContactGroupID}/Contacts - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @return {void} - */ - DeleteContactGroupContacts(ContactGroupID: string): Observable> { - return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to delete a specific Contact from a Contact Group - * Delete ContactGroups/{ContactGroupID}/Contacts/{ContactID} - * @param {string} ContactGroupID Unique identifier for a Contact Group - * @param {string} ContactID Unique identifier for a Contact - * @return {void} - */ - DeleteContactGroupContact(ContactGroupID: string, ContactID: string): Observable> { - return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve any credit notes - * Get CreditNotes - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 credit notes will be returned in a single API call with line items shown for each credit note - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {CreditNotes} Success - return response of type Credit Notes array of CreditNote - */ - GetCreditNotes(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'CreditNotes?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create a credit note - * Put CreditNotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {CreditNotes} requestBody Credit Notes with array of CreditNote object in body of request - * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote - */ - CreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { - return this.http.put(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more credit notes - * Post CreditNotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {CreditNotes} requestBody an array of Credit Notes with a single CreditNote object. - * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote - */ - UpdateOrCreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { - return this.http.post(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specific credit note - * Get CreditNotes/{CreditNoteID} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {CreditNotes} Success - return response of type Credit Notes array with a unique CreditNote - */ - GetCreditNote(CreditNoteID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a specific credit note - * Post CreditNotes/{CreditNoteID} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {CreditNotes} requestBody an array of Credit Notes containing credit note details to update - * @return {CreditNotes} Success - return response of type Credit Notes array with updated CreditNote - */ - UpdateCreditNote(CreditNoteID: string, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { - return this.http.post(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve Attachments for credit notes - * Get CreditNotes/{CreditNoteID}/Attachments - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @return {Attachments} Success - return response of type Attachments array with all Attachment for specific Credit Note - */ - GetCreditNoteAttachments(CreditNoteID: string): Observable { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on CreditNote - * Get CreditNotes/{CreditNoteID}/Attachments/{AttachmentID} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Credit Note as binary data - */ - GetCreditNoteAttachmentById(CreditNoteID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on CreditNote by file name - * Get CreditNotes/{CreditNoteID}/Attachments/{FileName} - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {string} FileName Name of the file you are attaching to Credit Note - * @return {void} Success - return response of attachment for Credit Note as binary data - */ - GetCreditNoteAttachmentByFileName(CreditNoteID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Credit Note as PDF files - * Get CreditNotes/{CreditNoteID}/pdf - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @return {void} Success - return response of binary data from the Attachment to a Credit Note - */ - GetCreditNoteAsPdf(CreditNoteID: string): Observable> { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to create Allocation on CreditNote - * Put CreditNotes/{CreditNoteID}/Allocations - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Allocations} requestBody Allocations with array of Allocation object in body of request. - * @return {Allocations} Success - return response of type Allocations array with newly created Allocation for specific Credit Note - */ - CreateCreditNoteAllocation(CreditNoteID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { - return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an CreditNote - * Get CreditNotes/{CreditNoteID}/History - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetCreditNoteHistory(CreditNoteID: string): Observable { - return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an CreditNote - * Put CreditNotes/{CreditNoteID}/History - * @param {string} CreditNoteID Unique identifier for a Credit Note - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateCreditNoteHistory(CreditNoteID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve currencies for your organisation - * Get Currencies - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Currencies} Success - return response of type Currencies array with all Currencies - */ - GetCurrencies(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Currencies?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Put Currencies - * @param {Currency} requestBody Currency obejct in the body of request - * @return {Currencies} Unsupported - return response incorrect exception, API is not able to create new Currency - */ - CreateCurrency(requestBody: Currency): Observable { - return this.http.put(this.baseUri + 'Currencies', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve employees used in Xero payrun - * Get Employees - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Employees} Success - return response of type Employees array with all Employee - */ - GetEmployees(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create new employees used in Xero payrun - * Put Employees - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Employees} requestBody Employees with array of Employee object in body of request - * @return {Employees} Success - return response of type Employees array with new Employee - */ - CreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { - return this.http.put(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to create a single new employees used in Xero payrun - * Post Employees - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Employees} requestBody Employees with array of Employee object in body of request - * @return {Employees} Success - return response of type Employees array with new Employee - */ - UpdateOrCreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { - return this.http.post(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specific employee used in Xero payrun - * Get Employees/{EmployeeID} - * @param {string} EmployeeID Unique identifier for a Employee - * @return {Employees} Success - return response of type Employees array with specified Employee - */ - GetEmployee(EmployeeID: string): Observable { - return this.http.get(this.baseUri + 'Employees/' + (EmployeeID == null ? '' : encodeURIComponent(EmployeeID)), {}); - } - - /** - * Allows you to retrieve expense claims - * Get ExpenseClaims - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with all ExpenseClaims - */ - GetExpenseClaims(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'ExpenseClaims?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to retrieve expense claims - * Put ExpenseClaims - * @param {ExpenseClaims} requestBody ExpenseClaims with array of ExpenseClaim object in body of request - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with newly created ExpenseClaim - */ - CreateExpenseClaims(requestBody: ExpenseClaims): Observable { - return this.http.put(this.baseUri + 'ExpenseClaims', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified expense claim - * Get ExpenseClaims/{ExpenseClaimID} - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with specified ExpenseClaim - */ - GetExpenseClaim(ExpenseClaimID: string): Observable { - return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), {}); - } - - /** - * Allows you to update specified expense claims - * Post ExpenseClaims/{ExpenseClaimID} - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with updated ExpenseClaim - */ - UpdateExpenseClaim(ExpenseClaimID: string, requestBody: ExpenseClaims): Observable { - return this.http.post(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an ExpenseClaim - * Get ExpenseClaims/{ExpenseClaimID}/History - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetExpenseClaimHistory(ExpenseClaimID: string): Observable { - return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', {}); - } - - /** - * Allows you to create a history records of an ExpenseClaim - * Put ExpenseClaims/{ExpenseClaimID}/History - * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateExpenseClaimHistory(ExpenseClaimID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any sales invoices or purchase bills - * Get Invoices - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {Array} IDs Filter by a comma-separated list of InvoicesIDs. - * @param {Array} InvoiceNumbers Filter by a comma-separated list of InvoiceNumbers. - * @param {Array} ContactIDs Filter by a comma-separated list of ContactIDs. - * @param {Array} Statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. - * @param {number} page e.g. page=1 � Up to 100 invoices will be returned in a single API call with line items shown for each invoice - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - * @param {boolean} createdByMyApp When set to true you'll only retrieve Invoices created by your app - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with all Invoices - */ - GetInvoices(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, InvoiceNumbers: Array | null | undefined, ContactIDs: Array | null | undefined, Statuses: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined, createdByMyApp: boolean | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Invoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&' + InvoiceNumbers?.map(z => `InvoiceNumbers=${encodeURIComponent(z)}`).join('&') + '&' + ContactIDs?.map(z => `ContactIDs=${encodeURIComponent(z)}`).join('&') + '&' + Statuses?.map(z => `Statuses=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived + '&createdByMyApp=' + createdByMyApp + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create one or more sales invoices or purchase bills - * Put Invoices - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {Invoices} requestBody Invoices with an array of invoice objects in body of request - * @return {Invoices} Success - return response of type Invoices array with newly created Invoice - */ - CreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { - return this.http.put(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more sales invoices or purchase bills - * Post Invoices - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with newly created Invoice - */ - UpdateOrCreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { - return this.http.post(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified sales invoice or purchase bill - * Get Invoices/{InvoiceID} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with specified Invoices - */ - GetInvoice(InvoiceID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a specified sales invoices or purchase bills - * Post Invoices/{InvoiceID} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Invoices} Success - return response of type Invoices array with updated Invoice - */ - UpdateInvoice(InvoiceID: string, unitdp: number | null | undefined, requestBody: Invoices): Observable { - return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve invoices or purchase bills as PDF files - * Get Invoices/{InvoiceID}/pdf - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {void} Success - return response of byte array pdf version of specified Invoices - */ - GetInvoiceAsPdf(InvoiceID: string): Observable> { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on invoices or purchase bills - * Get Invoices/{InvoiceID}/Attachments - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {Attachments} Success - return response of type Attachments array of Attachments for specified Invoices - */ - GetInvoiceAttachments(InvoiceID: string): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID - * Get Invoices/{InvoiceID}/Attachments/{AttachmentID} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {string} AttachmentID Unique identifier for an Attachment - * @return {void} Success - return response of attachment for Invoice as binary data - */ - GetInvoiceAttachmentById(InvoiceID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachment on invoices or purchase bills by it's filename - * Get Invoices/{InvoiceID}/Attachments/{FileName} - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {string} FileName Name of the file you are attaching - * @return {void} Success - return response of attachment for Invoice as binary data - */ - GetInvoiceAttachmentByFileName(InvoiceID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a URL to an online invoice - * Get Invoices/{InvoiceID}/OnlineInvoice - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {OnlineInvoices} Success - return response of type OnlineInvoice array with one OnlineInvoice - */ - GetOnlineInvoice(InvoiceID: string): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/OnlineInvoice', {}); - } - - /** - * Allows you to email a copy of invoice to related Contact - * Post Invoices/{InvoiceID}/Email - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {void} - */ - EmailInvoice(InvoiceID: string, requestBody: RequestEmpty): Observable> { - return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Email', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a history records of an invoice - * Get Invoices/{InvoiceID}/History - * @param {string} InvoiceID Unique identifier for an Invoice - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetInvoiceHistory(InvoiceID: string): Observable { - return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an invoice - * Put Invoices/{InvoiceID}/History - * @param {string} InvoiceID Unique identifier for an Invoice - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateInvoiceHistory(InvoiceID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve invoice reminder settings - * Get InvoiceReminders/Settings - * @return {InvoiceReminders} Success - return response of Invoice Reminders - */ - GetInvoiceReminders(): Observable { - return this.http.get(this.baseUri + 'InvoiceReminders/Settings', {}); - } - - /** - * Allows you to retrieve any items - * Get Items - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with all Item - */ - GetItems(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Items?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create one or more items - * Put Items - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {Items} requestBody Items with an array of Item objects in body of request - * @return {Items} Success - return response of type Items array with newly created Item - */ - CreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { - return this.http.put(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update or create one or more items - * Post Items - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with newly created Item - */ - UpdateOrCreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { - return this.http.post(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified item - * Get Items/{ItemID} - * @param {string} ItemID Unique identifier for an Item - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with specified Item - */ - GetItem(ItemID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to update a specified item - * Post Items/{ItemID} - * @param {string} ItemID Unique identifier for an Item - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Items} Success - return response of type Items array with updated Item - */ - UpdateItem(ItemID: string, unitdp: number | null | undefined, requestBody: Items): Observable { - return this.http.post(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a specified item - * Delete Items/{ItemID} - * @param {string} ItemID Unique identifier for an Item - * @return {void} - */ - DeleteItem(ItemID: string): Observable> { - return this.http.delete(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history for items - * Get Items/{ItemID}/History - * @param {string} ItemID Unique identifier for an Item - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetItemHistory(ItemID: string): Observable { - return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', {}); - } - - /** - * Allows you to create a history record for items - * Put Items/{ItemID}/History - * @param {string} ItemID Unique identifier for an Item - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateItemHistory(ItemID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any journals. - * Get Journals - * @param {number} offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {boolean} paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. - * @return {Journals} Success - return response of type Journals array with all Journals - */ - GetJournals(offset: number | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Journals?offset=' + offset + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve a specified journals. - * Get Journals/{JournalID} - * @param {string} JournalID Unique identifier for a Journal - * @return {Journals} Success - return response of type Journals array with specified Journal - */ - GetJournal(JournalID: string): Observable { - return this.http.get(this.baseUri + 'Journals/' + (JournalID == null ? '' : encodeURIComponent(JournalID)), {}); - } - - /** - * Retrieve linked transactions (billable expenses) - * Get LinkedTransactions - * @param {number} page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} LinkedTransactionID The Xero identifier for an Linked Transaction - * @param {string} SourceTransactionID Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice - * @param {string} ContactID Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. - * @param {string} Status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status - * @param {string} TargetTransactionID Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with all LinkedTransaction - */ - GetLinkedTransactions(page: number | null | undefined, LinkedTransactionID: string | null | undefined, SourceTransactionID: string | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, TargetTransactionID: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'LinkedTransactions?page=' + page + '&LinkedTransactionID=' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)) + '&SourceTransactionID=' + (SourceTransactionID == null ? '' : encodeURIComponent(SourceTransactionID)) + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&TargetTransactionID=' + (TargetTransactionID == null ? '' : encodeURIComponent(TargetTransactionID)), {}); - } - - /** - * Allows you to create linked transactions (billable expenses) - * Put LinkedTransactions - * @param {LinkedTransaction} requestBody LinkedTransaction object in body of request - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with newly created LinkedTransaction - */ - CreateLinkedTransaction(requestBody: LinkedTransaction): Observable { - return this.http.put(this.baseUri + 'LinkedTransactions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified linked transactions (billable expenses) - * Get LinkedTransactions/{LinkedTransactionID} - * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with a specified LinkedTransaction - */ - GetLinkedTransaction(LinkedTransactionID: string): Observable { - return this.http.get(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), {}); - } - - /** - * Allows you to update a specified linked transactions (billable expenses) - * Post LinkedTransactions/{LinkedTransactionID} - * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction - * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with updated LinkedTransaction - */ - UpdateLinkedTransaction(LinkedTransactionID: string, requestBody: LinkedTransactions): Observable { - return this.http.post(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a specified linked transactions (billable expenses) - * Delete LinkedTransactions/{LinkedTransactionID} - * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction - * @return {void} - */ - DeleteLinkedTransaction(LinkedTransactionID: string): Observable> { - return this.http.delete(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve any manual journals - * Get ManualJournals - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {ManualJournals} Success - return response of type ManualJournals array with a all ManualJournals - */ - GetManualJournals(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'ManualJournals?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Allows you to create one or more manual journals - * Put ManualJournals - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request - * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal - */ - CreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { - return this.http.put(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to create a single manual journal - * Post ManualJournals - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request - * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal - */ - UpdateOrCreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { - return this.http.post(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified manual journals - * Get ManualJournals/{ManualJournalID} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @return {ManualJournals} Success - return response of type ManualJournals array with a specified ManualJournals - */ - GetManualJournal(ManualJournalID: string): Observable { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), {}); - } - - /** - * Allows you to update a specified manual journal - * Post ManualJournals/{ManualJournalID} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @return {ManualJournals} Success - return response of type ManualJournals array with an updated ManualJournal - */ - UpdateManualJournal(ManualJournalID: string, requestBody: ManualJournals): Observable { - return this.http.post(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve Attachment for manual journals - * Get ManualJournals/{ManualJournalID}/Attachments - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @return {Attachments} Success - return response of type Attachments array with all Attachments for a ManualJournals - */ - GetManualJournalAttachments(ManualJournalID: string): Observable { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve specified Attachment on ManualJournals - * Get ManualJournals/{ManualJournalID}/Attachments/{AttachmentID} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Manual Journal as binary data - */ - GetManualJournalAttachmentById(ManualJournalID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve specified Attachment on ManualJournal by file name - * Get ManualJournals/{ManualJournalID}/Attachments/{FileName} - * @param {string} ManualJournalID Unique identifier for a ManualJournal - * @param {string} FileName The name of the file being attached to a ManualJournal - * @return {void} Success - return response of attachment for Manual Journal as binary data - */ - GetManualJournalAttachmentByFileName(ManualJournalID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Organisation details - * Get Organisation - * @return {Organisations} Success - return response of type Organisation array with all Organisation - */ - GetOrganisations(): Observable { - return this.http.get(this.baseUri + 'Organisation', {}); - } - - /** - * Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. - * Get Organisation/{OrganisationID}/CISSettings - * @param {string} OrganisationID The unique Xero identifier for an organisation - * @return {CISOrgSetting} Success - return response of type Organisation array with specified Organisation - */ - GetOrganisationCISSettings(OrganisationID: string): Observable { - return this.http.get(this.baseUri + 'Organisation/' + (OrganisationID == null ? '' : encodeURIComponent(OrganisationID)) + '/CISSettings', {}); - } - - /** - * Allows you to retrieve overpayments - * Get Overpayments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Overpayments} Success - return response of type Overpayments array with all Overpayments - */ - GetOverpayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Overpayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to retrieve a specified overpayments - * Get Overpayments/{OverpaymentID} - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @return {Overpayments} Success - return response of type Overpayments array with specified Overpayments - */ - GetOverpayment(OverpaymentID: string): Observable { - return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)), {}); - } - - /** - * Allows you to create a single allocation for an overpayment - * Put Overpayments/{OverpaymentID}/Allocations - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Allocations} requestBody Allocations array with Allocation object in body of request - * @return {Allocations} Success - return response of type Allocations array with all Allocation for Overpayments - */ - CreateOverpaymentAllocations(OverpaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { - return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an Overpayment - * Get Overpayments/{OverpaymentID}/History - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetOverpaymentHistory(OverpaymentID: string): Observable { - return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', {}); - } - - /** - * Allows you to create history records of an Overpayment - * Put Overpayments/{OverpaymentID}/History - * @param {string} OverpaymentID Unique identifier for a Overpayment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateOverpaymentHistory(OverpaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve payments for invoices and credit notes - * Get Payments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page Up to 100 payments will be returned in a single API call - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Payments} Success - return response of type Payments array for all Payments - */ - GetPayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Payments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Allows you to create multiple payments for invoices or credit notes - * Put Payments - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Payments} requestBody Payments array with Payment object in body of request - * @return {Payments} Success - return response of type Payments array for newly created Payment - */ - CreatePayments(summarizeErrors: boolean | null | undefined, requestBody: Payments): Observable { - return this.http.put(this.baseUri + 'Payments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to create a single payment for invoices or credit notes - * Post Payments - * @param {Payment} requestBody Request body with a single Payment object - * @return {Payments} Success - return response of type Payments array for newly created Payment - */ - CreatePayment(requestBody: Payment): Observable { - return this.http.post(this.baseUri + 'Payments', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified payment for invoices and credit notes - * Get Payments/{PaymentID} - * @param {string} PaymentID Unique identifier for a Payment - * @return {Payments} Success - return response of type Payments array for specified Payment - */ - GetPayment(PaymentID: string): Observable { - return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), {}); - } - - /** - * Allows you to update a specified payment for invoices and credit notes - * Post Payments/{PaymentID} - * @param {string} PaymentID Unique identifier for a Payment - * @return {Payments} Success - return response of type Payments array for updated Payment - */ - DeletePayment(PaymentID: string, requestBody: PaymentDelete): Observable { - return this.http.post(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve history records of a payment - * Get Payments/{PaymentID}/History - * @param {string} PaymentID Unique identifier for a Payment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetPaymentHistory(PaymentID: string): Observable { - return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', {}); - } - - /** - * Allows you to create a history record for a payment - * Put Payments/{PaymentID}/History - * @param {string} PaymentID Unique identifier for a Payment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreatePaymentHistory(PaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve payment services - * Get PaymentServices - * @return {PaymentServices} Success - return response of type PaymentServices array for all PaymentService - */ - GetPaymentServices(): Observable { - return this.http.get(this.baseUri + 'PaymentServices', {}); - } - - /** - * Allows you to create payment services - * Put PaymentServices - * @param {PaymentServices} requestBody PaymentServices array with PaymentService object in body of request - * @return {PaymentServices} Success - return response of type PaymentServices array for newly created PaymentService - */ - CreatePaymentService(requestBody: PaymentServices): Observable { - return this.http.put(this.baseUri + 'PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve prepayments - * Get Prepayments - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} page e.g. page=1 � Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Prepayments} Success - return response of type Prepayments array for all Prepayment - */ - GetPrepayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Prepayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to retrieve a specified prepayments - * Get Prepayments/{PrepaymentID} - * @param {string} PrepaymentID Unique identifier for a PrePayment - * @return {Prepayments} Success - return response of type Prepayments array for a specified Prepayment - */ - GetPrepayment(PrepaymentID: string): Observable { - return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)), {}); - } - - /** - * Allows you to create an Allocation for prepayments - * Put Prepayments/{PrepaymentID}/Allocations - * @param {string} PrepaymentID Unique identifier for Prepayment - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Allocations} requestBody Allocations with an array of Allocation object in body of request - * @return {Allocations} Success - return response of type Allocations array of Allocation for all Prepayment - */ - CreatePrepaymentAllocations(PrepaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { - return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an Prepayment - * Get Prepayments/{PrepaymentID}/History - * @param {string} PrepaymentID Unique identifier for a PrePayment - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetPrepaymentHistory(PrepaymentID: string): Observable { - return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', {}); - } - - /** - * Allows you to create a history record for an Prepayment - * Put Prepayments/{PrepaymentID}/History - * @param {string} PrepaymentID Unique identifier for a PrePayment - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreatePrepaymentHistory(PrepaymentID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve purchase orders - * Get PurchaseOrders - * @param {PurchaseOrderStatus} Status Filter by purchase order status - * @param {string} DateFrom Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param {string} DateTo Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - * @param {string} order Order by an any element - * @param {number} page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array of all PurchaseOrder - */ - GetPurchaseOrders(Status: PurchaseOrderStatus | null | undefined, DateFrom: string | null | undefined, DateTo: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders?Status=' + Status + '&DateFrom=' + (DateFrom == null ? '' : encodeURIComponent(DateFrom)) + '&DateTo=' + (DateTo == null ? '' : encodeURIComponent(DateTo)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); - } - - /** - * Allows you to create one or more purchase orders - * Put PurchaseOrders - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {PurchaseOrders} requestBody PurchaseOrders with an array of PurchaseOrder object in body of request - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - CreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { - return this.http.put(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update or create one or more purchase orders - * Post PurchaseOrders - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - UpdateOrCreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { - return this.http.post(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve purchase orders as PDF files - * Get PurchaseOrders/{PurchaseOrderID}/pdf - * @param {string} PurchaseOrderID Unique identifier for an Purchase Order - * @return {void} Success - return response of byte array pdf version of specified Purchase Orders - */ - GetPurchaseOrderAsPdf(PurchaseOrderID: string): Observable> { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a specified purchase orders - * Get PurchaseOrders/{PurchaseOrderID} - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - GetPurchaseOrder(PurchaseOrderID: string): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), {}); - } - - /** - * Allows you to update a specified purchase order - * Post PurchaseOrders/{PurchaseOrderID} - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for updated PurchaseOrder - */ - UpdatePurchaseOrder(PurchaseOrderID: string, requestBody: PurchaseOrders): Observable { - return this.http.post(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified purchase orders - * Get PurchaseOrders/{PurchaseOrderNumber} - * @param {string} PurchaseOrderNumber Unique identifier for a PurchaseOrder - * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder - */ - GetPurchaseOrderByNumber(PurchaseOrderNumber: string): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderNumber == null ? '' : encodeURIComponent(PurchaseOrderNumber)), {}); - } - - /** - * Allows you to retrieve history for PurchaseOrder - * Get PurchaseOrders/{PurchaseOrderID}/History - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetPurchaseOrderHistory(PurchaseOrderID: string): Observable { - return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', {}); - } - - /** - * Allows you to create HistoryRecord for purchase orders - * Put PurchaseOrders/{PurchaseOrderID}/History - * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreatePurchaseOrderHistory(PurchaseOrderID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any sales quotes - * Get Quotes - * @param {Date} DateFrom Filter for quotes after a particular date - * Type: DateOnly - * @param {Date} DateTo Filter for quotes before a particular date - * Type: DateOnly - * @param {Date} ExpiryDateFrom Filter for quotes expiring after a particular date - * Type: DateOnly - * @param {Date} ExpiryDateTo Filter for quotes before a particular date - * Type: DateOnly - * @param {string} ContactID Filter for quotes belonging to a particular contact - * @param {string} Status Filter for quotes of a particular Status - * @param {number} page e.g. page=1 � Up to 100 Quotes will be returned in a single API call with line items shown for each quote - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {string} order Order by an any element - * @return {Quotes} Success - return response of type quotes array with all quotes - */ - GetQuotes(DateFrom: Date | null | undefined, DateTo: Date | null | undefined, ExpiryDateFrom: Date | null | undefined, ExpiryDateTo: Date | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, page: number | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Quotes?DateFrom=' + DateFrom?.toISOString() + '&DateTo=' + DateTo?.toISOString() + '&ExpiryDateFrom=' + ExpiryDateFrom?.toISOString() + '&ExpiryDateTo=' + ExpiryDateTo?.toISOString() + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&page=' + page + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to create one or more quotes - * Put Quotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @param {Quotes} requestBody Quotes with an array of Quote object in body of request - * @return {Quotes} Success - return response of type Quotes with array with newly created Quote - */ - CreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { - return this.http.put(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update OR create one or more quotes - * Post Quotes - * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors - * @return {Quotes} Success - return response of type Quotes array with updated or created Quote - */ - UpdateOrCreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { - return this.http.post(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified quote - * Get Quotes/{QuoteID} - * @param {string} QuoteID Unique identifier for an Quote - * @return {Quotes} Success - return response of type Quotes array with specified Quote - */ - GetQuote(QuoteID: string): Observable { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), {}); - } - - /** - * Allows you to update a specified quote - * Post Quotes/{QuoteID} - * @param {string} QuoteID Unique identifier for an Quote - * @return {Quotes} Success - return response of type Quotes array with updated Quote - */ - UpdateQuote(QuoteID: string, requestBody: Quotes): Observable { - return this.http.post(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a history records of an quote - * Get Quotes/{QuoteID}/History - * @param {string} QuoteID Unique identifier for an Quote - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetQuoteHistory(QuoteID: string): Observable { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an quote - * Put Quotes/{QuoteID}/History - * @param {string} QuoteID Unique identifier for an Quote - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateQuoteHistory(QuoteID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve quotes as PDF files - * Get Quotes/{QuoteID}/pdf - * @param {string} QuoteID Unique identifier for an Quote - * @return {void} Success - return response of byte array pdf version of specified Quotes - */ - GetQuoteAsPdf(QuoteID: string): Observable> { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments for Quotes - * Get Quotes/{QuoteID}/Attachments - * @param {string} QuoteID Unique identifier for Quote object - * @return {Attachments} Success - return response of type Attachments array of Attachment - */ - GetQuoteAttachments(QuoteID: string): Observable { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve specific Attachment on Quote - * Get Quotes/{QuoteID}/Attachments/{AttachmentID} - * @param {string} QuoteID Unique identifier for Quote object - * @param {string} AttachmentID Unique identifier for Attachment object - * @return {void} Success - return response of attachment for Quote as binary data - */ - GetQuoteAttachmentById(QuoteID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachment on Quote by Filename - * Get Quotes/{QuoteID}/Attachments/{FileName} - * @param {string} QuoteID Unique identifier for Quote object - * @param {string} FileName Name of the attachment - * @return {void} Success - return response of attachment for Quote as binary data - */ - GetQuoteAttachmentByFileName(QuoteID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve draft expense claim receipts for any user - * Get Receipts - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Receipts} Success - return response of type Receipts array for all Receipt - */ - GetReceipts(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Receipts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to create draft expense claim receipts for any user - * Put Receipts - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {Receipts} requestBody Receipts with an array of Receipt object in body of request - * @return {Receipts} Success - return response of type Receipts array for newly created Receipt - */ - CreateReceipt(unitdp: number | null | undefined, requestBody: Receipts): Observable { - return this.http.put(this.baseUri + 'Receipts?unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve a specified draft expense claim receipts - * Get Receipts/{ReceiptID} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Receipts} Success - return response of type Receipts array for a specified Receipt - */ - GetReceipt(ReceiptID: string, unitdp: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, {}); - } - - /** - * Allows you to retrieve a specified draft expense claim receipts - * Post Receipts/{ReceiptID} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Receipts} Success - return response of type Receipts array for updated Receipt - */ - UpdateReceipt(ReceiptID: string, unitdp: number | null | undefined, requestBody: Receipts): Observable { - return this.http.post(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve Attachments for expense claim receipts - * Get Receipts/{ReceiptID}/Attachments - * @param {string} ReceiptID Unique identifier for a Receipt - * @return {Attachments} Success - return response of type Attachments array of Attachments for a specified Receipt - */ - GetReceiptAttachments(ReceiptID: string): Observable { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve Attachments on expense claim receipts by ID - * Get Receipts/{ReceiptID}/Attachments/{AttachmentID} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Receipt as binary data - */ - GetReceiptAttachmentById(ReceiptID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve Attachments on expense claim receipts by file name - * Get Receipts/{ReceiptID}/Attachments/{FileName} - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {string} FileName The name of the file being attached to the Receipt - * @return {void} Success - return response of attachment for Receipt as binary data - */ - GetReceiptAttachmentByFileName(ReceiptID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve a history records of an Receipt - * Get Receipts/{ReceiptID}/History - * @param {string} ReceiptID Unique identifier for a Receipt - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetReceiptHistory(ReceiptID: string): Observable { - return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', {}); - } - - /** - * Allows you to retrieve a history records of an Receipt - * Put Receipts/{ReceiptID}/History - * @param {string} ReceiptID Unique identifier for a Receipt - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateReceiptHistory(ReceiptID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve any repeating invoices - * Get RepeatingInvoices - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array for all Repeating Invoice - */ - GetRepeatingInvoices(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to retrieve a specified repeating invoice - * Get RepeatingInvoices/{RepeatingInvoiceID} - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array with a specified Repeating Invoice - */ - GetRepeatingInvoice(RepeatingInvoiceID: string): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)), {}); - } - - /** - * Allows you to retrieve Attachments on repeating invoice - * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @return {Attachments} Success - return response of type Attachments array with all Attachments for a specified Repeating Invoice - */ - GetRepeatingInvoiceAttachments(RepeatingInvoiceID: string): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments', {}); - } - - /** - * Allows you to retrieve a specified Attachments on repeating invoices - * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID} - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @param {string} AttachmentID Unique identifier for a Attachment - * @return {void} Success - return response of attachment for Repeating Invoice as binary data - */ - GetRepeatingInvoiceAttachmentById(RepeatingInvoiceID: string, AttachmentID: string): Observable> { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve specified attachment on repeating invoices by file name - * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @param {string} FileName The name of the file being attached to a Repeating Invoice - * @return {void} Success - return response of attachment for Repeating Invoice as binary data - */ - GetRepeatingInvoiceAttachmentByFileName(RepeatingInvoiceID: string, FileName: string): Observable> { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); - } - - /** - * Allows you to retrieve history for a repeating invoice - * Get RepeatingInvoices/{RepeatingInvoiceID}/History - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord - */ - GetRepeatingInvoiceHistory(RepeatingInvoiceID: string): Observable { - return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', {}); - } - - /** - * Allows you to create history for a repeating invoice - * Put RepeatingInvoices/{RepeatingInvoiceID}/History - * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice - * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request - * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects - */ - CreateRepeatingInvoiceHistory(RepeatingInvoiceID: string, requestBody: HistoryRecords): Observable { - return this.http.put(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve report for TenNinetyNine - * Get Reports/TenNinetyNine - * @param {string} reportYear The year of the 1099 report - * @return {Reports} Success - return response of type Reports - */ - GetReportTenNinetyNine(reportYear: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/TenNinetyNine?reportYear=' + (reportYear == null ? '' : encodeURIComponent(reportYear)), {}); - } - - /** - * Allows you to retrieve report for AgedPayablesByContact - * Get Reports/AgedPayablesByContact - * @param {string} contactId Unique identifier for a Contact - * @param {Date} date The date of the Aged Payables By Contact report - * Type: DateOnly - * @param {Date} fromDate The from date of the Aged Payables By Contact report - * Type: DateOnly - * @param {Date} toDate The to date of the Aged Payables By Contact report - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportAgedPayablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/AgedPayablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for AgedReceivablesByContact - * Get Reports/AgedReceivablesByContact - * @param {string} contactId Unique identifier for a Contact - * @param {Date} date The date of the Aged Receivables By Contact report - * Type: DateOnly - * @param {Date} fromDate The from date of the Aged Receivables By Contact report - * Type: DateOnly - * @param {Date} toDate The to date of the Aged Receivables By Contact report - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportAgedReceivablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/AgedReceivablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for BalanceSheet - * Get Reports/BalanceSheet - * @param {string} date The date of the Balance Sheet report - * @param {number} periods The number of periods for the Balance Sheet report - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param {string} trackingOptionID1 The tracking option 1 for the Balance Sheet report - * @param {string} trackingOptionID2 The tracking option 2 for the Balance Sheet report - * @param {boolean} standardLayout The standard layout boolean for the Balance Sheet report - * @param {boolean} paymentsOnly return a cash basis for the Balance Sheet report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBalanceSheet(date: string | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingOptionID1: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/BalanceSheet?date=' + (date == null ? '' : encodeURIComponent(date)) + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingOptionID1=' + (trackingOptionID1 == null ? '' : encodeURIComponent(trackingOptionID1)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve report for BankSummary - * Get Reports/BankSummary - * @param {Date} fromDate The from date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @param {Date} toDate The to date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBankSummary(fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/BankSummary?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for BAS only valid for AU orgs - * Get Reports - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBASorGSTList(): Observable { - return this.http.get(this.baseUri + 'Reports', {}); - } - - /** - * Allows you to retrieve report for BAS only valid for AU orgs - * Get Reports/{ReportID} - * @param {string} ReportID Unique identifier for a Report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportBASorGST(ReportID: string): Observable { - return this.http.get(this.baseUri + 'Reports/' + (ReportID == null ? '' : encodeURIComponent(ReportID)), {}); - } - - /** - * Allows you to retrieve report for Budget Summary - * Get Reports/BudgetSummary - * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @param {number} period The number of periods to compare (integer between 1 and 12) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} timeframe The period size to compare to (1=month, 3=quarter, 12=year) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {ReportWithRows} success- return a Report with Rows object - */ - GetReportBudgetSummary(date: Date | null | undefined, period: number | null | undefined, timeframe: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/BudgetSummary?date=' + date?.toISOString() + '&period=' + period + '&timeframe=' + timeframe, {}); - } - - /** - * Allows you to retrieve report for ExecutiveSummary - * Get Reports/ExecutiveSummary - * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 - * Type: DateOnly - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportExecutiveSummary(date: Date | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/ExecutiveSummary?date=' + date?.toISOString(), {}); - } - - /** - * Allows you to retrieve report for ProfitAndLoss - * Get Reports/ProfitAndLoss - * @param {Date} fromDate The from date for the ProfitAndLoss report e.g. 2018-03-31 - * Type: DateOnly - * @param {Date} toDate The to date for the ProfitAndLoss report e.g. 2018-03-31 - * Type: DateOnly - * @param {number} periods The number of periods to compare (integer between 1 and 12) - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) - * @param {string} trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report - * @param {string} trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report - * @param {string} trackingOptionID The tracking option 1 for the ProfitAndLoss report - * @param {string} trackingOptionID2 The tracking option 2 for the ProfitAndLoss report - * @param {boolean} standardLayout Return the standard layout for the ProfitAndLoss report - * @param {boolean} paymentsOnly Return cash only basis for the ProfitAndLoss report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportProfitAndLoss(fromDate: Date | null | undefined, toDate: Date | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingCategoryID: string | null | undefined, trackingCategoryID2: string | null | undefined, trackingOptionID: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/ProfitAndLoss?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString() + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingCategoryID=' + (trackingCategoryID == null ? '' : encodeURIComponent(trackingCategoryID)) + '&trackingCategoryID2=' + (trackingCategoryID2 == null ? '' : encodeURIComponent(trackingCategoryID2)) + '&trackingOptionID=' + (trackingOptionID == null ? '' : encodeURIComponent(trackingOptionID)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve report for TrialBalance - * Get Reports/TrialBalance - * @param {Date} date The date for the Trial Balance report e.g. 2018-03-31 - * Type: DateOnly - * @param {boolean} paymentsOnly Return cash only basis for the Trial Balance report - * @return {ReportWithRows} Success - return response of type ReportWithRows - */ - GetReportTrialBalance(date: Date | null | undefined, paymentsOnly: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'Reports/TrialBalance?date=' + date?.toISOString() + '&paymentsOnly=' + paymentsOnly, {}); - } - - /** - * Allows you to retrieve Tax Rates - * Get TaxRates - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {string} TaxType Filter by tax type - * @return {TaxRates} Success - return response of type TaxRates array with TaxRates - */ - GetTaxRates(where: string | null | undefined, order: string | null | undefined, TaxType: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'TaxRates?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&TaxType=' + (TaxType == null ? '' : encodeURIComponent(TaxType)), {}); - } - - /** - * Allows you to create one or more Tax Rates - * Put TaxRates - * @param {TaxRates} requestBody TaxRates array with TaxRate object in body of request - * @return {TaxRates} Success - return response of type TaxRates array newly created TaxRate - */ - CreateTaxRates(requestBody: TaxRates): Observable { - return this.http.put(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update Tax Rates - * Post TaxRates - * @return {TaxRates} Success - return response of type TaxRates array updated TaxRate - */ - UpdateTaxRate(requestBody: TaxRates): Observable { - return this.http.post(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve tracking categories and options - * Get TrackingCategories - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @param {boolean} includeArchived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response - * @return {TrackingCategories} Success - return response of type TrackingCategories array of TrackingCategory - */ - GetTrackingCategories(where: string | null | undefined, order: string | null | undefined, includeArchived: boolean | null | undefined): Observable { - return this.http.get(this.baseUri + 'TrackingCategories?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&includeArchived=' + includeArchived, {}); - } - - /** - * Allows you to create tracking categories - * Put TrackingCategories - * @param {TrackingCategory} requestBody TrackingCategory object in body of request - * @return {TrackingCategories} Success - return response of type TrackingCategories array of newly created TrackingCategory - */ - CreateTrackingCategory(requestBody: TrackingCategory): Observable { - return this.http.put(this.baseUri + 'TrackingCategories', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to retrieve tracking categories and options for specified category - * Get TrackingCategories/{TrackingCategoryID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @return {TrackingCategories} Success - return response of type TrackingCategories array of specified TrackingCategory - */ - GetTrackingCategory(TrackingCategoryID: string): Observable { - return this.http.get(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); - } - - /** - * Allows you to update tracking categories - * Post TrackingCategories/{TrackingCategoryID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @return {TrackingCategories} Success - return response of type TrackingCategories array of updated TrackingCategory - */ - UpdateTrackingCategory(TrackingCategoryID: string, requestBody: TrackingCategory): Observable { - return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete tracking categories - * Delete TrackingCategories/{TrackingCategoryID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @return {TrackingCategories} Success - return response of type TrackingCategories array of deleted TrackingCategory - */ - DeleteTrackingCategory(TrackingCategoryID: string): Observable { - return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); - } - - /** - * Allows you to create options for a specified tracking category - * Put TrackingCategories/{TrackingCategoryID}/Options - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @param {TrackingOption} requestBody TrackingOption object in body of request - * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category - */ - CreateTrackingOptions(TrackingCategoryID: string, requestBody: TrackingOption): Observable { - return this.http.put(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to update options for a specified tracking category - * Post TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @param {string} TrackingOptionID Unique identifier for a Tracking Option - * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category - */ - UpdateTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string, requestBody: TrackingOption): Observable { - return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * Allows you to delete a specified option for a specified tracking category - * Delete TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} - * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory - * @param {string} TrackingOptionID Unique identifier for a Tracking Option - * @return {TrackingOptions} Success - return response of type TrackingOptions array of remaining options for a specified category - */ - DeleteTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string): Observable { - return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), {}); - } - - /** - * Allows you to retrieve users - * Get Users - * @param {string} where Filter by an any element - * @param {string} order Order by an any element - * @return {Users} Success - return response of type Users array of all User - */ - GetUsers(where: string | null | undefined, order: string | null | undefined): Observable { - return this.http.get(this.baseUri + 'Users?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); - } - - /** - * Allows you to retrieve a specified user - * Get Users/{UserID} - * @param {string} UserID Unique identifier for a User - * @return {Users} Success - return response of type Users array of specified User - */ - GetUser(UserID: string): Observable { - return this.http.get(this.baseUri + 'Users/' + (UserID == null ? '' : encodeURIComponent(UserID)), {}); - } - } - - export enum GetReportBalanceSheetTimeframe { MONTH = 0, QUARTER = 1, YEAR = 2 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Address { + + /** define the type of address */ + AddressType?: AddressAddressType | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine1?: string | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine2?: string | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine3?: string | null; + + /** + * max length = 500 + * Max length: 500 + */ + AddressLine4?: string | null; + + /** + * max length = 255 + * Max length: 255 + */ + City?: string | null; + + /** + * max length = 255 + * Max length: 255 + */ + Region?: string | null; + + /** + * max length = 50 + * Max length: 50 + */ + PostalCode?: string | null; + + /** + * max length = 50, [A-Z], [a-z] only + * Max length: 50 + */ + Country?: string | null; + + /** + * max length = 255 + * Max length: 255 + */ + AttentionTo?: string | null; + } + + export enum AddressAddressType { POBOX = 0, STREET = 1, DELIVERY = 2 } + + export interface Phone { + PhoneType?: PhonePhoneType | null; + + /** + * max length = 50 + * Max length: 50 + */ + PhoneNumber?: string | null; + + /** + * max length = 10 + * Max length: 10 + */ + PhoneAreaCode?: string | null; + + /** + * max length = 20 + * Max length: 20 + */ + PhoneCountryCode?: string | null; + } + + export enum PhonePhoneType { DEFAULT = 0, DDI = 1, MOBILE = 2, FAX = 3, OFFICE = 4 } + + export interface Accounts { + Accounts1?: Array; + } + + export interface Account { + + /** + * Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) + * Max length: 10 + */ + Code?: string | null; + + /** + * Name of account (max length = 150) + * Max length: 150 + */ + Name?: string | null; + + /** The Xero identifier for an account � specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + AccountID?: string | null; + + /** See Account Types */ + Type?: AccountType | null; + + /** For bank accounts only (Account Type BANK) */ + BankAccountNumber?: string | null; + + /** Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes */ + Status?: AccountStatus | null; + + /** Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) */ + Description?: string | null; + + /** For bank accounts only. See Bank Account types */ + BankAccountType?: AccountBankAccountType | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** Boolean � describes whether account can have payments applied to it */ + EnablePaymentsToAccount?: boolean | null; + + /** Boolean � describes whether account code is available for use with expense claims */ + ShowInExpenseClaims?: boolean | null; + + /** See Account Class Types */ + Class?: AccountClass | null; + + /** If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either �� or null. */ + SystemAccount?: AccountSystemAccount | null; + + /** Shown if set */ + ReportingCode?: string | null; + + /** Shown if set */ + ReportingCodeName?: string | null; + + /** boolean to indicate if an account has an attachment (read only) */ + HasAttachments?: boolean | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Boolean � describes whether the account is shown in the watchlist widget on the dashboard */ + AddToWatchlist?: boolean | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum AccountType { BANK = 0, CURRENT = 1, CURRLIAB = 2, DEPRECIATN = 3, DIRECTCOSTS = 4, EQUITY = 5, EXPENSE = 6, FIXED = 7, INVENTORY = 8, LIABILITY = 9, NONCURRENT = 10, OTHERINCOME = 11, OVERHEADS = 12, PREPAYMENT = 13, REVENUE = 14, SALES = 15, TERMLIAB = 16, PAYGLIABILITY = 17, PAYG = 18, SUPERANNUATIONEXPENSE = 19, SUPERANNUATIONLIABILITY = 20, WAGESEXPENSE = 21 } + + export enum AccountStatus { ACTIVE = 0, ARCHIVED = 1, DELETED = 2 } + + export enum AccountBankAccountType { BANK = 0, CREDITCARD = 1, PAYPAL = 2, NONE = 3, '' = 4 } + + export enum AccountCurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + export enum AccountClass { ASSET = 0, EQUITY = 1, EXPENSE = 2, LIABILITY = 3, REVENUE = 4 } + + export enum AccountSystemAccount { DEBTORS = 0, CREDITORS = 1, BANKCURRENCYGAIN = 2, GST = 3, GSTONIMPORTS = 4, HISTORICAL = 5, REALISEDCURRENCYGAIN = 6, RETAINEDEARNINGS = 7, ROUNDING = 8, TRACKINGTRANSFERS = 9, UNPAIDEXPCLM = 10, UNREALISEDCURRENCYGAIN = 11, WAGEPAYABLES = 12, CISASSETS = 13, CISASSET = 14, CISLABOUR = 15, CISLABOUREXPENSE = 16, CISLABOURINCOME = 17, CISLIABILITY = 18, CISMATERIALS = 19, '' = 20 } + + export interface ValidationError { + + /** Validation error message */ + Message?: string | null; + } + + export interface Attachments { + Attachments1?: Array; + } + + export interface Attachment { + + /** Unique ID for the file */ + AttachmentID?: string | null; + + /** Name of the file */ + FileName?: string | null; + + /** URL to the file on xero.com */ + Url?: string | null; + + /** Type of file */ + MimeType?: string | null; + + /** + * Length of the file content + * Type: double + */ + ContentLength?: number | null; + + /** Include the file with the online invoice */ + IncludeOnline?: boolean | null; + } + + export interface BankTransactions { + BankTransactions1?: Array; + } + + export interface BankTransaction { + + /** + * See Bank Transaction Types + * Required + */ + Type: BankTransactionType; + + /** Required */ + Contact: Contact; + + /** + * See LineItems + * Required + */ + LineItems: Array; + + /** Required */ + BankAccount: Account; + + /** Boolean to show if transaction is reconciled */ + IsReconciled?: boolean | null; + + /** + * Date of transaction � YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** Reference for the transaction. Only supported for SPEND and RECEIVE transactions. */ + Reference?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn�t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. + * Type: double + */ + CurrencyRate?: number | null; + + /** URL link to a source document � shown as �Go to App Name� */ + Url?: string | null; + + /** See Bank Transaction Status Codes */ + Status?: BankTransactionStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** + * Total of bank transaction excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on bank transaction + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of bank transaction tax inclusive + * Type: double + */ + Total?: number | null; + + /** Xero generated unique identifier for bank transaction */ + BankTransactionID?: string | null; + + /** Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT */ + PrepaymentID?: string | null; + + /** Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT */ + OverpaymentID?: string | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Boolean to indicate if a bank transaction has an attachment */ + HasAttachments?: boolean | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum BankTransactionType { RECEIVE = 0, 'RECEIVE-OVERPAYMENT' = 1, 'RECEIVE-PREPAYMENT' = 2, SPEND = 3, 'SPEND-OVERPAYMENT' = 4, 'SPEND-PREPAYMENT' = 5, 'RECEIVE-TRANSFER' = 6, 'SPEND-TRANSFER' = 7 } + + export interface Contact { + + /** Xero identifier */ + ContactID?: string | null; + + /** + * This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. + * Max length: 50 + */ + ContactNumber?: string | null; + + /** + * A user defined account number. This can be updated via the API and the Xero UI (max length = 50) + * Max length: 50 + */ + AccountNumber?: string | null; + + /** Current status of a contact � see contact status types */ + ContactStatus?: ContactContactStatus | null; + + /** + * Full name of contact/organisation (max length = 255) + * Max length: 255 + */ + Name?: string | null; + + /** + * First name of contact person (max length = 255) + * Max length: 255 + */ + FirstName?: string | null; + + /** + * Last name of contact person (max length = 255) + * Max length: 255 + */ + LastName?: string | null; + + /** + * Email address of contact person (umlauts not supported) (max length = 255) + * Max length: 255 + */ + EmailAddress?: string | null; + + /** Skype user name of contact */ + SkypeUserName?: string | null; + + /** See contact persons */ + ContactPersons?: Array; + + /** Bank account number of contact */ + BankAccountDetails?: string | null; + + /** + * Tax number of contact � this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) + * Max length: 50 + */ + TaxNumber?: string | null; + + /** The tax type from TaxRates */ + AccountsReceivableTaxType?: string | null; + + /** The tax type from TaxRates */ + AccountsPayableTaxType?: string | null; + + /** Store certain address types for a contact � see address types */ + Addresses?: Array
; + + /** Store certain phone types for a contact � see phone types */ + Phones?: Array; + + /** true or false � Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts payable invoice is generated against this contact. */ + IsSupplier?: boolean | null; + + /** true or false � Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST � it is automatically set when an accounts receivable invoice is generated against this contact. */ + IsCustomer?: boolean | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + DefaultCurrency?: AccountCurrencyCode | null; + + /** Store XeroNetworkKey for contacts. */ + XeroNetworkKey?: string | null; + + /** The default sales account code for contacts */ + SalesDefaultAccountCode?: string | null; + + /** The default purchases account code for contacts */ + PurchasesDefaultAccountCode?: string | null; + + /** The default sales tracking categories for contacts */ + SalesTrackingCategories?: Array; + + /** The default purchases tracking categories for contacts */ + PurchasesTrackingCategories?: Array; + + /** The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ + TrackingCategoryName?: string | null; + + /** The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories */ + TrackingCategoryOption?: string | null; + PaymentTerms?: PaymentTerm; + + /** UTC timestamp of last update to contact */ + UpdatedDateUTC?: Date | null; + + /** Displays which contact groups a contact is included in */ + ContactGroups?: Array; + + /** Website address for contact (read only) */ + Website?: string | null; + BrandingTheme?: BrandingTheme; + + /** Bank details for use on a batch payment stored with each contact */ + BatchPayments?: BatchPaymentDetails; + + /** + * The default discount rate for the contact (read only) + * Type: double + */ + Discount?: number | null; + + /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ + Balances?: Balances; + + /** Displays array of attachments from the API */ + Attachments?: Array; + + /** A boolean to indicate if a contact has an attachment */ + HasAttachments?: boolean | null; + + /** Displays validation errors returned from the API */ + ValidationErrors?: Array; + + /** A boolean to indicate if a contact has an validation errors */ + HasValidationErrors?: boolean | null; + + /** Status of object */ + StatusAttributeString?: string | null; + } + + export enum ContactContactStatus { ACTIVE = 0, ARCHIVED = 1, GDPRREQUEST = 2 } + + export interface ContactPerson { + + /** First name of person */ + FirstName?: string | null; + + /** Last name of person */ + LastName?: string | null; + + /** Email address of person */ + EmailAddress?: string | null; + + /** boolean to indicate whether contact should be included on emails with invoices etc. */ + IncludeInEmails?: boolean | null; + } + + export interface SalesTrackingCategory { + + /** The default sales tracking category name for contacts */ + TrackingCategoryName?: string | null; + + /** The default purchase tracking category name for contacts */ + TrackingOptionName?: string | null; + } + + export interface PaymentTerm { + Bills?: Bill; + Sales?: Bill; + } + + export interface Bill { + + /** + * Day of Month (0-31) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Day?: number | null; + Type?: BillType | null; + } + + export enum BillType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } + + export interface ContactGroup { + + /** The Name of the contact group. Required when creating a new contact group */ + Name?: string | null; + + /** The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. */ + Status?: ContactGroupStatus | null; + + /** The Xero identifier for an contact group � specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + ContactGroupID?: string | null; + + /** The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. */ + Contacts?: Array; + } + + export enum ContactGroupStatus { ACTIVE = 0, DELETED = 1 } + + export interface BrandingTheme { + + /** Xero identifier */ + BrandingThemeID?: string | null; + + /** Name of branding theme */ + Name?: string | null; + + /** The location of the image file used as the logo on this branding theme */ + LogoUrl?: string | null; + + /** Always INVOICE */ + Type?: BrandingThemeType | null; + + /** + * Integer � ranked order of branding theme. The default branding theme has a value of 0 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + SortOrder?: number | null; + + /** UTC timestamp of creation date of branding theme */ + CreatedDateUTC?: Date | null; + } + + export enum BrandingThemeType { INVOICE = 0 } + + + /** The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) */ + export interface Balances { + AccountsReceivable?: AccountsReceivable; + AccountsPayable?: AccountsPayable; + } + + export interface AccountsReceivable { + + /** Type: double */ + Outstanding?: number | null; + + /** Type: double */ + Overdue?: number | null; + } + + export interface AccountsPayable { + + /** Type: double */ + Outstanding?: number | null; + + /** Type: double */ + Overdue?: number | null; + } + + export interface LineItem { + + /** LineItem unique ID */ + LineItemID?: string | null; + + /** Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character */ + Description?: string | null; + + /** + * LineItem Quantity + * Type: double + */ + Quantity?: number | null; + + /** + * LineItem Unit Amount + * Type: double + */ + UnitAmount?: number | null; + + /** See Items */ + ItemCode?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** + * The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. + * Type: double + */ + TaxAmount?: number | null; + + /** + * If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 � DiscountRate)/100) + * Type: double + */ + LineAmount?: number | null; + + /** Optional Tracking Category � see Tracking. Any LineItem can have a maximum of 2 elements. */ + Tracking?: Array; + + /** + * Percentage discount being applied to a line item (only supported on ACCREC invoices � ACC PAY invoices and credit notes in Xero do not support discounts + * Type: double + */ + DiscountRate?: number | null; + + /** + * Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. + * Type: double + */ + DiscountAmount?: number | null; + + /** The Xero identifier for a Repeating Invoice */ + RepeatingInvoiceID?: string | null; + } + + export interface LineItemTracking { + + /** The Xero identifier for a tracking category */ + TrackingCategoryID?: string | null; + + /** The Xero identifier for a tracking category option */ + TrackingOptionID?: string | null; + + /** + * The name of the tracking category + * Max length: 100 + */ + Name?: string | null; + + /** See Tracking Options */ + Option?: string | null; + } + + export enum BankTransactionStatus { AUTHORISED = 0, DELETED = 1, VOIDED = 2 } + + export enum BankTransactionLineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } + + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + export enum LineAmountTypes { Exclusive = 0, Inclusive = 1, NoTax = 2 } + + export interface BankTransfers { + BankTransfers1?: Array; + } + + export interface BankTransfer { + + /** Required */ + FromBankAccount: Account; + + /** Required */ + ToBankAccount: Account; + + /** + * amount of the transaction + * Required + * Type: double + */ + Amount: number; + + /** + * The date of the Transfer YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** The identifier of the Bank Transfer */ + BankTransferID?: string | null; + + /** + * The currency rate + * Type: double + */ + CurrencyRate?: number | null; + + /** The Bank Transaction ID for the source account */ + FromBankTransactionID?: string | null; + + /** The Bank Transaction ID for the destination account */ + ToBankTransactionID?: string | null; + + /** Boolean to indicate if a Bank Transfer has an attachment */ + HasAttachments?: boolean | null; + + /** UTC timestamp of creation date of bank transfer */ + CreatedDateUTC?: Date | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface BatchPayments { + BatchPayments1?: Array; + } + + export interface BatchPayment { + Account?: Account; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Reference?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Particulars?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Code?: string | null; + + /** + * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * Max length: 18 + */ + Details?: string | null; + + /** + * (UK Only) Only shows on the statement line in Xero. Max length =18 + * Max length: 18 + */ + Narrative?: string | null; + + /** The Xero generated unique identifier for the bank transaction (read-only) */ + BatchPaymentID?: string | null; + + /** Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 */ + DateString?: string | null; + + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * Type: DateOnly + */ + Date?: Date | null; + + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * Type: double + */ + Amount?: number | null; + Payments?: Array; + + /** PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) */ + Type?: BatchPaymentType | null; + + /** AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. */ + Status?: PaymentStatus | null; + + /** The total of the payments that make up the batch (read-only) */ + TotalAmount?: string | null; + + /** UTC timestamp of last update to the payment */ + UpdatedDateUTC?: Date | null; + + /** Booelan that tells you if the batch payment has been reconciled (read-only) */ + IsReconciled?: string | null; + } + + export interface Payment { + Invoice?: Invoice; + CreditNote?: CreditNote; + Prepayment?: Prepayment; + Overpayment?: Overpayment; + + /** Number of invoice or credit note you are applying payment to e.g.INV-4003 */ + InvoiceNumber?: string | null; + + /** Number of invoice or credit note you are applying payment to e.g. INV-4003 */ + CreditNoteNumber?: string | null; + Account?: Account; + + /** Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) */ + Code?: string | null; + + /** + * Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + * Type: DateOnly + */ + Date?: Date | null; + + /** + * Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + * Type: double + */ + Amount?: number | null; + + /** An optional description for the payment e.g. Direct Debit */ + Reference?: string | null; + + /** An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET */ + IsReconciled?: boolean | null; + + /** The status of the payment. */ + Status?: PaymentStatus | null; + + /** See Payment Types. */ + PaymentType?: PaymentPaymentType | null; + + /** UTC timestamp of last update to the payment */ + UpdatedDateUTC?: Date | null; + + /** The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + PaymentID?: string | null; + + /** The suppliers bank account number the payment is being made to */ + BankAccountNumber?: string | null; + + /** The suppliers bank account number the payment is being made to */ + Particulars?: string | null; + + /** The information to appear on the supplier's bank account */ + Details?: string | null; + + /** A boolean to indicate if a contact has an validation errors */ + HasAccount?: boolean | null; + + /** A boolean to indicate if a contact has an validation errors */ + HasValidationErrors?: boolean | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface Invoice { + + /** See Invoice Types */ + Type?: InvoiceType | null; + Contact?: Contact; + + /** See LineItems */ + LineItems?: Array; + + /** + * Date invoice was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** + * Date invoice is due � YYYY-MM-DD + * Type: DateOnly + */ + DueDate?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** + * ACCREC � Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) + * Max length: 255 + */ + InvoiceNumber?: string | null; + + /** + * ACCREC only � additional reference number (max length = 255) + * Max length: 255 + */ + Reference?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ + Url?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) + * Type: double + */ + CurrencyRate?: number | null; + + /** See Invoice Status Codes */ + Status?: InvoiceStatus | null; + + /** Boolean to set whether the invoice in the Xero app should be marked as �sent�. This can be set only on invoices that have been approved */ + SentToContact?: boolean | null; + + /** + * Shown on sales invoices (Accounts Receivable) when this has been set + * Type: DateOnly + */ + ExpectedPaymentDate?: Date | null; + + /** + * Shown on bills (Accounts Payable) when this has been set + * Type: DateOnly + */ + PlannedPaymentDate?: Date | null; + + /** + * CIS deduction for UK contractors + * Type: double + */ + CISDeduction?: number | null; + + /** + * Total of invoice excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on invoice + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts + * Type: double + */ + Total?: number | null; + + /** + * Total of discounts applied on the invoice line items + * Type: double + */ + TotalDiscount?: number | null; + + /** Xero generated unique identifier for invoice */ + InvoiceID?: string | null; + + /** boolean to indicate if an invoice has an attachment */ + HasAttachments?: boolean | null; + + /** boolean to indicate if an invoice has a discount */ + IsDiscounted?: boolean | null; + + /** See Payments */ + Payments?: Array; + + /** See Prepayments */ + Prepayments?: Array; + + /** See Overpayments */ + Overpayments?: Array; + + /** + * Amount remaining to be paid on invoice + * Type: double + */ + AmountDue?: number | null; + + /** + * Sum of payments received for invoice + * Type: double + */ + AmountPaid?: number | null; + + /** + * The date the invoice was fully paid. Only returned on fully paid invoices + * Type: DateOnly + */ + FullyPaidOnDate?: Date | null; + + /** + * Sum of all credit notes, over-payments and pre-payments applied to invoice + * Type: double + */ + AmountCredited?: number | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Details of credit notes that have been applied to an invoice */ + CreditNotes?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + + /** A boolean to indicate if a invoice has an validation errors */ + HasErrors?: boolean | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + } + + export enum InvoiceType { ACCPAY = 0, ACCPAYCREDIT = 1, APOVERPAYMENT = 2, APPREPAYMENT = 3, ACCREC = 4, ACCRECCREDIT = 5, AROVERPAYMENT = 6, ARPREPAYMENT = 7 } + + export enum InvoiceStatus { DRAFT = 0, SUBMITTED = 1, DELETED = 2, AUTHORISED = 3, PAID = 4, VOIDED = 5 } + + export interface Prepayment { + + /** See Prepayment Types */ + Type?: PrepaymentType | null; + Contact?: Contact; + + /** + * The date the prepayment is created YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** See Prepayment Status Codes */ + Status?: PrepaymentStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Prepayment Line Items */ + LineItems?: Array; + + /** + * The subtotal of the prepayment excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * The total tax on the prepayment + * Type: double + */ + TotalTax?: number | null; + + /** + * The total of the prepayment(subtotal + total tax) + * Type: double + */ + Total?: number | null; + + /** Returns Invoice number field. Reference field isn't available. */ + Reference?: string | null; + + /** UTC timestamp of last update to the prepayment */ + UpdatedDateUTC?: Date | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** Xero generated unique identifier */ + PrepaymentID?: string | null; + + /** + * The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The remaining credit balance on the prepayment + * Type: double + */ + RemainingCredit?: number | null; + + /** See Allocations */ + Allocations?: Array; + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount?: number | null; + + /** boolean to indicate if a prepayment has an attachment */ + HasAttachments?: boolean | null; + + /** See Attachments */ + Attachments?: Array; + } + + export enum PrepaymentType { 'RECEIVE-PREPAYMENT' = 0, 'SPEND-PREPAYMENT' = 1, ARPREPAYMENT = 2, APPREPAYMENT = 3 } + + export enum PrepaymentStatus { AUTHORISED = 0, PAID = 1, VOIDED = 2 } + + export interface Allocation { + + /** Required */ + Invoice: Invoice; + Overpayment?: Overpayment; + Prepayment?: Prepayment; + CreditNote?: CreditNote; + + /** + * the amount being applied to the invoice + * Required + * Type: double + */ + Amount: number; + + /** + * the date the allocation is applied YYYY-MM-DD. + * Required + * Type: DateOnly + */ + Date: Date; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface Overpayment { + + /** See Overpayment Types */ + Type?: OverpaymentType | null; + Contact?: Contact; + + /** + * The date the overpayment is created YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** See Overpayment Status Codes */ + Status?: PrepaymentStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Overpayment Line Items */ + LineItems?: Array; + + /** + * The subtotal of the overpayment excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * The total tax on the overpayment + * Type: double + */ + TotalTax?: number | null; + + /** + * The total of the overpayment (subtotal + total tax) + * Type: double + */ + Total?: number | null; + + /** UTC timestamp of last update to the overpayment */ + UpdatedDateUTC?: Date | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** Xero generated unique identifier */ + OverpaymentID?: string | null; + + /** + * The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The remaining credit balance on the overpayment + * Type: double + */ + RemainingCredit?: number | null; + + /** See Allocations */ + Allocations?: Array; + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount?: number | null; + + /** See Payments */ + Payments?: Array; + + /** boolean to indicate if a overpayment has an attachment */ + HasAttachments?: boolean | null; + + /** See Attachments */ + Attachments?: Array; + } + + export enum OverpaymentType { 'RECEIVE-OVERPAYMENT' = 0, 'SPEND-OVERPAYMENT' = 1, AROVERPAYMENT = 2 } + + export interface CreditNote { + + /** See Credit Note Types */ + Type?: CreditNoteType | null; + Contact?: Contact; + + /** + * The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** See Credit Note Status Codes */ + Status?: InvoiceStatus | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Invoice Line Items */ + LineItems?: Array; + + /** + * The subtotal of the credit note excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * The total tax on the credit note + * Type: double + */ + TotalTax?: number | null; + + /** + * The total of the Credit Note(subtotal + total tax) + * Type: double + */ + Total?: number | null; + + /** UTC timestamp of last update to the credit note */ + UpdatedDateUTC?: Date | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * Date when credit note was fully paid(UTC format) + * Type: DateOnly + */ + FullyPaidOnDate?: Date | null; + + /** Xero generated unique identifier */ + CreditNoteID?: string | null; + + /** ACCRECCREDIT � Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) */ + CreditNoteNumber?: string | null; + + /** ACCRECCREDIT only � additional reference number */ + Reference?: string | null; + + /** boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) */ + SentToContact?: boolean | null; + + /** + * The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used + * Type: double + */ + CurrencyRate?: number | null; + + /** + * The remaining credit balance on the Credit Note + * Type: double + */ + RemainingCredit?: number | null; + + /** See Allocations */ + Allocations?: Array; + + /** + * The amount of applied to an invoice + * Type: double + */ + AppliedAmount?: number | null; + + /** See Payments */ + Payments?: Array; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** boolean to indicate if a credit note has an attachment */ + HasAttachments?: boolean | null; + + /** A boolean to indicate if a credit note has an validation errors */ + HasErrors?: boolean | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum CreditNoteType { ACCPAYCREDIT = 0, ACCRECCREDIT = 1 } + + export enum PaymentStatus { AUTHORISED = 0, DELETED = 1 } + + export enum PaymentPaymentType { ACCRECPAYMENT = 0, ACCPAYPAYMENT = 1, ARCREDITPAYMENT = 2, APCREDITPAYMENT = 3, AROVERPAYMENTPAYMENT = 4, ARPREPAYMENTPAYMENT = 5, APPREPAYMENTPAYMENT = 6, APOVERPAYMENTPAYMENT = 7 } + + export enum BatchPaymentType { PAYBATCH = 0, RECBATCH = 1 } + + + /** Bank details for use on a batch payment stored with each contact */ + export interface BatchPaymentDetails { + + /** Bank account number for use with Batch Payments */ + BankAccountNumber?: string | null; + + /** Name of bank for use with Batch Payments */ + BankAccountName?: string | null; + + /** + * (Non-NZ Only) These details are sent to the org�s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + * Max length: 18 + */ + Details?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Code?: string | null; + + /** + * (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + * Max length: 12 + */ + Reference?: string | null; + } + + export interface BrandingThemes { + BrandingThemes1?: Array; + } + + export interface PaymentServices { + PaymentServices1?: Array; + } + + export interface PaymentService { + + /** Xero identifier */ + PaymentServiceID?: string | null; + + /** Name of payment service */ + PaymentServiceName?: string | null; + + /** The custom payment URL */ + PaymentServiceUrl?: string | null; + + /** The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card */ + PayNowText?: string | null; + + /** This will always be CUSTOM for payment services created via the API. */ + PaymentServiceType?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface Contacts { + Contacts1?: Array; + } + + export interface CISSettings { + CISSettings1?: Array; + } + + export interface CISSetting { + + /** Boolean that describes if the contact is a CIS Subcontractor */ + CISEnabled?: boolean | null; + + /** + * CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Rate?: number | null; + } + + export interface CISOrgSetting { + + /** true or false - Boolean that describes if the organisation is a CIS Contractor */ + CISContractorEnabled?: boolean | null; + + /** true or false - Boolean that describes if the organisation is a CIS SubContractor */ + CISSubContractorEnabled?: boolean | null; + + /** + * CIS Deduction rate for the organisation + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Rate?: number | null; + } + + export interface ContactGroups { + ContactGroups1?: Array; + } + + export interface RequestEmpty { + + /** Need at least one field to create an empty JSON payload */ + Status?: string | null; + } + + export interface CreditNotes { + CreditNotes1?: Array; + } + + export interface Allocations { + Allocations1?: Array; + } + + export interface Currencies { + Currencies1?: Array; + } + + export interface Currency { + + /** 3 letter alpha code for the currency � see list of currency codes */ + Code?: AccountCurrencyCode | null; + + /** Name of Currency */ + Description?: string | null; + } + + + /** 3 letter alpha code for the currency � see list of currency codes */ + export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + export interface Employees { + Employees1?: Array; + } + + export interface Employee { + + /** The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + EmployeeID?: string | null; + + /** Current status of an employee � see contact status types */ + Status?: ContactContactStatus | null; + + /** + * First name of an employee (max length = 255) + * Max length: 255 + */ + FirstName?: string | null; + + /** + * Last name of an employee (max length = 255) + * Max length: 255 + */ + LastName?: string | null; + ExternalLink?: ExternalLink; + UpdatedDateUTC?: Date | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface ExternalLink { + + /** See External link types */ + LinkType?: ExternalLinkLinkType | null; + + /** URL for service e.g. http://twitter.com/xeroapi */ + Url?: string | null; + Description?: string | null; + } + + export enum ExternalLinkLinkType { Facebook = 0, GooglePlus = 1, LinkedIn = 2, Twitter = 3, Website = 4 } + + export interface ExpenseClaims { + ExpenseClaims1?: Array; + } + + export interface ExpenseClaim { + + /** Xero generated unique identifier for an expense claim */ + ExpenseClaimID?: string | null; + + /** Current status of an expense claim � see status types */ + Status?: ExpenseClaimStatus | null; + + /** See Payments */ + Payments?: Array; + User?: User; + Receipts?: Array; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** + * The total of an expense claim being paid + * Type: double + */ + Total?: number | null; + + /** + * The amount due to be paid for an expense claim + * Type: double + */ + AmountDue?: number | null; + + /** + * The amount still to pay for an expense claim + * Type: double + */ + AmountPaid?: number | null; + + /** + * The date when the expense claim is due to be paid YYYY-MM-DD + * Type: DateOnly + */ + PaymentDueDate?: Date | null; + + /** + * The date the expense claim will be reported in Xero YYYY-MM-DD + * Type: DateOnly + */ + ReportingDate?: Date | null; + + /** The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 */ + ReceiptID?: string | null; + } + + export enum ExpenseClaimStatus { SUBMITTED = 0, AUTHORISED = 1, PAID = 2, VOIDED = 3, DELETED = 4 } + + export interface User { + + /** Xero identifier */ + UserID?: string | null; + + /** Email address of user */ + EmailAddress?: string | null; + + /** First name of user */ + FirstName?: string | null; + + /** Last name of user */ + LastName?: string | null; + + /** Timestamp of last change to user */ + UpdatedDateUTC?: Date | null; + + /** Boolean to indicate if user is the subscriber */ + IsSubscriber?: boolean | null; + + /** User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) */ + OrganisationRole?: UserOrganisationRole | null; + } + + export enum UserOrganisationRole { READONLY = 0, INVOICEONLY = 1, STANDARD = 2, FINANCIALADVISER = 3, MANAGEDCLIENT = 4, CASHBOOKCLIENT = 5, UNKNOWN = 6 } + + export interface Receipt { + + /** + * Date of receipt � YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + Contact?: Contact; + LineItems?: Array; + User?: User; + + /** Additional reference number */ + Reference?: string | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** + * Total of receipt excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on receipt + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of receipt tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total?: number | null; + + /** Xero generated unique identifier for receipt */ + ReceiptID?: string | null; + + /** Current status of receipt � see status types */ + Status?: ReceiptStatus | null; + + /** Xero generated sequence number for receipt in current claim for a given user */ + ReceiptNumber?: string | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** boolean to indicate if a receipt has an attachment */ + HasAttachments?: boolean | null; + + /** URL link to a source document � shown as �Go to [appName]� in the Xero app */ + Url?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + + export enum ReceiptStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, DECLINED = 3, VOIDED = 4 } + + export interface HistoryRecords { + HistoryRecords1?: Array; + } + + export interface HistoryRecord { + + /** details */ + Details?: string | null; + + /** Name of branding theme */ + Changes?: string | null; + + /** has a value of 0 */ + User?: string | null; + + /** UTC timestamp of creation date of branding theme */ + DateUTC?: Date | null; + } + + export interface Invoices { + Invoices1?: Array; + } + + export interface OnlineInvoices { + OnlineInvoices1?: Array; + } + + export interface OnlineInvoice { + + /** the URL to an online invoice */ + OnlineInvoiceUrl?: string | null; + } + + export interface InvoiceReminders { + InvoiceReminders1?: Array; + } + + export interface InvoiceReminder { + + /** setting for on or off */ + Enabled?: boolean | null; + } + + export interface Items { + Items1?: Array; + } + + export interface Item { + + /** + * User defined item code (max length = 30) + * Required + * Max length: 30 + */ + Code: string; + + /** The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item */ + InventoryAssetAccountCode?: string | null; + + /** + * The name of the item (max length = 50) + * Max length: 50 + */ + Name?: string | null; + + /** Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. */ + IsSold?: boolean | null; + + /** Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. */ + IsPurchased?: boolean | null; + + /** + * The sales description of the item (max length = 4000) + * Max length: 4000 + */ + Description?: string | null; + + /** + * The purchase description of the item (max length = 4000) + * Max length: 4000 + */ + PurchaseDescription?: string | null; + PurchaseDetails?: Purchase; + SalesDetails?: Purchase; + + /** True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. */ + IsTrackedAsInventory?: boolean | null; + + /** + * The value of the item on hand. Calculated using average cost accounting. + * Type: double + */ + TotalCostPool?: number | null; + + /** + * The quantity of the item on hand + * Type: double + */ + QuantityOnHand?: number | null; + + /** Last modified date in UTC format */ + UpdatedDateUTC?: Date | null; + + /** The Xero identifier for an Item */ + ItemID?: string | null; + + /** Status of object */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export interface Purchase { + + /** + * Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. + * Type: double + */ + UnitPrice?: number | null; + + /** Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items */ + AccountCode?: string | null; + + /** Cost of goods sold account. Only applicable to the purchase details of tracked items. */ + COGSAccountCode?: string | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + } + + export interface Journals { + Journals1?: Array; + } + + export interface Journal { + + /** Xero identifier */ + JournalID?: string | null; + + /** + * Date the journal was posted + * Type: DateOnly + */ + JournalDate?: Date | null; + + /** + * Xero generated journal number + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + JournalNumber?: number | null; + + /** Created date UTC format */ + CreatedDateUTC?: Date | null; + + /** reference field for additional indetifying information */ + Reference?: string | null; + + /** The identifier for the source transaction (e.g. InvoiceID) */ + SourceID?: string | null; + + /** The journal source type. The type of transaction that created the journal */ + SourceType?: JournalSourceType | null; + + /** See JournalLines */ + JournalLines?: Array; + } + + export enum JournalSourceType { ACCREC = 0, ACCPAY = 1, ACCRECCREDIT = 2, ACCPAYCREDIT = 3, ACCRECPAYMENT = 4, ACCPAYPAYMENT = 5, ARCREDITPAYMENT = 6, APCREDITPAYMENT = 7, CASHREC = 8, CASHPAID = 9, TRANSFER = 10, ARPREPAYMENT = 11, APPREPAYMENT = 12, AROVERPAYMENT = 13, APOVERPAYMENT = 14, EXPCLAIM = 15, EXPPAYMENT = 16, MANJOURNAL = 17, PAYSLIP = 18, WAGEPAYABLE = 19, INTEGRATEDPAYROLLPE = 20, INTEGRATEDPAYROLLPT = 21, EXTERNALSPENDMONEY = 22, INTEGRATEDPAYROLLPTPAYMENT = 23, INTEGRATEDPAYROLLCN = 24 } + + export interface JournalLine { + + /** Xero identifier for Journal */ + JournalLineID?: string | null; + + /** See Accounts */ + AccountID?: string | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** See Account Types */ + AccountType?: AccountType | null; + + /** See AccountCodes */ + AccountName?: string | null; + + /** The description from the source transaction line item. Only returned if populated. */ + Description?: string | null; + + /** + * Net amount of journal line. This will be a positive value for a debit and negative for a credit + * Type: double + */ + NetAmount?: number | null; + + /** + * Gross amount of journal line (NetAmount + TaxAmount). + * Type: double + */ + GrossAmount?: number | null; + + /** + * Total tax on a journal line + * Type: double + */ + TaxAmount?: number | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** see TaxRates */ + TaxName?: string | null; + + /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ + TrackingCategories?: Array; + } + + export interface TrackingCategory { + + /** The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + TrackingCategoryID?: string | null; + + /** The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f */ + TrackingOptionID?: string | null; + + /** + * The name of the tracking category e.g. Department, Region (max length = 100) + * Max length: 100 + */ + Name?: string | null; + + /** + * The option name of the tracking option e.g. East, West (max length = 100) + * Max length: 100 + */ + Option?: string | null; + + /** The status of a tracking category */ + Status?: AccountStatus | null; + + /** See Tracking Options */ + Options?: Array; + } + + export interface TrackingOption { + + /** The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a */ + TrackingOptionID?: string | null; + + /** + * The name of the tracking option e.g. Marketing, East (max length = 50) + * Max length: 50 + */ + Name?: string | null; + + /** The status of a tracking option */ + Status?: AccountStatus | null; + + /** Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + TrackingCategoryID?: string | null; + } + + export interface LinkedTransactions { + LinkedTransactions1?: Array; + } + + export interface LinkedTransaction { + + /** Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice */ + SourceTransactionID?: string | null; + + /** The line item identifier from the source transaction. */ + SourceLineItemID?: string | null; + + /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ + ContactID?: string | null; + + /** Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice */ + TargetTransactionID?: string | null; + + /** The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. */ + TargetLineItemID?: string | null; + + /** The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 */ + LinkedTransactionID?: string | null; + + /** Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. */ + Status?: LinkedTransactionStatus | null; + + /** This will always be BILLABLEEXPENSE. More types may be added in future. */ + Type?: LinkedTransactionType | null; + + /** The last modified date in UTC format */ + UpdatedDateUTC?: Date | null; + + /** The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. */ + SourceTransactionTypeCode?: LinkedTransactionSourceTransactionTypeCode | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum LinkedTransactionStatus { APPROVED = 0, DRAFT = 1, ONDRAFT = 2, BILLED = 3, VOIDED = 4 } + + export enum LinkedTransactionType { BILLABLEEXPENSE = 0 } + + export enum LinkedTransactionSourceTransactionTypeCode { ACCPAY = 0, SPEND = 1 } + + export interface ManualJournals { + ManualJournals1?: Array; + } + + export interface ManualJournal { + + /** + * Description of journal being posted + * Required + */ + Narration: string; + + /** See JournalLines */ + JournalLines?: Array; + + /** + * Date journal was posted � YYYY-MM-DD + * Type: DateOnly + */ + Date?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** See Manual Journal Status Codes */ + Status?: ManualJournalStatus | null; + + /** Url link to a source document � shown as �Go to [appName]� in the Xero app */ + Url?: string | null; + + /** Boolean � default is true if not specified */ + ShowOnCashBasisReports?: boolean | null; + + /** Boolean to indicate if a manual journal has an attachment */ + HasAttachments?: boolean | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** The Xero identifier for a Manual Journal */ + ManualJournalID?: string | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + + export interface ManualJournalLine { + + /** + * total for line. Debits are positive, credits are negative value + * Type: double + */ + LineAmount?: number | null; + + /** See Accounts */ + AccountCode?: string | null; + + /** Description for journal line */ + Description?: string | null; + + /** The tax type from TaxRates */ + TaxType?: string | null; + + /** Optional Tracking Category � see Tracking. Any JournalLine can have a maximum of 2 elements. */ + Tracking?: Array; + + /** + * The calculated tax amount based on the TaxType and LineAmount + * Type: double + */ + TaxAmount?: number | null; + + /** is the line blank */ + IsBlank?: boolean | null; + } + + export enum ManualJournalStatus { DRAFT = 0, POSTED = 1, DELETED = 2, VOIDED = 3, ARCHIVED = 4 } + + export interface Organisations { + Organisations1?: Array; + } + + export interface Organisation { + + /** Unique Xero identifier */ + OrganisationID?: string | null; + + /** Display a unique key used for Xero-to-Xero transactions */ + APIKey?: string | null; + + /** Display name of organisation shown in Xero */ + Name?: string | null; + + /** Organisation name shown on Reports */ + LegalName?: string | null; + + /** Boolean to describe if organisation is registered with a local tax authority i.e. true, false */ + PaysTax?: boolean | null; + + /** See Version Types */ + Version?: OrganisationVersion | null; + + /** Organisation Type */ + OrganisationType?: OrganisationOrganisationType | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + BaseCurrency?: AccountCurrencyCode | null; + CountryCode?: OrganisationCountryCode | null; + + /** Boolean to describe if organisation is a demo company. */ + IsDemoCompany?: boolean | null; + + /** Will be set to ACTIVE if you can connect to organisation via the Xero API */ + OrganisationStatus?: string | null; + + /** Shows for New Zealand, Australian and UK organisations */ + RegistrationNumber?: string | null; + + /** Shown if set. US Only. */ + EmployerIdentificationNumber?: string | null; + + /** Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). */ + TaxNumber?: string | null; + + /** + * Calendar day e.g. 0-31 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + FinancialYearEndDay?: number | null; + + /** + * Calendar Month e.g. 1-12 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + FinancialYearEndMonth?: number | null; + + /** The accounting basis used for tax returns. See Sales Tax Basis */ + SalesTaxBasis?: OrganisationSalesTaxBasis | null; + + /** The frequency with which tax returns are processed. See Sales Tax Period */ + SalesTaxPeriod?: OrganisationSalesTaxPeriod | null; + + /** The default for LineAmountTypes on sales transactions */ + DefaultSalesTax?: string | null; + + /** The default for LineAmountTypes on purchase transactions */ + DefaultPurchasesTax?: string | null; + + /** + * Shown if set. See lock dates + * Type: DateOnly + */ + PeriodLockDate?: Date | null; + + /** + * Shown if set. See lock dates + * Type: DateOnly + */ + EndOfYearLockDate?: Date | null; + + /** Timestamp when the organisation was created in Xero */ + CreatedDateUTC?: Date | null; + + /** Timezone specifications */ + Timezone?: OrganisationTimezone | null; + + /** Organisation Type */ + OrganisationEntityType?: OrganisationOrganisationType | null; + + /** A unique identifier for the organisation. Potential uses. */ + ShortCode?: string | null; + + /** Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) */ + Class?: OrganisationClass | null; + + /** BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) */ + Edition?: OrganisationEdition | null; + + /** Description of business type as defined in Organisation settings */ + LineOfBusiness?: string | null; + + /** Address details for organisation � see Addresses */ + Addresses?: Array
; + + /** Phones details for organisation � see Phones */ + Phones?: Array; + + /** Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below */ + ExternalLinks?: Array; + PaymentTerms?: PaymentTerm; + } + + export enum OrganisationVersion { AU = 0, NZ = 1, GLOBAL = 2, UK = 3, US = 4, AUONRAMP = 5, NZONRAMP = 6, GLOBALONRAMP = 7, UKONRAMP = 8, USONRAMP = 9 } + + export enum OrganisationOrganisationType { ACCOUNTING_PRACTICE = 0, COMPANY = 1, CHARITY = 2, CLUB_OR_SOCIETY = 3, LOOK_THROUGH_COMPANY = 4, NOT_FOR_PROFIT = 5, PARTNERSHIP = 6, S_CORPORATION = 7, SELF_MANAGED_SUPERANNUATION_FUND = 8, SOLE_TRADER = 9, SUPERANNUATION_FUND = 10, TRUST = 11 } + + export enum OrganisationCountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + export enum OrganisationSalesTaxBasis { PAYMENTS = 0, INVOICE = 1, NONE = 2, CASH = 3, ACCRUAL = 4, FLATRATECASH = 5, FLATRATEACCRUAL = 6, ACCRUALS = 7 } + + export enum OrganisationSalesTaxPeriod { MONTHLY = 0, QUARTERLY1 = 1, QUARTERLY2 = 2, QUARTERLY3 = 3, ANNUALLY = 4, ONEMONTHS = 5, TWOMONTHS = 6, SIXMONTHS = 7, '1MONTHLY' = 8, '2MONTHLY' = 9, '3MONTHLY' = 10, '6MONTHLY' = 11, QUARTERLY = 12, YEARLY = 13, NONE = 14 } + + export enum OrganisationTimezone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } + + export enum OrganisationClass { DEMO = 0, TRIAL = 1, STARTER = 2, STANDARD = 3, PREMIUM = 4, PREMIUM_20 = 5, PREMIUM_50 = 6, PREMIUM_100 = 7, LEDGER = 8, GST_CASHBOOK = 9, NON_GST_CASHBOOK = 10 } + + export enum OrganisationEdition { BUSINESS = 0, PARTNER = 1 } + + export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + + /** Timezone specifications */ + export enum TimeZone { MOROCCOSTANDARDTIME = 0, UTC = 1, GMTSTANDARDTIME = 2, GREENWICHSTANDARDTIME = 3, WEUROPESTANDARDTIME = 4, CENTRALEUROPESTANDARDTIME = 5, ROMANCESTANDARDTIME = 6, CENTRALEUROPEANSTANDARDTIME = 7, WCENTRALAFRICASTANDARDTIME = 8, NAMIBIASTANDARDTIME = 9, JORDANSTANDARDTIME = 10, GTBSTANDARDTIME = 11, MIDDLEEASTSTANDARDTIME = 12, EGYPTSTANDARDTIME = 13, SYRIASTANDARDTIME = 14, EEUROPESTANDARDTIME = 15, SOUTHAFRICASTANDARDTIME = 16, FLESTANDARDTIME = 17, TURKEYSTANDARDTIME = 18, ISRAELSTANDARDTIME = 19, KALININGRADSTANDARDTIME = 20, LIBYASTANDARDTIME = 21, ARABICSTANDARDTIME = 22, ARABSTANDARDTIME = 23, BELARUSSTANDARDTIME = 24, RUSSIANSTANDARDTIME = 25, EAFRICASTANDARDTIME = 26, IRANSTANDARDTIME = 27, ARABIANSTANDARDTIME = 28, AZERBAIJANSTANDARDTIME = 29, RUSSIATIMEZONE3 = 30, MAURITIUSSTANDARDTIME = 31, GEORGIANSTANDARDTIME = 32, CAUCASUSSTANDARDTIME = 33, AFGHANISTANSTANDARDTIME = 34, WESTASIASTANDARDTIME = 35, EKATERINBURGSTANDARDTIME = 36, PAKISTANSTANDARDTIME = 37, INDIASTANDARDTIME = 38, SRILANKASTANDARDTIME = 39, NEPALSTANDARDTIME = 40, CENTRALASIASTANDARDTIME = 41, BANGLADESHSTANDARDTIME = 42, NCENTRALASIASTANDARDTIME = 43, MYANMARSTANDARDTIME = 44, SEASIASTANDARDTIME = 45, NORTHASIASTANDARDTIME = 46, CHINASTANDARDTIME = 47, NORTHASIAEASTSTANDARDTIME = 48, SINGAPORESTANDARDTIME = 49, WAUSTRALIASTANDARDTIME = 50, TAIPEISTANDARDTIME = 51, ULAANBAATARSTANDARDTIME = 52, TOKYOSTANDARDTIME = 53, KOREASTANDARDTIME = 54, YAKUTSKSTANDARDTIME = 55, CENAUSTRALIASTANDARDTIME = 56, AUSCENTRALSTANDARDTIME = 57, EAUSTRALIASTANDARDTIME = 58, AUSEASTERNSTANDARDTIME = 59, WESTPACIFICSTANDARDTIME = 60, TASMANIASTANDARDTIME = 61, MAGADANSTANDARDTIME = 62, VLADIVOSTOKSTANDARDTIME = 63, RUSSIATIMEZONE10 = 64, CENTRALPACIFICSTANDARDTIME = 65, RUSSIATIMEZONE11 = 66, NEWZEALANDSTANDARDTIME = 67, 'UTC+12' = 68, FIJISTANDARDTIME = 69, KAMCHATKASTANDARDTIME = 70, TONGASTANDARDTIME = 71, SAMOASTANDARDTIME = 72, LINEISLANDSSTANDARDTIME = 73, AZORESSTANDARDTIME = 74, CAPEVERDESTANDARDTIME = 75, UTC02 = 76, MIDATLANTICSTANDARDTIME = 77, ESOUTHAMERICASTANDARDTIME = 78, ARGENTINASTANDARDTIME = 79, SAEASTERNSTANDARDTIME = 80, GREENLANDSTANDARDTIME = 81, MONTEVIDEOSTANDARDTIME = 82, BAHIASTANDARDTIME = 83, NEWFOUNDLANDSTANDARDTIME = 84, PARAGUAYSTANDARDTIME = 85, ATLANTICSTANDARDTIME = 86, CENTRALBRAZILIANSTANDARDTIME = 87, SAWESTERNSTANDARDTIME = 88, PACIFICSASTANDARDTIME = 89, VENEZUELASTANDARDTIME = 90, SAPACIFICSTANDARDTIME = 91, EASTERNSTANDARDTIME = 92, USEASTERNSTANDARDTIME = 93, CENTRALAMERICASTANDARDTIME = 94, CENTRALSTANDARDTIME = 95, 'CENTRALSTANDARDTIME(MEXICO)' = 96, CANADACENTRALSTANDARDTIME = 97, USMOUNTAINSTANDARDTIME = 98, 'MOUNTAINSTANDARDTIME(MEXICO)' = 99, MOUNTAINSTANDARDTIME = 100, 'PACIFICSTANDARDTIME(MEXICO)' = 101, PACIFICSTANDARDTIME = 102, ALASKANSTANDARDTIME = 103, HAWAIIANSTANDARDTIME = 104, UTC11 = 105, DATELINESTANDARDTIME = 106 } + + export enum PaymentTermType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, OFCURRENTMONTH = 2, OFFOLLOWINGMONTH = 3 } + + export interface Overpayments { + Overpayments1?: Array; + } + + export interface Payments { + Payments1?: Array; + } + + export interface PaymentDelete { + + /** + * The status of the payment. + * Required + */ + Status: string; + } + + export interface Prepayments { + Prepayments1?: Array; + } + + export interface PurchaseOrders { + PurchaseOrders1?: Array; + } + + export interface PurchaseOrder { + Contact?: Contact; + + /** See LineItems */ + LineItems?: Array; + + /** + * Date purchase order was issued � YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** + * Date the goods are to be delivered � YYYY-MM-DD + * Type: DateOnly + */ + DeliveryDate?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) */ + PurchaseOrderNumber?: string | null; + + /** Additional reference number */ + Reference?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** See Purchase Order Status Codes */ + Status?: PurchaseOrderStatus | null; + + /** Boolean to set whether the purchase order should be marked as �sent�. This can be set only on purchase orders that have been approved or billed */ + SentToContact?: boolean | null; + + /** The address the goods are to be delivered to */ + DeliveryAddress?: string | null; + + /** The person that the delivery is going to */ + AttentionTo?: string | null; + + /** The phone number for the person accepting the delivery */ + Telephone?: string | null; + + /** A free text feild for instructions (500 characters max) */ + DeliveryInstructions?: string | null; + + /** + * The date the goods are expected to arrive. + * Type: DateOnly + */ + ExpectedArrivalDate?: Date | null; + + /** Xero generated unique identifier for purchase order */ + PurchaseOrderID?: string | null; + + /** + * The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. + * Type: double + */ + CurrencyRate?: number | null; + + /** + * Total of purchase order excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on purchase order + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total?: number | null; + + /** + * Total of discounts applied on the purchase order line items + * Type: double + */ + TotalDiscount?: number | null; + + /** boolean to indicate if a purchase order has an attachment */ + HasAttachments?: boolean | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + + /** Displays array of warning messages from the API */ + Warnings?: Array; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + + export enum PurchaseOrderStatus { DRAFT = 0, SUBMITTED = 1, AUTHORISED = 2, BILLED = 3, DELETED = 4 } + + export interface Quotes { + Quotes1?: Array; + } + + export interface Quote { + + /** QuoteID GUID is automatically generated and is returned after create or GET. */ + QuoteID?: string | null; + + /** + * Unique alpha numeric code identifying a quote (Max Length = 255) + * Max length: 255 + */ + QuoteNumber?: string | null; + + /** + * Additional reference number + * Max length: 4000 + */ + Reference?: string | null; + + /** + * Terms of the quote + * Max length: 4000 + */ + Terms?: string | null; + Contact?: Contact; + + /** See LineItems */ + LineItems?: Array; + + /** + * Date quote was issued � YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + * Type: DateOnly + */ + Date?: Date | null; + + /** Date the quote was issued (YYYY-MM-DD) */ + DateString?: string | null; + + /** + * Date the quote expires � YYYY-MM-DD. + * Type: DateOnly + */ + ExpiryDate?: Date | null; + + /** Date the quote expires � YYYY-MM-DD. */ + ExpiryDateString?: string | null; + + /** The status of the quote. */ + Status?: QuoteStatus | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** + * The currency rate for a multicurrency quote + * Type: double + */ + CurrencyRate?: number | null; + + /** + * Total of quote excluding taxes. + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on quote + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn�t equal the sum of the LineAmounts + * Type: double + */ + Total?: number | null; + + /** + * Total of discounts applied on the quote line items + * Type: double + */ + TotalDiscount?: number | null; + + /** + * Title text for the quote + * Max length: 100 + */ + Title?: string | null; + + /** + * Summary text for the quote + * Max length: 3000 + */ + Summary?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** Last modified date UTC format */ + UpdatedDateUTC?: Date | null; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: QuoteLineAmountTypes | null; + + /** A string to indicate if a invoice status */ + StatusAttributeString?: string | null; + + /** Displays array of validation error messages from the API */ + ValidationErrors?: Array; + } + + export enum QuoteStatus { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } + + export enum QuoteLineAmountTypes { EXCLUSIVE = 0, INCLUSIVE = 1, NOTAX = 2 } + + + /** The status of the quote. */ + export enum QuoteStatusCodes { DRAFT = 0, SENT = 1, DECLINED = 2, ACCEPTED = 3, INVOICED = 4 } + + export interface Receipts { + Receipts1?: Array; + } + + export interface RepeatingInvoices { + RepeatingInvoices1?: Array; + } + + export interface RepeatingInvoice { + + /** See Invoice Types */ + Type?: RepeatingInvoiceType | null; + Contact?: Contact; + Schedule?: Schedule; + + /** See LineItems */ + LineItems?: Array; + + /** Line amounts are exclusive of tax by default if you don�t specify this element. See Line Amount Types */ + LineAmountTypes?: BankTransactionLineAmountTypes | null; + + /** ACCREC only � additional reference number */ + Reference?: string | null; + + /** See BrandingThemes */ + BrandingThemeID?: string | null; + + /** 3 letter alpha code for the currency � see list of currency codes */ + CurrencyCode?: AccountCurrencyCode | null; + + /** One of the following - DRAFT or AUTHORISED � See Invoice Status Codes */ + Status?: RepeatingInvoiceStatus | null; + + /** + * Total of invoice excluding taxes + * Type: double + */ + SubTotal?: number | null; + + /** + * Total tax on invoice + * Type: double + */ + TotalTax?: number | null; + + /** + * Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) + * Type: double + */ + Total?: number | null; + + /** Xero generated unique identifier for repeating invoice template */ + RepeatingInvoiceID?: string | null; + + /** Xero generated unique identifier for repeating invoice template */ + ID?: string | null; + + /** boolean to indicate if an invoice has an attachment */ + HasAttachments?: boolean | null; + + /** Displays array of attachments from the API */ + Attachments?: Array; + } + + export enum RepeatingInvoiceType { ACCPAY = 0, ACCREC = 1 } + + export interface Schedule { + + /** + * Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + Period?: number | null; + + /** One of the following - WEEKLY or MONTHLY */ + Unit?: ScheduleUnit | null; + + /** + * Integer used with due date type e.g 20 (of following month), 31 (of current month) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + DueDate?: number | null; + + /** the payment terms */ + DueDateType?: ScheduleDueDateType | null; + + /** + * Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) + * Type: DateOnly + */ + StartDate?: Date | null; + + /** + * The calendar date of the next invoice in the schedule to be generated + * Type: DateOnly + */ + NextScheduledDate?: Date | null; + + /** + * Invoice end date � only returned if the template has an end date set + * Type: DateOnly + */ + EndDate?: Date | null; + } + + export enum ScheduleUnit { WEEKLY = 0, MONTHLY = 1 } + + export enum ScheduleDueDateType { DAYSAFTERBILLDATE = 0, DAYSAFTERBILLMONTH = 1, DAYSAFTERINVOICEDATE = 2, DAYSAFTERINVOICEMONTH = 3, OFCURRENTMONTH = 4, OFFOLLOWINGMONTH = 5 } + + export enum RepeatingInvoiceStatus { DRAFT = 0, AUTHORISED = 1, DELETED = 2 } + + export interface ReportWithRows { + Reports?: Array; + } + + export interface ReportWithRow { + + /** Report id */ + ReportID?: string | null; + + /** Name of the report */ + ReportName?: string | null; + + /** Title of the report */ + ReportTitle?: string | null; + + /** The type of report (BalanceSheet,ProfitLoss, etc) */ + ReportType?: string | null; + + /** Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) */ + ReportTitles?: Array; + + /** Date of report */ + ReportDate?: string | null; + Rows?: Array; + + /** Updated Date */ + UpdatedDateUTC?: Date | null; + Fields?: Array; + } + + export interface ReportRows { + RowType?: ReportRowsRowType | null; + Title?: string | null; + Cells?: Array; + Rows?: Array; + } + + export enum ReportRowsRowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } + + export interface ReportCell { + Value?: string | null; + Attributes?: Array; + } + + export interface ReportAttribute { + Id?: string | null; + Value?: string | null; + } + + export interface ReportRow { + RowType?: ReportRowsRowType | null; + Title?: string | null; + Cells?: Array; + } + + export interface ReportFields { + FieldID?: string | null; + Description?: string | null; + Value?: string | null; + } + + export enum RowType { Header = 0, Section = 1, Row = 2, SummaryRow = 3 } + + export interface Reports { + Reports1?: Array; + } + + export interface Report { + + /** See Prepayment Types */ + ReportID?: string | null; + + /** See Prepayment Types */ + ReportName?: string | null; + + /** See Prepayment Types */ + ReportType?: ReportReportType | null; + + /** See Prepayment Types */ + ReportTitle?: string | null; + + /** Date of report */ + ReportDate?: string | null; + + /** Updated Date */ + UpdatedDateUTC?: Date | null; + Contacts?: Array; + } + + export enum ReportReportType { AgedPayablesByContact = 0 } + + export interface TenNinteyNineContact { + + /** + * Box 1 on 1099 Form + * Type: double + */ + Box1?: number | null; + + /** + * Box 2 on 1099 Form + * Type: double + */ + Box2?: number | null; + + /** + * Box 3 on 1099 Form + * Type: double + */ + Box3?: number | null; + + /** + * Box 4 on 1099 Form + * Type: double + */ + Box4?: number | null; + + /** + * Box 5 on 1099 Form + * Type: double + */ + Box5?: number | null; + + /** + * Box 6 on 1099 Form + * Type: double + */ + Box6?: number | null; + + /** + * Box 7 on 1099 Form + * Type: double + */ + Box7?: number | null; + + /** + * Box 8 on 1099 Form + * Type: double + */ + Box8?: number | null; + + /** + * Box 9 on 1099 Form + * Type: double + */ + Box9?: number | null; + + /** + * Box 10 on 1099 Form + * Type: double + */ + Box10?: number | null; + + /** + * Box 11 on 1099 Form + * Type: double + */ + Box11?: number | null; + + /** + * Box 13 on 1099 Form + * Type: double + */ + Box13?: number | null; + + /** + * Box 14 on 1099 Form + * Type: double + */ + Box14?: number | null; + + /** Contact name on 1099 Form */ + Name?: string | null; + + /** Contact Fed Tax ID type */ + FederalTaxIDType?: string | null; + + /** Contact city on 1099 Form */ + City?: string | null; + + /** Contact zip on 1099 Form */ + Zip?: string | null; + + /** Contact State on 1099 Form */ + State?: string | null; + + /** Contact email on 1099 Form */ + Email?: string | null; + + /** Contact address on 1099 Form */ + StreetAddress?: string | null; + + /** Contact tax id on 1099 Form */ + TaxID?: string | null; + + /** Contact contact id */ + ContactId?: string | null; + } + + export interface TaxRates { + TaxRates1?: Array; + } + + export interface TaxRate { + + /** Name of tax rate */ + Name?: string | null; + + /** The tax type */ + TaxType?: string | null; + + /** See TaxComponents */ + TaxComponents?: Array; + + /** See Status Codes */ + Status?: TaxRateStatus | null; + + /** See ReportTaxTypes */ + ReportTaxType?: TaxRateReportTaxType | null; + + /** Boolean to describe if tax rate can be used for asset accounts i.e. true,false */ + CanApplyToAssets?: boolean | null; + + /** Boolean to describe if tax rate can be used for equity accounts i.e true,false */ + CanApplyToEquity?: boolean | null; + + /** Boolean to describe if tax rate can be used for expense accounts i.e. true,false */ + CanApplyToExpenses?: boolean | null; + + /** Boolean to describe if tax rate can be used for liability accounts i.e. true,false */ + CanApplyToLiabilities?: boolean | null; + + /** Boolean to describe if tax rate can be used for revenue accounts i.e. true,false */ + CanApplyToRevenue?: boolean | null; + + /** + * Tax Rate (decimal to 4dp) e.g 12.5000 + * Type: double + */ + DisplayTaxRate?: number | null; + + /** + * Effective Tax Rate (decimal to 4dp) e.g 12.5000 + * Type: double + */ + EffectiveRate?: number | null; + } + + export interface TaxComponent { + + /** Name of Tax Component */ + Name?: string | null; + + /** + * Tax Rate (up to 4dp) + * Type: double + */ + Rate?: number | null; + + /** Boolean to describe if Tax rate is compounded. */ + IsCompound?: boolean | null; + + /** Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations */ + IsNonRecoverable?: boolean | null; + } + + export enum TaxRateStatus { ACTIVE = 0, DELETED = 1, ARCHIVED = 2, PENDING = 3 } + + export enum TaxRateReportTaxType { AVALARA = 0, BASEXCLUDED = 1, CAPITALSALESOUTPUT = 2, CAPITALEXPENSESINPUT = 3, ECOUTPUT = 4, ECOUTPUTSERVICES = 5, ECINPUT = 6, ECACQUISITIONS = 7, EXEMPTEXPENSES = 8, EXEMPTINPUT = 9, EXEMPTOUTPUT = 10, GSTONIMPORTS = 11, INPUT = 12, INPUTTAXED = 13, MOSSSALES = 14, NONE = 15, NONEOUTPUT = 16, OUTPUT = 17, PURCHASESINPUT = 18, SALESOUTPUT = 19, EXEMPTCAPITAL = 20, EXEMPTEXPORT = 21, CAPITALEXINPUT = 22, GSTONCAPIMPORTS = 23, GSTONCAPITALIMPORTS = 24, REVERSECHARGES = 25, PAYMENTS = 26, INVOICE = 27, CASH = 28, ACCRUAL = 29, FLATRATECASH = 30, FLATRATEACCRUAL = 31, ACCRUALS = 32, TXCA = 33, SRCAS = 34, DSOUTPUT = 35, BLINPUT2 = 36, EPINPUT = 37, IMINPUT2 = 38, MEINPUT = 39, IGDSINPUT2 = 40, ESN33OUTPUT = 41, OPINPUT = 42, OSOUTPUT = 43, TXN33INPUT = 44, TXESSINPUT = 45, TXREINPUT = 46, TXPETINPUT = 47, NRINPUT = 48, ES33OUTPUT = 49, ZERORATEDINPUT = 50, ZERORATEDOUTPUT = 51, DRCHARGESUPPLY = 52, DRCHARGE = 53, CAPINPUT = 54, CAPIMPORTS = 55, IMINPUT = 56, INPUT2 = 57, CIUINPUT = 58, SRINPUT = 59, OUTPUT2 = 60, SROUTPUT = 61, CAPOUTPUT = 62, SROUTPUT2 = 63, CIUOUTPUT = 64, ZROUTPUT = 65, ZREXPORT = 66, ACC28PLUS = 67, ACCUPTO28 = 68, OTHEROUTPUT = 69, SHOUTPUT = 70, ZRINPUT = 71, BADDEBT = 72, OTHERINPUT = 73 } + + + /** See Tax Types � can only be used on update calls */ + export enum TaxType { OUTPUT = 0, INPUT = 1, CAPEXINPUT = 2, EXEMPTEXPORT = 3, EXEMPTEXPENSES = 4, EXEMPTCAPITAL = 5, EXEMPTOUTPUT = 6, INPUTTAXED = 7, BASEXCLUDED = 8, GSTONCAPIMPORTS = 9, GSTONIMPORTS = 10, NONE = 11, INPUT2 = 12, ZERORATED = 13, OUTPUT2 = 14, CAPEXINPUT2 = 15, CAPEXOUTPUT = 16, CAPEXOUTPUT2 = 17, CAPEXSRINPUT = 18, CAPEXSROUTPUT = 19, ECACQUISITIONS = 20, ECZRINPUT = 21, ECZROUTPUT = 22, ECZROUTPUTSERVICES = 23, EXEMPTINPUT = 24, REVERSECHARGES = 25, RRINPUT = 26, RROUTPUT = 27, SRINPUT = 28, SROUTPUT = 29, ZERORATEDINPUT = 30, ZERORATEDOUTPUT = 31, BLINPUT = 32, DSOUTPUT = 33, EPINPUT = 34, ES33OUTPUT = 35, ESN33OUTPUT = 36, IGDSINPUT2 = 37, IMINPUT2 = 38, MEINPUT = 39, NRINPUT = 40, OPINPUT = 41, OSOUTPUT = 42, TXESSINPUT = 43, TXN33INPUT = 44, TXPETINPUT = 45, TXREINPUT = 46, INPUT3 = 47, INPUT4 = 48, OUTPUT3 = 49, OUTPUT4 = 50, SROUTPUT2 = 51, TXCA = 52, SRCAS = 53, BLINPUT2 = 54, DRCHARGESUPPLY20 = 55, DRCHARGE20 = 56, DRCHARGESUPPLY5 = 57, DRCHARGE5 = 58 } + + export interface TrackingCategories { + TrackingCategories1?: Array; + } + + export interface TrackingOptions { + Options?: Array; + } + + export interface Users { + Users1?: Array; + } + + export interface Error { + + /** + * Exception number + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + ErrorNumber?: number | null; + + /** Exception type */ + Type?: string | null; + + /** Exception message */ + Message?: string | null; + + /** Array of Elements of validation Errors */ + Elements?: Array; + } + + export interface Element { + + /** Array of Validation Error message */ + ValidationErrors?: Array; + + /** Unique ID for batch payment object with validation error */ + BatchPaymentID?: string | null; + BankTransactionID?: string | null; + CreditNoteID?: string | null; + ContactID?: string | null; + InvoiceID?: string | null; + ItemID?: string | null; + PurchaseOrderID?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * Allows you to retrieve the full chart of accounts + * Get Accounts + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Accounts} Success - return response of type Accounts array with 0 to n Account + */ + GetAccounts(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Accounts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create a new chart of accounts + * Put Accounts + * @param {Account} requestBody Account object in body of request + * @return {Accounts} Success - created new Account and return response of type Accounts array with new Account + */ + CreateAccount(requestBody: Account): Observable { + return this.http.put(this.baseUri + 'Accounts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a single chart of accounts + * Get Accounts/{AccountID} + * @param {string} AccountID Unique identifier for retrieving single object + * @return {Accounts} Success - return response of type Accounts array with one Account + */ + GetAccount(AccountID: string): Observable { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); + } + + /** + * Allows you to update a chart of accounts + * Post Accounts/{AccountID} + * @param {string} AccountID Unique identifier for retrieving single object + * @param {Accounts} requestBody Request of type Accounts array with one Account + * @return {Accounts} Success - update existing Account and return response of type Accounts array with updated Account + */ + UpdateAccount(AccountID: string, requestBody: Accounts): Observable { + return this.http.post(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a chart of accounts + * Delete Accounts/{AccountID} + * @param {string} AccountID Unique identifier for retrieving single object + * @return {Accounts} Success - delete existing Account and return response of type Accounts array with deleted Account + */ + DeleteAccount(AccountID: string): Observable { + return this.http.delete(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)), {}); + } + + /** + * Allows you to retrieve Attachments for accounts + * Get Accounts/{AccountID}/Attachments + * @param {string} AccountID Unique identifier for Account object + * @return {Attachments} Success - return response of type Attachments array of Attachment + */ + GetAccountAttachments(AccountID: string): Observable { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve specific Attachment on Account + * Get Accounts/{AccountID}/Attachments/{AttachmentID} + * @param {string} AccountID Unique identifier for Account object + * @param {string} AttachmentID Unique identifier for Attachment object + * @return {void} Success - return response of attachment for Account as binary data + */ + GetAccountAttachmentById(AccountID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachment on Account by Filename + * Get Accounts/{AccountID}/Attachments/{FileName} + * @param {string} AccountID Unique identifier for Account object + * @param {string} FileName Name of the attachment + * @return {void} Success - return response of attachment for Account as binary data + */ + GetAccountAttachmentByFileName(AccountID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Accounts/' + (AccountID == null ? '' : encodeURIComponent(AccountID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Retrieve either one or many BatchPayments for invoices + * Get BatchPayments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects + */ + GetBatchPayments(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'BatchPayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Create one or many BatchPayments for invoices + * Put BatchPayments + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {BatchPayments} requestBody BatchPayments with an array of Payments in body of request + * @return {BatchPayments} Success - return response of type BatchPayments array of BatchPayment objects + */ + CreateBatchPayment(summarizeErrors: boolean | null | undefined, requestBody: BatchPayments): Observable { + return this.http.put(this.baseUri + 'BatchPayments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve history from a Batch Payment + * Get BatchPayments/{BatchPaymentID}/History + * @param {string} BatchPaymentID Unique identifier for BatchPayment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetBatchPaymentHistory(BatchPaymentID: string): Observable { + return this.http.get(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', {}); + } + + /** + * Allows you to create a history record for a Batch Payment + * Put BatchPayments/{BatchPaymentID}/History + * @param {string} BatchPaymentID Unique identifier for BatchPayment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateBatchPaymentHistoryRecord(BatchPaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'BatchPayments/' + (BatchPaymentID == null ? '' : encodeURIComponent(BatchPaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any spend or receive money transactions + * Get BankTransactions + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page Up to 100 bank transactions will be returned in a single API call with line items details + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with 0 to n BankTransaction + */ + GetBankTransactions(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'BankTransactions?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create one or more spend or receive money transaction + * Put BankTransactions + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {BankTransactions} requestBody BankTransactions with an array of BankTransaction objects in body of request + * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction + */ + CreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { + return this.http.put(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update or create one or more spend or receive money transaction + * Post BankTransactions + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with new BankTransaction + */ + UpdateOrCreateBankTransactions(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { + return this.http.post(this.baseUri + 'BankTransactions?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a single spend or receive money transaction + * Get BankTransactions/{BankTransactionID} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with a specific BankTransaction + */ + GetBankTransaction(BankTransactionID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a single spend or receive money transaction + * Post BankTransactions/{BankTransactionID} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {BankTransactions} Success - return response of type BankTransactions array with updated BankTransaction + */ + UpdateBankTransaction(BankTransactionID: string, unitdp: number | null | undefined, requestBody: BankTransactions): Observable { + return this.http.post(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any attachments to bank transactions + * Get BankTransactions/{BankTransactionID}/Attachments + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @return {Attachments} Success - return response of type Attachments array with 0 to n Attachment + */ + GetBankTransactionAttachments(BankTransactionID: string): Observable { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on a specific BankTransaction + * Get BankTransactions/{BankTransactionID}/Attachments/{AttachmentID} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {string} AttachmentID Xero generated unique identifier for an attachment + * @return {void} Success - return response of attachment for BankTransaction as binary data + */ + GetBankTransactionAttachmentById(BankTransactionID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on BankTransaction by Filename + * Get BankTransactions/{BankTransactionID}/Attachments/{FileName} + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {string} FileName The name of the file being attached + * @return {void} Success - return response of attachment for BankTransaction as binary data + */ + GetBankTransactionAttachmentByFileName(BankTransactionID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history from a bank transactions + * Get BankTransactions/{BankTransactionID}/History + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetBankTransactionsHistory(BankTransactionID: string): Observable { + return this.http.get(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', {}); + } + + /** + * Allows you to create history record for a bank transactions + * Put BankTransactions/{BankTransactionID}/History + * @param {string} BankTransactionID Xero generated unique identifier for a bank transaction + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateBankTransactionHistoryRecord(BankTransactionID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'BankTransactions/' + (BankTransactionID == null ? '' : encodeURIComponent(BankTransactionID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve all bank transfers + * Get BankTransfers + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {BankTransfers} Success - return response of BankTransfers array of 0 to N BankTransfer + */ + GetBankTransfers(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'BankTransfers?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create a bank transfers + * Put BankTransfers + * @param {BankTransfers} requestBody BankTransfers with array of BankTransfer objects in request body + * @return {BankTransfers} Success - return response of BankTransfers array of one BankTransfer + */ + CreateBankTransfer(requestBody: BankTransfers): Observable { + return this.http.put(this.baseUri + 'BankTransfers', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any bank transfers + * Get BankTransfers/{BankTransferID} + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @return {BankTransfers} Success - return response of BankTransfers array with one BankTransfer + */ + GetBankTransfer(BankTransferID: string): Observable { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)), {}); + } + + /** + * Allows you to retrieve Attachments from bank transfers + * Get BankTransfers/{BankTransferID}/Attachments + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @return {Attachments} Success - return response of Attachments array of 0 to N Attachment for a Bank Transfer + */ + GetBankTransferAttachments(BankTransferID: string): Observable { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on BankTransfer + * Get BankTransfers/{BankTransferID}/Attachments/{AttachmentID} + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @param {string} AttachmentID Xero generated unique identifier for an Attachment to a bank transfer + * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer + */ + GetBankTransferAttachmentById(BankTransferID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on BankTransfer by file name + * Get BankTransfers/{BankTransferID}/Attachments/{FileName} + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @param {string} FileName The name of the file being attached to a Bank Transfer + * @return {void} Success - return response of binary data from the Attachment to a Bank Transfer + */ + GetBankTransferAttachmentByFileName(BankTransferID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history from a bank transfers + * Get BankTransfers/{BankTransferID}/History + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetBankTransferHistory(BankTransferID: string): Observable { + return this.http.get(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', {}); + } + + /** + * Put BankTransfers/{BankTransferID}/History + * @param {string} BankTransferID Xero generated unique identifier for a bank transfer + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateBankTransferHistoryRecord(BankTransferID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'BankTransfers/' + (BankTransferID == null ? '' : encodeURIComponent(BankTransferID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve all the BrandingThemes + * Get BrandingThemes + * @return {BrandingThemes} Success - return response of type BrandingThemes + */ + GetBrandingThemes(): Observable { + return this.http.get(this.baseUri + 'BrandingThemes', {}); + } + + /** + * Allows you to retrieve a specific BrandingThemes + * Get BrandingThemes/{BrandingThemeID} + * @param {string} BrandingThemeID Unique identifier for a Branding Theme + * @return {BrandingThemes} Success - return response of type BrandingThemes with one BrandingTheme + */ + GetBrandingTheme(BrandingThemeID: string): Observable { + return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)), {}); + } + + /** + * Allows you to retrieve the Payment services for a Branding Theme + * Get BrandingThemes/{BrandingThemeID}/PaymentServices + * @param {string} BrandingThemeID Unique identifier for a Branding Theme + * @return {PaymentServices} Success - return response of type PaymentServices array with 0 to N PaymentService + */ + GetBrandingThemePaymentServices(BrandingThemeID: string): Observable { + return this.http.get(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', {}); + } + + /** + * Allow for the creation of new custom payment service for specified Branding Theme + * Post BrandingThemes/{BrandingThemeID}/PaymentServices + * @param {string} BrandingThemeID Unique identifier for a Branding Theme + * @param {PaymentService} requestBody PaymentService object in body of request + * @return {PaymentServices} Success - return response of type PaymentServices array with newly created PaymentService + */ + CreateBrandingThemePaymentServices(BrandingThemeID: string, requestBody: PaymentService): Observable { + return this.http.post(this.baseUri + 'BrandingThemes/' + (BrandingThemeID == null ? '' : encodeURIComponent(BrandingThemeID)) + '/PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve all contacts in a Xero organisation + * Get Contacts + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {Array} IDs Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + * @param {number} page e.g. page=1 - Up to 100 contacts will be returned in a single API call. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + * @return {Contacts} Success - return response of type Contacts array with 0 to N Contact + */ + GetContacts(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Contacts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived, {}); + } + + /** + * Allows you to create a multiple contacts (bulk) in a Xero organisation + * Put Contacts + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Contacts} requestBody Contacts with an array of Contact objects to create in body of request + * @return {Contacts} Success - return response of type Contacts array with newly created Contact + */ + CreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { + return this.http.put(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more contacts in a Xero organisation + * Post Contacts + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @return {Contacts} Success - return response of type Contacts array with newly created Contact + */ + UpdateOrCreateContacts(summarizeErrors: boolean | null | undefined, requestBody: Contacts): Observable { + return this.http.post(this.baseUri + 'Contacts?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a single contact by Contact Number in a Xero organisation + * Get Contacts/{ContactNumber} + * @param {string} ContactNumber This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). + * @return {Contacts} Success - return response of type Contacts array with a unique Contact + */ + GetContactByContactNumber(ContactNumber: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactNumber == null ? '' : encodeURIComponent(ContactNumber)), {}); + } + + /** + * Allows you to retrieve a single contacts in a Xero organisation + * Get Contacts/{ContactID} + * @param {string} ContactID Unique identifier for a Contact + * @return {Contacts} Success - return response of type Contacts array with a unique Contact + */ + GetContact(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), {}); + } + + /** + * Post Contacts/{ContactID} + * @param {string} ContactID Unique identifier for a Contact + * @param {Contacts} requestBody an array of Contacts containing single Contact object with properties to update + * @return {Contacts} Success - return response of type Contacts array with an updated Contact + */ + UpdateContact(ContactID: string, requestBody: Contacts): Observable { + return this.http.post(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve, add and update contacts in a Xero organisation + * Get Contacts/{ContactID}/Attachments + * @param {string} ContactID Unique identifier for a Contact + * @return {Attachments} Success - return response of type Attachments array with 0 to N Attachment + */ + GetContactAttachments(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on Contacts + * Get Contacts/{ContactID}/Attachments/{AttachmentID} + * @param {string} ContactID Unique identifier for a Contact + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Contact as binary data + */ + GetContactAttachmentById(ContactID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on Contacts by file name + * Get Contacts/{ContactID}/Attachments/{FileName} + * @param {string} ContactID Unique identifier for a Contact + * @param {string} FileName Name for the file you are attaching + * @return {void} Success - return response of attachment for Contact as binary data + */ + GetContactAttachmentByFileName(ContactID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve CISSettings for a contact in a Xero organisation + * Get Contacts/{ContactID}/CISSettings + * @param {string} ContactID Unique identifier for a Contact + * @return {CISSettings} Success - return response of type CISSettings for a specific Contact + */ + GetContactCISSettings(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/CISSettings', {}); + } + + /** + * Allows you to retrieve a history records of an Contact + * Get Contacts/{ContactID}/History + * @param {string} ContactID Unique identifier for a Contact + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetContactHistory(ContactID: string): Observable { + return this.http.get(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an Contact + * Put Contacts/{ContactID}/History + * @param {string} ContactID Unique identifier for a Contact + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateContactHistory(ContactID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve the ContactID and Name of all the contacts in a contact group + * Get ContactGroups + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {ContactGroups} Success - return response of type Contact Groups array of Contact Group + */ + GetContactGroups(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ContactGroups?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create a contact group + * Put ContactGroups + * @param {ContactGroups} requestBody ContactGroups with an array of names in request body + * @return {ContactGroups} Success - return response of type Contact Groups array of newly created Contact Group + */ + CreateContactGroup(requestBody: ContactGroups): Observable { + return this.http.put(this.baseUri + 'ContactGroups', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a unique Contact Group by ID + * Get ContactGroups/{ContactGroupID} + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @return {ContactGroups} Success - return response of type Contact Groups array with a specific Contact Group + */ + GetContactGroup(ContactGroupID: string): Observable { + return this.http.get(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), {}); + } + + /** + * Allows you to update a Contact Group + * Post ContactGroups/{ContactGroupID} + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @param {ContactGroups} requestBody an array of Contact groups with Name of specific group to update + * @return {ContactGroups} Success - return response of type Contact Groups array of updated Contact Group + */ + UpdateContactGroup(ContactGroupID: string, requestBody: ContactGroups): Observable { + return this.http.post(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to add Contacts to a Contact Group + * Put ContactGroups/{ContactGroupID}/Contacts + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @param {Contacts} requestBody Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request + * @return {Contacts} Success - return response of type Contacts array of added Contacts + */ + CreateContactGroupContacts(ContactGroupID: string, requestBody: Contacts): Observable { + return this.http.put(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete all Contacts from a Contact Group + * Delete ContactGroups/{ContactGroupID}/Contacts + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @return {void} + */ + DeleteContactGroupContacts(ContactGroupID: string): Observable> { + return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to delete a specific Contact from a Contact Group + * Delete ContactGroups/{ContactGroupID}/Contacts/{ContactID} + * @param {string} ContactGroupID Unique identifier for a Contact Group + * @param {string} ContactID Unique identifier for a Contact + * @return {void} + */ + DeleteContactGroupContact(ContactGroupID: string, ContactID: string): Observable> { + return this.http.delete(this.baseUri + 'ContactGroups/' + (ContactGroupID == null ? '' : encodeURIComponent(ContactGroupID)) + '/Contacts/' + (ContactID == null ? '' : encodeURIComponent(ContactID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve any credit notes + * Get CreditNotes + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {CreditNotes} Success - return response of type Credit Notes array of CreditNote + */ + GetCreditNotes(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'CreditNotes?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create a credit note + * Put CreditNotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {CreditNotes} requestBody Credit Notes with array of CreditNote object in body of request + * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote + */ + CreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { + return this.http.put(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more credit notes + * Post CreditNotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {CreditNotes} requestBody an array of Credit Notes with a single CreditNote object. + * @return {CreditNotes} Success - return response of type Credit Notes array of newly created CreditNote + */ + UpdateOrCreateCreditNotes(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { + return this.http.post(this.baseUri + 'CreditNotes?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specific credit note + * Get CreditNotes/{CreditNoteID} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {CreditNotes} Success - return response of type Credit Notes array with a unique CreditNote + */ + GetCreditNote(CreditNoteID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a specific credit note + * Post CreditNotes/{CreditNoteID} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {CreditNotes} requestBody an array of Credit Notes containing credit note details to update + * @return {CreditNotes} Success - return response of type Credit Notes array with updated CreditNote + */ + UpdateCreditNote(CreditNoteID: string, unitdp: number | null | undefined, requestBody: CreditNotes): Observable { + return this.http.post(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve Attachments for credit notes + * Get CreditNotes/{CreditNoteID}/Attachments + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @return {Attachments} Success - return response of type Attachments array with all Attachment for specific Credit Note + */ + GetCreditNoteAttachments(CreditNoteID: string): Observable { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on CreditNote + * Get CreditNotes/{CreditNoteID}/Attachments/{AttachmentID} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Credit Note as binary data + */ + GetCreditNoteAttachmentById(CreditNoteID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on CreditNote by file name + * Get CreditNotes/{CreditNoteID}/Attachments/{FileName} + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {string} FileName Name of the file you are attaching to Credit Note + * @return {void} Success - return response of attachment for Credit Note as binary data + */ + GetCreditNoteAttachmentByFileName(CreditNoteID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Credit Note as PDF files + * Get CreditNotes/{CreditNoteID}/pdf + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @return {void} Success - return response of binary data from the Attachment to a Credit Note + */ + GetCreditNoteAsPdf(CreditNoteID: string): Observable> { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to create Allocation on CreditNote + * Put CreditNotes/{CreditNoteID}/Allocations + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Allocations} requestBody Allocations with array of Allocation object in body of request. + * @return {Allocations} Success - return response of type Allocations array with newly created Allocation for specific Credit Note + */ + CreateCreditNoteAllocation(CreditNoteID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { + return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an CreditNote + * Get CreditNotes/{CreditNoteID}/History + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetCreditNoteHistory(CreditNoteID: string): Observable { + return this.http.get(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an CreditNote + * Put CreditNotes/{CreditNoteID}/History + * @param {string} CreditNoteID Unique identifier for a Credit Note + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateCreditNoteHistory(CreditNoteID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'CreditNotes/' + (CreditNoteID == null ? '' : encodeURIComponent(CreditNoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve currencies for your organisation + * Get Currencies + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Currencies} Success - return response of type Currencies array with all Currencies + */ + GetCurrencies(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Currencies?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Put Currencies + * @param {Currency} requestBody Currency obejct in the body of request + * @return {Currencies} Unsupported - return response incorrect exception, API is not able to create new Currency + */ + CreateCurrency(requestBody: Currency): Observable { + return this.http.put(this.baseUri + 'Currencies', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve employees used in Xero payrun + * Get Employees + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Employees} Success - return response of type Employees array with all Employee + */ + GetEmployees(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Employees?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create new employees used in Xero payrun + * Put Employees + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Employees} requestBody Employees with array of Employee object in body of request + * @return {Employees} Success - return response of type Employees array with new Employee + */ + CreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { + return this.http.put(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to create a single new employees used in Xero payrun + * Post Employees + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Employees} requestBody Employees with array of Employee object in body of request + * @return {Employees} Success - return response of type Employees array with new Employee + */ + UpdateOrCreateEmployees(summarizeErrors: boolean | null | undefined, requestBody: Employees): Observable { + return this.http.post(this.baseUri + 'Employees?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specific employee used in Xero payrun + * Get Employees/{EmployeeID} + * @param {string} EmployeeID Unique identifier for a Employee + * @return {Employees} Success - return response of type Employees array with specified Employee + */ + GetEmployee(EmployeeID: string): Observable { + return this.http.get(this.baseUri + 'Employees/' + (EmployeeID == null ? '' : encodeURIComponent(EmployeeID)), {}); + } + + /** + * Allows you to retrieve expense claims + * Get ExpenseClaims + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with all ExpenseClaims + */ + GetExpenseClaims(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'ExpenseClaims?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to retrieve expense claims + * Put ExpenseClaims + * @param {ExpenseClaims} requestBody ExpenseClaims with array of ExpenseClaim object in body of request + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with newly created ExpenseClaim + */ + CreateExpenseClaims(requestBody: ExpenseClaims): Observable { + return this.http.put(this.baseUri + 'ExpenseClaims', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified expense claim + * Get ExpenseClaims/{ExpenseClaimID} + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with specified ExpenseClaim + */ + GetExpenseClaim(ExpenseClaimID: string): Observable { + return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), {}); + } + + /** + * Allows you to update specified expense claims + * Post ExpenseClaims/{ExpenseClaimID} + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @return {ExpenseClaims} Success - return response of type ExpenseClaims array with updated ExpenseClaim + */ + UpdateExpenseClaim(ExpenseClaimID: string, requestBody: ExpenseClaims): Observable { + return this.http.post(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an ExpenseClaim + * Get ExpenseClaims/{ExpenseClaimID}/History + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetExpenseClaimHistory(ExpenseClaimID: string): Observable { + return this.http.get(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', {}); + } + + /** + * Allows you to create a history records of an ExpenseClaim + * Put ExpenseClaims/{ExpenseClaimID}/History + * @param {string} ExpenseClaimID Unique identifier for a ExpenseClaim + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateExpenseClaimHistory(ExpenseClaimID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'ExpenseClaims/' + (ExpenseClaimID == null ? '' : encodeURIComponent(ExpenseClaimID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any sales invoices or purchase bills + * Get Invoices + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {Array} IDs Filter by a comma-separated list of InvoicesIDs. + * @param {Array} InvoiceNumbers Filter by a comma-separated list of InvoiceNumbers. + * @param {Array} ContactIDs Filter by a comma-separated list of ContactIDs. + * @param {Array} Statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + * @param {number} page e.g. page=1 � Up to 100 invoices will be returned in a single API call with line items shown for each invoice + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} includeArchived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + * @param {boolean} createdByMyApp When set to true you'll only retrieve Invoices created by your app + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with all Invoices + */ + GetInvoices(where: string | null | undefined, order: string | null | undefined, IDs: Array | null | undefined, InvoiceNumbers: Array | null | undefined, ContactIDs: Array | null | undefined, Statuses: Array | null | undefined, page: number | null | undefined, includeArchived: boolean | null | undefined, createdByMyApp: boolean | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Invoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&' + IDs?.map(z => `IDs=${encodeURIComponent(z)}`).join('&') + '&' + InvoiceNumbers?.map(z => `InvoiceNumbers=${encodeURIComponent(z)}`).join('&') + '&' + ContactIDs?.map(z => `ContactIDs=${encodeURIComponent(z)}`).join('&') + '&' + Statuses?.map(z => `Statuses=${encodeURIComponent(z)}`).join('&') + '&page=' + page + '&includeArchived=' + includeArchived + '&createdByMyApp=' + createdByMyApp + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create one or more sales invoices or purchase bills + * Put Invoices + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {Invoices} requestBody Invoices with an array of invoice objects in body of request + * @return {Invoices} Success - return response of type Invoices array with newly created Invoice + */ + CreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { + return this.http.put(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more sales invoices or purchase bills + * Post Invoices + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with newly created Invoice + */ + UpdateOrCreateInvoices(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Invoices): Observable { + return this.http.post(this.baseUri + 'Invoices?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified sales invoice or purchase bill + * Get Invoices/{InvoiceID} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with specified Invoices + */ + GetInvoice(InvoiceID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a specified sales invoices or purchase bills + * Post Invoices/{InvoiceID} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Invoices} Success - return response of type Invoices array with updated Invoice + */ + UpdateInvoice(InvoiceID: string, unitdp: number | null | undefined, requestBody: Invoices): Observable { + return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve invoices or purchase bills as PDF files + * Get Invoices/{InvoiceID}/pdf + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {void} Success - return response of byte array pdf version of specified Invoices + */ + GetInvoiceAsPdf(InvoiceID: string): Observable> { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on invoices or purchase bills + * Get Invoices/{InvoiceID}/Attachments + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {Attachments} Success - return response of type Attachments array of Attachments for specified Invoices + */ + GetInvoiceAttachments(InvoiceID: string): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID + * Get Invoices/{InvoiceID}/Attachments/{AttachmentID} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {string} AttachmentID Unique identifier for an Attachment + * @return {void} Success - return response of attachment for Invoice as binary data + */ + GetInvoiceAttachmentById(InvoiceID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachment on invoices or purchase bills by it's filename + * Get Invoices/{InvoiceID}/Attachments/{FileName} + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {string} FileName Name of the file you are attaching + * @return {void} Success - return response of attachment for Invoice as binary data + */ + GetInvoiceAttachmentByFileName(InvoiceID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a URL to an online invoice + * Get Invoices/{InvoiceID}/OnlineInvoice + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {OnlineInvoices} Success - return response of type OnlineInvoice array with one OnlineInvoice + */ + GetOnlineInvoice(InvoiceID: string): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/OnlineInvoice', {}); + } + + /** + * Allows you to email a copy of invoice to related Contact + * Post Invoices/{InvoiceID}/Email + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {void} + */ + EmailInvoice(InvoiceID: string, requestBody: RequestEmpty): Observable> { + return this.http.post(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/Email', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a history records of an invoice + * Get Invoices/{InvoiceID}/History + * @param {string} InvoiceID Unique identifier for an Invoice + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetInvoiceHistory(InvoiceID: string): Observable { + return this.http.get(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an invoice + * Put Invoices/{InvoiceID}/History + * @param {string} InvoiceID Unique identifier for an Invoice + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateInvoiceHistory(InvoiceID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Invoices/' + (InvoiceID == null ? '' : encodeURIComponent(InvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve invoice reminder settings + * Get InvoiceReminders/Settings + * @return {InvoiceReminders} Success - return response of Invoice Reminders + */ + GetInvoiceReminders(): Observable { + return this.http.get(this.baseUri + 'InvoiceReminders/Settings', {}); + } + + /** + * Allows you to retrieve any items + * Get Items + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with all Item + */ + GetItems(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Items?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create one or more items + * Put Items + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {Items} requestBody Items with an array of Item objects in body of request + * @return {Items} Success - return response of type Items array with newly created Item + */ + CreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { + return this.http.put(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update or create one or more items + * Post Items + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with newly created Item + */ + UpdateOrCreateItems(summarizeErrors: boolean | null | undefined, unitdp: number | null | undefined, requestBody: Items): Observable { + return this.http.post(this.baseUri + 'Items?summarizeErrors=' + summarizeErrors + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified item + * Get Items/{ItemID} + * @param {string} ItemID Unique identifier for an Item + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with specified Item + */ + GetItem(ItemID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to update a specified item + * Post Items/{ItemID} + * @param {string} ItemID Unique identifier for an Item + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Items} Success - return response of type Items array with updated Item + */ + UpdateItem(ItemID: string, unitdp: number | null | undefined, requestBody: Items): Observable { + return this.http.post(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a specified item + * Delete Items/{ItemID} + * @param {string} ItemID Unique identifier for an Item + * @return {void} + */ + DeleteItem(ItemID: string): Observable> { + return this.http.delete(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history for items + * Get Items/{ItemID}/History + * @param {string} ItemID Unique identifier for an Item + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetItemHistory(ItemID: string): Observable { + return this.http.get(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', {}); + } + + /** + * Allows you to create a history record for items + * Put Items/{ItemID}/History + * @param {string} ItemID Unique identifier for an Item + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateItemHistory(ItemID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Items/' + (ItemID == null ? '' : encodeURIComponent(ItemID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any journals. + * Get Journals + * @param {number} offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {boolean} paymentsOnly Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. + * @return {Journals} Success - return response of type Journals array with all Journals + */ + GetJournals(offset: number | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Journals?offset=' + offset + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve a specified journals. + * Get Journals/{JournalID} + * @param {string} JournalID Unique identifier for a Journal + * @return {Journals} Success - return response of type Journals array with specified Journal + */ + GetJournal(JournalID: string): Observable { + return this.http.get(this.baseUri + 'Journals/' + (JournalID == null ? '' : encodeURIComponent(JournalID)), {}); + } + + /** + * Retrieve linked transactions (billable expenses) + * Get LinkedTransactions + * @param {number} page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} LinkedTransactionID The Xero identifier for an Linked Transaction + * @param {string} SourceTransactionID Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + * @param {string} ContactID Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + * @param {string} Status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status + * @param {string} TargetTransactionID Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with all LinkedTransaction + */ + GetLinkedTransactions(page: number | null | undefined, LinkedTransactionID: string | null | undefined, SourceTransactionID: string | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, TargetTransactionID: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'LinkedTransactions?page=' + page + '&LinkedTransactionID=' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)) + '&SourceTransactionID=' + (SourceTransactionID == null ? '' : encodeURIComponent(SourceTransactionID)) + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&TargetTransactionID=' + (TargetTransactionID == null ? '' : encodeURIComponent(TargetTransactionID)), {}); + } + + /** + * Allows you to create linked transactions (billable expenses) + * Put LinkedTransactions + * @param {LinkedTransaction} requestBody LinkedTransaction object in body of request + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with newly created LinkedTransaction + */ + CreateLinkedTransaction(requestBody: LinkedTransaction): Observable { + return this.http.put(this.baseUri + 'LinkedTransactions', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified linked transactions (billable expenses) + * Get LinkedTransactions/{LinkedTransactionID} + * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with a specified LinkedTransaction + */ + GetLinkedTransaction(LinkedTransactionID: string): Observable { + return this.http.get(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), {}); + } + + /** + * Allows you to update a specified linked transactions (billable expenses) + * Post LinkedTransactions/{LinkedTransactionID} + * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction + * @return {LinkedTransactions} Success - return response of type LinkedTransactions array with updated LinkedTransaction + */ + UpdateLinkedTransaction(LinkedTransactionID: string, requestBody: LinkedTransactions): Observable { + return this.http.post(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a specified linked transactions (billable expenses) + * Delete LinkedTransactions/{LinkedTransactionID} + * @param {string} LinkedTransactionID Unique identifier for a LinkedTransaction + * @return {void} + */ + DeleteLinkedTransaction(LinkedTransactionID: string): Observable> { + return this.http.delete(this.baseUri + 'LinkedTransactions/' + (LinkedTransactionID == null ? '' : encodeURIComponent(LinkedTransactionID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve any manual journals + * Get ManualJournals + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {ManualJournals} Success - return response of type ManualJournals array with a all ManualJournals + */ + GetManualJournals(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'ManualJournals?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Allows you to create one or more manual journals + * Put ManualJournals + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request + * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal + */ + CreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { + return this.http.put(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to create a single manual journal + * Post ManualJournals + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {ManualJournals} requestBody ManualJournals array with ManualJournal object in body of request + * @return {ManualJournals} Success - return response of type ManualJournals array with newly created ManualJournal + */ + UpdateOrCreateManualJournals(summarizeErrors: boolean | null | undefined, requestBody: ManualJournals): Observable { + return this.http.post(this.baseUri + 'ManualJournals?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified manual journals + * Get ManualJournals/{ManualJournalID} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @return {ManualJournals} Success - return response of type ManualJournals array with a specified ManualJournals + */ + GetManualJournal(ManualJournalID: string): Observable { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), {}); + } + + /** + * Allows you to update a specified manual journal + * Post ManualJournals/{ManualJournalID} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @return {ManualJournals} Success - return response of type ManualJournals array with an updated ManualJournal + */ + UpdateManualJournal(ManualJournalID: string, requestBody: ManualJournals): Observable { + return this.http.post(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve Attachment for manual journals + * Get ManualJournals/{ManualJournalID}/Attachments + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @return {Attachments} Success - return response of type Attachments array with all Attachments for a ManualJournals + */ + GetManualJournalAttachments(ManualJournalID: string): Observable { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve specified Attachment on ManualJournals + * Get ManualJournals/{ManualJournalID}/Attachments/{AttachmentID} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Manual Journal as binary data + */ + GetManualJournalAttachmentById(ManualJournalID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve specified Attachment on ManualJournal by file name + * Get ManualJournals/{ManualJournalID}/Attachments/{FileName} + * @param {string} ManualJournalID Unique identifier for a ManualJournal + * @param {string} FileName The name of the file being attached to a ManualJournal + * @return {void} Success - return response of attachment for Manual Journal as binary data + */ + GetManualJournalAttachmentByFileName(ManualJournalID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'ManualJournals/' + (ManualJournalID == null ? '' : encodeURIComponent(ManualJournalID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Organisation details + * Get Organisation + * @return {Organisations} Success - return response of type Organisation array with all Organisation + */ + GetOrganisations(): Observable { + return this.http.get(this.baseUri + 'Organisation', {}); + } + + /** + * Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + * Get Organisation/{OrganisationID}/CISSettings + * @param {string} OrganisationID The unique Xero identifier for an organisation + * @return {CISOrgSetting} Success - return response of type Organisation array with specified Organisation + */ + GetOrganisationCISSettings(OrganisationID: string): Observable { + return this.http.get(this.baseUri + 'Organisation/' + (OrganisationID == null ? '' : encodeURIComponent(OrganisationID)) + '/CISSettings', {}); + } + + /** + * Allows you to retrieve overpayments + * Get Overpayments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Overpayments} Success - return response of type Overpayments array with all Overpayments + */ + GetOverpayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Overpayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to retrieve a specified overpayments + * Get Overpayments/{OverpaymentID} + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @return {Overpayments} Success - return response of type Overpayments array with specified Overpayments + */ + GetOverpayment(OverpaymentID: string): Observable { + return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)), {}); + } + + /** + * Allows you to create a single allocation for an overpayment + * Put Overpayments/{OverpaymentID}/Allocations + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Allocations} requestBody Allocations array with Allocation object in body of request + * @return {Allocations} Success - return response of type Allocations array with all Allocation for Overpayments + */ + CreateOverpaymentAllocations(OverpaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { + return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an Overpayment + * Get Overpayments/{OverpaymentID}/History + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetOverpaymentHistory(OverpaymentID: string): Observable { + return this.http.get(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', {}); + } + + /** + * Allows you to create history records of an Overpayment + * Put Overpayments/{OverpaymentID}/History + * @param {string} OverpaymentID Unique identifier for a Overpayment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateOverpaymentHistory(OverpaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Overpayments/' + (OverpaymentID == null ? '' : encodeURIComponent(OverpaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve payments for invoices and credit notes + * Get Payments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page Up to 100 payments will be returned in a single API call + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Payments} Success - return response of type Payments array for all Payments + */ + GetPayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Payments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Allows you to create multiple payments for invoices or credit notes + * Put Payments + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Payments} requestBody Payments array with Payment object in body of request + * @return {Payments} Success - return response of type Payments array for newly created Payment + */ + CreatePayments(summarizeErrors: boolean | null | undefined, requestBody: Payments): Observable { + return this.http.put(this.baseUri + 'Payments?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to create a single payment for invoices or credit notes + * Post Payments + * @param {Payment} requestBody Request body with a single Payment object + * @return {Payments} Success - return response of type Payments array for newly created Payment + */ + CreatePayment(requestBody: Payment): Observable { + return this.http.post(this.baseUri + 'Payments', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified payment for invoices and credit notes + * Get Payments/{PaymentID} + * @param {string} PaymentID Unique identifier for a Payment + * @return {Payments} Success - return response of type Payments array for specified Payment + */ + GetPayment(PaymentID: string): Observable { + return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), {}); + } + + /** + * Allows you to update a specified payment for invoices and credit notes + * Post Payments/{PaymentID} + * @param {string} PaymentID Unique identifier for a Payment + * @return {Payments} Success - return response of type Payments array for updated Payment + */ + DeletePayment(PaymentID: string, requestBody: PaymentDelete): Observable { + return this.http.post(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve history records of a payment + * Get Payments/{PaymentID}/History + * @param {string} PaymentID Unique identifier for a Payment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetPaymentHistory(PaymentID: string): Observable { + return this.http.get(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', {}); + } + + /** + * Allows you to create a history record for a payment + * Put Payments/{PaymentID}/History + * @param {string} PaymentID Unique identifier for a Payment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreatePaymentHistory(PaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Payments/' + (PaymentID == null ? '' : encodeURIComponent(PaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve payment services + * Get PaymentServices + * @return {PaymentServices} Success - return response of type PaymentServices array for all PaymentService + */ + GetPaymentServices(): Observable { + return this.http.get(this.baseUri + 'PaymentServices', {}); + } + + /** + * Allows you to create payment services + * Put PaymentServices + * @param {PaymentServices} requestBody PaymentServices array with PaymentService object in body of request + * @return {PaymentServices} Success - return response of type PaymentServices array for newly created PaymentService + */ + CreatePaymentService(requestBody: PaymentServices): Observable { + return this.http.put(this.baseUri + 'PaymentServices', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve prepayments + * Get Prepayments + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} page e.g. page=1 � Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Prepayments} Success - return response of type Prepayments array for all Prepayment + */ + GetPrepayments(where: string | null | undefined, order: string | null | undefined, page: number | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Prepayments?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to retrieve a specified prepayments + * Get Prepayments/{PrepaymentID} + * @param {string} PrepaymentID Unique identifier for a PrePayment + * @return {Prepayments} Success - return response of type Prepayments array for a specified Prepayment + */ + GetPrepayment(PrepaymentID: string): Observable { + return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)), {}); + } + + /** + * Allows you to create an Allocation for prepayments + * Put Prepayments/{PrepaymentID}/Allocations + * @param {string} PrepaymentID Unique identifier for Prepayment + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Allocations} requestBody Allocations with an array of Allocation object in body of request + * @return {Allocations} Success - return response of type Allocations array of Allocation for all Prepayment + */ + CreatePrepaymentAllocations(PrepaymentID: string, summarizeErrors: boolean | null | undefined, requestBody: Allocations): Observable { + return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/Allocations&summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an Prepayment + * Get Prepayments/{PrepaymentID}/History + * @param {string} PrepaymentID Unique identifier for a PrePayment + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetPrepaymentHistory(PrepaymentID: string): Observable { + return this.http.get(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', {}); + } + + /** + * Allows you to create a history record for an Prepayment + * Put Prepayments/{PrepaymentID}/History + * @param {string} PrepaymentID Unique identifier for a PrePayment + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreatePrepaymentHistory(PrepaymentID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Prepayments/' + (PrepaymentID == null ? '' : encodeURIComponent(PrepaymentID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve purchase orders + * Get PurchaseOrders + * @param {PurchaseOrderStatus} Status Filter by purchase order status + * @param {string} DateFrom Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param {string} DateTo Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + * @param {string} order Order by an any element + * @param {number} page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array of all PurchaseOrder + */ + GetPurchaseOrders(Status: PurchaseOrderStatus | null | undefined, DateFrom: string | null | undefined, DateTo: string | null | undefined, order: string | null | undefined, page: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders?Status=' + Status + '&DateFrom=' + (DateFrom == null ? '' : encodeURIComponent(DateFrom)) + '&DateTo=' + (DateTo == null ? '' : encodeURIComponent(DateTo)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&page=' + page, {}); + } + + /** + * Allows you to create one or more purchase orders + * Put PurchaseOrders + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {PurchaseOrders} requestBody PurchaseOrders with an array of PurchaseOrder object in body of request + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + CreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { + return this.http.put(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update or create one or more purchase orders + * Post PurchaseOrders + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + UpdateOrCreatePurchaseOrders(summarizeErrors: boolean | null | undefined, requestBody: PurchaseOrders): Observable { + return this.http.post(this.baseUri + 'PurchaseOrders?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve purchase orders as PDF files + * Get PurchaseOrders/{PurchaseOrderID}/pdf + * @param {string} PurchaseOrderID Unique identifier for an Purchase Order + * @return {void} Success - return response of byte array pdf version of specified Purchase Orders + */ + GetPurchaseOrderAsPdf(PurchaseOrderID: string): Observable> { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a specified purchase orders + * Get PurchaseOrders/{PurchaseOrderID} + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + GetPurchaseOrder(PurchaseOrderID: string): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), {}); + } + + /** + * Allows you to update a specified purchase order + * Post PurchaseOrders/{PurchaseOrderID} + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for updated PurchaseOrder + */ + UpdatePurchaseOrder(PurchaseOrderID: string, requestBody: PurchaseOrders): Observable { + return this.http.post(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified purchase orders + * Get PurchaseOrders/{PurchaseOrderNumber} + * @param {string} PurchaseOrderNumber Unique identifier for a PurchaseOrder + * @return {PurchaseOrders} Success - return response of type PurchaseOrder array for specified PurchaseOrder + */ + GetPurchaseOrderByNumber(PurchaseOrderNumber: string): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderNumber == null ? '' : encodeURIComponent(PurchaseOrderNumber)), {}); + } + + /** + * Allows you to retrieve history for PurchaseOrder + * Get PurchaseOrders/{PurchaseOrderID}/History + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetPurchaseOrderHistory(PurchaseOrderID: string): Observable { + return this.http.get(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', {}); + } + + /** + * Allows you to create HistoryRecord for purchase orders + * Put PurchaseOrders/{PurchaseOrderID}/History + * @param {string} PurchaseOrderID Unique identifier for a PurchaseOrder + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreatePurchaseOrderHistory(PurchaseOrderID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'PurchaseOrders/' + (PurchaseOrderID == null ? '' : encodeURIComponent(PurchaseOrderID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any sales quotes + * Get Quotes + * @param {Date} DateFrom Filter for quotes after a particular date + * Type: DateOnly + * @param {Date} DateTo Filter for quotes before a particular date + * Type: DateOnly + * @param {Date} ExpiryDateFrom Filter for quotes expiring after a particular date + * Type: DateOnly + * @param {Date} ExpiryDateTo Filter for quotes before a particular date + * Type: DateOnly + * @param {string} ContactID Filter for quotes belonging to a particular contact + * @param {string} Status Filter for quotes of a particular Status + * @param {number} page e.g. page=1 � Up to 100 Quotes will be returned in a single API call with line items shown for each quote + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {string} order Order by an any element + * @return {Quotes} Success - return response of type quotes array with all quotes + */ + GetQuotes(DateFrom: Date | null | undefined, DateTo: Date | null | undefined, ExpiryDateFrom: Date | null | undefined, ExpiryDateTo: Date | null | undefined, ContactID: string | null | undefined, Status: string | null | undefined, page: number | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Quotes?DateFrom=' + DateFrom?.toISOString() + '&DateTo=' + DateTo?.toISOString() + '&ExpiryDateFrom=' + ExpiryDateFrom?.toISOString() + '&ExpiryDateTo=' + ExpiryDateTo?.toISOString() + '&ContactID=' + (ContactID == null ? '' : encodeURIComponent(ContactID)) + '&Status=' + (Status == null ? '' : encodeURIComponent(Status)) + '&page=' + page + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to create one or more quotes + * Put Quotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @param {Quotes} requestBody Quotes with an array of Quote object in body of request + * @return {Quotes} Success - return response of type Quotes with array with newly created Quote + */ + CreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { + return this.http.put(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update OR create one or more quotes + * Post Quotes + * @param {boolean} summarizeErrors If false return 200 OK and mix of successfully created obejcts and any with validation errors + * @return {Quotes} Success - return response of type Quotes array with updated or created Quote + */ + UpdateOrCreateQuotes(summarizeErrors: boolean | null | undefined, requestBody: Quotes): Observable { + return this.http.post(this.baseUri + 'Quotes?summarizeErrors=' + summarizeErrors, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified quote + * Get Quotes/{QuoteID} + * @param {string} QuoteID Unique identifier for an Quote + * @return {Quotes} Success - return response of type Quotes array with specified Quote + */ + GetQuote(QuoteID: string): Observable { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), {}); + } + + /** + * Allows you to update a specified quote + * Post Quotes/{QuoteID} + * @param {string} QuoteID Unique identifier for an Quote + * @return {Quotes} Success - return response of type Quotes array with updated Quote + */ + UpdateQuote(QuoteID: string, requestBody: Quotes): Observable { + return this.http.post(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a history records of an quote + * Get Quotes/{QuoteID}/History + * @param {string} QuoteID Unique identifier for an Quote + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetQuoteHistory(QuoteID: string): Observable { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an quote + * Put Quotes/{QuoteID}/History + * @param {string} QuoteID Unique identifier for an Quote + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateQuoteHistory(QuoteID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve quotes as PDF files + * Get Quotes/{QuoteID}/pdf + * @param {string} QuoteID Unique identifier for an Quote + * @return {void} Success - return response of byte array pdf version of specified Quotes + */ + GetQuoteAsPdf(QuoteID: string): Observable> { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/pdf', { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments for Quotes + * Get Quotes/{QuoteID}/Attachments + * @param {string} QuoteID Unique identifier for Quote object + * @return {Attachments} Success - return response of type Attachments array of Attachment + */ + GetQuoteAttachments(QuoteID: string): Observable { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve specific Attachment on Quote + * Get Quotes/{QuoteID}/Attachments/{AttachmentID} + * @param {string} QuoteID Unique identifier for Quote object + * @param {string} AttachmentID Unique identifier for Attachment object + * @return {void} Success - return response of attachment for Quote as binary data + */ + GetQuoteAttachmentById(QuoteID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachment on Quote by Filename + * Get Quotes/{QuoteID}/Attachments/{FileName} + * @param {string} QuoteID Unique identifier for Quote object + * @param {string} FileName Name of the attachment + * @return {void} Success - return response of attachment for Quote as binary data + */ + GetQuoteAttachmentByFileName(QuoteID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Quotes/' + (QuoteID == null ? '' : encodeURIComponent(QuoteID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve draft expense claim receipts for any user + * Get Receipts + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Receipts} Success - return response of type Receipts array for all Receipt + */ + GetReceipts(where: string | null | undefined, order: string | null | undefined, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Receipts?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to create draft expense claim receipts for any user + * Put Receipts + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {Receipts} requestBody Receipts with an array of Receipt object in body of request + * @return {Receipts} Success - return response of type Receipts array for newly created Receipt + */ + CreateReceipt(unitdp: number | null | undefined, requestBody: Receipts): Observable { + return this.http.put(this.baseUri + 'Receipts?unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve a specified draft expense claim receipts + * Get Receipts/{ReceiptID} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Receipts} Success - return response of type Receipts array for a specified Receipt + */ + GetReceipt(ReceiptID: string, unitdp: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, {}); + } + + /** + * Allows you to retrieve a specified draft expense claim receipts + * Post Receipts/{ReceiptID} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {number} unitdp e.g. unitdp=4 � (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Receipts} Success - return response of type Receipts array for updated Receipt + */ + UpdateReceipt(ReceiptID: string, unitdp: number | null | undefined, requestBody: Receipts): Observable { + return this.http.post(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '&unitdp=' + unitdp, JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve Attachments for expense claim receipts + * Get Receipts/{ReceiptID}/Attachments + * @param {string} ReceiptID Unique identifier for a Receipt + * @return {Attachments} Success - return response of type Attachments array of Attachments for a specified Receipt + */ + GetReceiptAttachments(ReceiptID: string): Observable { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve Attachments on expense claim receipts by ID + * Get Receipts/{ReceiptID}/Attachments/{AttachmentID} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Receipt as binary data + */ + GetReceiptAttachmentById(ReceiptID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve Attachments on expense claim receipts by file name + * Get Receipts/{ReceiptID}/Attachments/{FileName} + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {string} FileName The name of the file being attached to the Receipt + * @return {void} Success - return response of attachment for Receipt as binary data + */ + GetReceiptAttachmentByFileName(ReceiptID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve a history records of an Receipt + * Get Receipts/{ReceiptID}/History + * @param {string} ReceiptID Unique identifier for a Receipt + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetReceiptHistory(ReceiptID: string): Observable { + return this.http.get(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', {}); + } + + /** + * Allows you to retrieve a history records of an Receipt + * Put Receipts/{ReceiptID}/History + * @param {string} ReceiptID Unique identifier for a Receipt + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateReceiptHistory(ReceiptID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'Receipts/' + (ReceiptID == null ? '' : encodeURIComponent(ReceiptID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve any repeating invoices + * Get RepeatingInvoices + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array for all Repeating Invoice + */ + GetRepeatingInvoices(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to retrieve a specified repeating invoice + * Get RepeatingInvoices/{RepeatingInvoiceID} + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @return {RepeatingInvoices} Success - return response of type Repeating Invoices array with a specified Repeating Invoice + */ + GetRepeatingInvoice(RepeatingInvoiceID: string): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)), {}); + } + + /** + * Allows you to retrieve Attachments on repeating invoice + * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @return {Attachments} Success - return response of type Attachments array with all Attachments for a specified Repeating Invoice + */ + GetRepeatingInvoiceAttachments(RepeatingInvoiceID: string): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments', {}); + } + + /** + * Allows you to retrieve a specified Attachments on repeating invoices + * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID} + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @param {string} AttachmentID Unique identifier for a Attachment + * @return {void} Success - return response of attachment for Repeating Invoice as binary data + */ + GetRepeatingInvoiceAttachmentById(RepeatingInvoiceID: string, AttachmentID: string): Observable> { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (AttachmentID == null ? '' : encodeURIComponent(AttachmentID)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve specified attachment on repeating invoices by file name + * Get RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @param {string} FileName The name of the file being attached to a Repeating Invoice + * @return {void} Success - return response of attachment for Repeating Invoice as binary data + */ + GetRepeatingInvoiceAttachmentByFileName(RepeatingInvoiceID: string, FileName: string): Observable> { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/Attachments/' + (FileName == null ? '' : encodeURIComponent(FileName)), { observe: 'response', responseType: 'text' }); + } + + /** + * Allows you to retrieve history for a repeating invoice + * Get RepeatingInvoices/{RepeatingInvoiceID}/History + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @return {HistoryRecords} Success - return response of HistoryRecords array of 0 to N HistoryRecord + */ + GetRepeatingInvoiceHistory(RepeatingInvoiceID: string): Observable { + return this.http.get(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', {}); + } + + /** + * Allows you to create history for a repeating invoice + * Put RepeatingInvoices/{RepeatingInvoiceID}/History + * @param {string} RepeatingInvoiceID Unique identifier for a Repeating Invoice + * @param {HistoryRecords} requestBody HistoryRecords containing an array of HistoryRecord objects in body of request + * @return {HistoryRecords} Success - return response of type HistoryRecords array of HistoryRecord objects + */ + CreateRepeatingInvoiceHistory(RepeatingInvoiceID: string, requestBody: HistoryRecords): Observable { + return this.http.put(this.baseUri + 'RepeatingInvoices/' + (RepeatingInvoiceID == null ? '' : encodeURIComponent(RepeatingInvoiceID)) + '/History', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve report for TenNinetyNine + * Get Reports/TenNinetyNine + * @param {string} reportYear The year of the 1099 report + * @return {Reports} Success - return response of type Reports + */ + GetReportTenNinetyNine(reportYear: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/TenNinetyNine?reportYear=' + (reportYear == null ? '' : encodeURIComponent(reportYear)), {}); + } + + /** + * Allows you to retrieve report for AgedPayablesByContact + * Get Reports/AgedPayablesByContact + * @param {string} contactId Unique identifier for a Contact + * @param {Date} date The date of the Aged Payables By Contact report + * Type: DateOnly + * @param {Date} fromDate The from date of the Aged Payables By Contact report + * Type: DateOnly + * @param {Date} toDate The to date of the Aged Payables By Contact report + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportAgedPayablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/AgedPayablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for AgedReceivablesByContact + * Get Reports/AgedReceivablesByContact + * @param {string} contactId Unique identifier for a Contact + * @param {Date} date The date of the Aged Receivables By Contact report + * Type: DateOnly + * @param {Date} fromDate The from date of the Aged Receivables By Contact report + * Type: DateOnly + * @param {Date} toDate The to date of the Aged Receivables By Contact report + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportAgedReceivablesByContact(contactId: string, date: Date | null | undefined, fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/AgedReceivablesByContact?contactId=' + (contactId == null ? '' : encodeURIComponent(contactId)) + '&date=' + date?.toISOString() + '&fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for BalanceSheet + * Get Reports/BalanceSheet + * @param {string} date The date of the Balance Sheet report + * @param {number} periods The number of periods for the Balance Sheet report + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param {string} trackingOptionID1 The tracking option 1 for the Balance Sheet report + * @param {string} trackingOptionID2 The tracking option 2 for the Balance Sheet report + * @param {boolean} standardLayout The standard layout boolean for the Balance Sheet report + * @param {boolean} paymentsOnly return a cash basis for the Balance Sheet report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBalanceSheet(date: string | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingOptionID1: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/BalanceSheet?date=' + (date == null ? '' : encodeURIComponent(date)) + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingOptionID1=' + (trackingOptionID1 == null ? '' : encodeURIComponent(trackingOptionID1)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve report for BankSummary + * Get Reports/BankSummary + * @param {Date} fromDate The from date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @param {Date} toDate The to date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBankSummary(fromDate: Date | null | undefined, toDate: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/BankSummary?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for BAS only valid for AU orgs + * Get Reports + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBASorGSTList(): Observable { + return this.http.get(this.baseUri + 'Reports', {}); + } + + /** + * Allows you to retrieve report for BAS only valid for AU orgs + * Get Reports/{ReportID} + * @param {string} ReportID Unique identifier for a Report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportBASorGST(ReportID: string): Observable { + return this.http.get(this.baseUri + 'Reports/' + (ReportID == null ? '' : encodeURIComponent(ReportID)), {}); + } + + /** + * Allows you to retrieve report for Budget Summary + * Get Reports/BudgetSummary + * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @param {number} period The number of periods to compare (integer between 1 and 12) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} timeframe The period size to compare to (1=month, 3=quarter, 12=year) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {ReportWithRows} success- return a Report with Rows object + */ + GetReportBudgetSummary(date: Date | null | undefined, period: number | null | undefined, timeframe: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/BudgetSummary?date=' + date?.toISOString() + '&period=' + period + '&timeframe=' + timeframe, {}); + } + + /** + * Allows you to retrieve report for ExecutiveSummary + * Get Reports/ExecutiveSummary + * @param {Date} date The date for the Bank Summary report e.g. 2018-03-31 + * Type: DateOnly + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportExecutiveSummary(date: Date | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/ExecutiveSummary?date=' + date?.toISOString(), {}); + } + + /** + * Allows you to retrieve report for ProfitAndLoss + * Get Reports/ProfitAndLoss + * @param {Date} fromDate The from date for the ProfitAndLoss report e.g. 2018-03-31 + * Type: DateOnly + * @param {Date} toDate The to date for the ProfitAndLoss report e.g. 2018-03-31 + * Type: DateOnly + * @param {number} periods The number of periods to compare (integer between 1 and 12) + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {GetReportBalanceSheetTimeframe} timeframe The period size to compare to (MONTH, QUARTER, YEAR) + * @param {string} trackingCategoryID The trackingCategory 1 for the ProfitAndLoss report + * @param {string} trackingCategoryID2 The trackingCategory 2 for the ProfitAndLoss report + * @param {string} trackingOptionID The tracking option 1 for the ProfitAndLoss report + * @param {string} trackingOptionID2 The tracking option 2 for the ProfitAndLoss report + * @param {boolean} standardLayout Return the standard layout for the ProfitAndLoss report + * @param {boolean} paymentsOnly Return cash only basis for the ProfitAndLoss report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportProfitAndLoss(fromDate: Date | null | undefined, toDate: Date | null | undefined, periods: number | null | undefined, timeframe: GetReportBalanceSheetTimeframe | null | undefined, trackingCategoryID: string | null | undefined, trackingCategoryID2: string | null | undefined, trackingOptionID: string | null | undefined, trackingOptionID2: string | null | undefined, standardLayout: boolean | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/ProfitAndLoss?fromDate=' + fromDate?.toISOString() + '&toDate=' + toDate?.toISOString() + '&periods=' + periods + '&timeframe=' + timeframe + '&trackingCategoryID=' + (trackingCategoryID == null ? '' : encodeURIComponent(trackingCategoryID)) + '&trackingCategoryID2=' + (trackingCategoryID2 == null ? '' : encodeURIComponent(trackingCategoryID2)) + '&trackingOptionID=' + (trackingOptionID == null ? '' : encodeURIComponent(trackingOptionID)) + '&trackingOptionID2=' + (trackingOptionID2 == null ? '' : encodeURIComponent(trackingOptionID2)) + '&standardLayout=' + standardLayout + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve report for TrialBalance + * Get Reports/TrialBalance + * @param {Date} date The date for the Trial Balance report e.g. 2018-03-31 + * Type: DateOnly + * @param {boolean} paymentsOnly Return cash only basis for the Trial Balance report + * @return {ReportWithRows} Success - return response of type ReportWithRows + */ + GetReportTrialBalance(date: Date | null | undefined, paymentsOnly: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'Reports/TrialBalance?date=' + date?.toISOString() + '&paymentsOnly=' + paymentsOnly, {}); + } + + /** + * Allows you to retrieve Tax Rates + * Get TaxRates + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {string} TaxType Filter by tax type + * @return {TaxRates} Success - return response of type TaxRates array with TaxRates + */ + GetTaxRates(where: string | null | undefined, order: string | null | undefined, TaxType: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'TaxRates?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&TaxType=' + (TaxType == null ? '' : encodeURIComponent(TaxType)), {}); + } + + /** + * Allows you to create one or more Tax Rates + * Put TaxRates + * @param {TaxRates} requestBody TaxRates array with TaxRate object in body of request + * @return {TaxRates} Success - return response of type TaxRates array newly created TaxRate + */ + CreateTaxRates(requestBody: TaxRates): Observable { + return this.http.put(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update Tax Rates + * Post TaxRates + * @return {TaxRates} Success - return response of type TaxRates array updated TaxRate + */ + UpdateTaxRate(requestBody: TaxRates): Observable { + return this.http.post(this.baseUri + 'TaxRates', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve tracking categories and options + * Get TrackingCategories + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @param {boolean} includeArchived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response + * @return {TrackingCategories} Success - return response of type TrackingCategories array of TrackingCategory + */ + GetTrackingCategories(where: string | null | undefined, order: string | null | undefined, includeArchived: boolean | null | undefined): Observable { + return this.http.get(this.baseUri + 'TrackingCategories?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)) + '&includeArchived=' + includeArchived, {}); + } + + /** + * Allows you to create tracking categories + * Put TrackingCategories + * @param {TrackingCategory} requestBody TrackingCategory object in body of request + * @return {TrackingCategories} Success - return response of type TrackingCategories array of newly created TrackingCategory + */ + CreateTrackingCategory(requestBody: TrackingCategory): Observable { + return this.http.put(this.baseUri + 'TrackingCategories', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to retrieve tracking categories and options for specified category + * Get TrackingCategories/{TrackingCategoryID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @return {TrackingCategories} Success - return response of type TrackingCategories array of specified TrackingCategory + */ + GetTrackingCategory(TrackingCategoryID: string): Observable { + return this.http.get(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); + } + + /** + * Allows you to update tracking categories + * Post TrackingCategories/{TrackingCategoryID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @return {TrackingCategories} Success - return response of type TrackingCategories array of updated TrackingCategory + */ + UpdateTrackingCategory(TrackingCategoryID: string, requestBody: TrackingCategory): Observable { + return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete tracking categories + * Delete TrackingCategories/{TrackingCategoryID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @return {TrackingCategories} Success - return response of type TrackingCategories array of deleted TrackingCategory + */ + DeleteTrackingCategory(TrackingCategoryID: string): Observable { + return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)), {}); + } + + /** + * Allows you to create options for a specified tracking category + * Put TrackingCategories/{TrackingCategoryID}/Options + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @param {TrackingOption} requestBody TrackingOption object in body of request + * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category + */ + CreateTrackingOptions(TrackingCategoryID: string, requestBody: TrackingOption): Observable { + return this.http.put(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to update options for a specified tracking category + * Post TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @param {string} TrackingOptionID Unique identifier for a Tracking Option + * @return {TrackingOptions} Success - return response of type TrackingOptions array of options for a specified category + */ + UpdateTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string, requestBody: TrackingOption): Observable { + return this.http.post(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * Allows you to delete a specified option for a specified tracking category + * Delete TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} + * @param {string} TrackingCategoryID Unique identifier for a TrackingCategory + * @param {string} TrackingOptionID Unique identifier for a Tracking Option + * @return {TrackingOptions} Success - return response of type TrackingOptions array of remaining options for a specified category + */ + DeleteTrackingOptions(TrackingCategoryID: string, TrackingOptionID: string): Observable { + return this.http.delete(this.baseUri + 'TrackingCategories/' + (TrackingCategoryID == null ? '' : encodeURIComponent(TrackingCategoryID)) + '/Options/' + (TrackingOptionID == null ? '' : encodeURIComponent(TrackingOptionID)), {}); + } + + /** + * Allows you to retrieve users + * Get Users + * @param {string} where Filter by an any element + * @param {string} order Order by an any element + * @return {Users} Success - return response of type Users array of all User + */ + GetUsers(where: string | null | undefined, order: string | null | undefined): Observable { + return this.http.get(this.baseUri + 'Users?where=' + (where == null ? '' : encodeURIComponent(where)) + '&order=' + (order == null ? '' : encodeURIComponent(order)), {}); + } + + /** + * Allows you to retrieve a specified user + * Get Users/{UserID} + * @param {string} UserID Unique identifier for a User + * @return {Users} Success - return response of type Users array of specified User + */ + GetUser(UserID: string): Observable { + return this.http.get(this.baseUri + 'Users/' + (UserID == null ? '' : encodeURIComponent(UserID)), {}); + } + } + + export enum GetReportBalanceSheetTimeframe { MONTH = 0, QUARTER = 1, YEAR = 2 } + +} + diff --git a/Tests/SwagTsTests/NG2Results/xero_assets.txt b/Tests/SwagTsTests/NG2Results/xero_assets.ts similarity index 96% rename from Tests/SwagTsTests/NG2Results/xero_assets.txt rename to Tests/SwagTsTests/NG2Results/xero_assets.ts index 9d712bc2..2c72abca 100644 --- a/Tests/SwagTsTests/NG2Results/xero_assets.txt +++ b/Tests/SwagTsTests/NG2Results/xero_assets.ts @@ -1,383 +1,383 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface Assets { - pagination?: Pagination; - items?: Array; - } - - export interface Asset { - - /** The Xero-generated Id for the asset */ - assetId?: string | null; - - /** - * The name of the asset - * Required - */ - assetName: string; - - /** The Xero-generated Id for the asset type */ - assetTypeId?: string | null; - - /** Must be unique. */ - assetNumber?: string | null; - - /** - * The date the asset was purchased YYYY-MM-DD - * Type: DateOnly - */ - purchaseDate?: Date | null; - - /** - * The purchase price of the asset - * Type: double - */ - purchasePrice?: number | null; - - /** - * The price the asset was disposed at - * Type: double - */ - disposalPrice?: number | null; - - /** See Asset Status Codes. */ - assetStatus?: AssetAssetStatus | null; - - /** The date the asset’s warranty expires (if needed) YYYY-MM-DD */ - warrantyExpiryDate?: string | null; - - /** The asset's serial number */ - serialNumber?: string | null; - bookDepreciationSetting?: BookDepreciationSetting; - bookDepreciationDetail?: BookDepreciationDetail; - - /** Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. */ - canRollback?: boolean | null; - - /** - * The accounting value of the asset - * Type: double - */ - accountingBookValue?: number | null; - - /** Boolean to indicate whether delete is enabled */ - isDeleteEnabledForDate?: boolean | null; - } - - export enum AssetAssetStatus { Draft = 0, Registered = 1, Disposed = 2 } - - export interface Pagination { - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - page?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageSize?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - pageCount?: number | null; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - itemCount?: number | null; - } - - - /** See Asset Status Codes. */ - export enum AssetStatus { Draft = 0, Registered = 1, Disposed = 2 } - - - /** See Asset Status Codes. */ - export enum AssetStatusQueryParam { DRAFT = 0, REGISTERED = 1, DISPOSED = 2 } - - export interface AssetType { - - /** Xero generated unique identifier for asset types */ - assetTypeId?: string | null; - - /** - * The name of the asset type - * Required - */ - assetTypeName: string; - - /** The asset account for fixed assets of this type */ - fixedAssetAccountId?: string | null; - - /** The expense account for the depreciation of fixed assets of this type */ - depreciationExpenseAccountId?: string | null; - - /** The account for accumulated depreciation of fixed assets of this type */ - accumulatedDepreciationAccountId?: string | null; - - /** Required */ - bookDepreciationSetting: BookDepreciationSetting; - - /** - * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - locks?: number | null; - } - - export interface BookDepreciationSetting { - - /** The method of depreciation applied to this asset. See Depreciation Methods */ - depreciationMethod?: BookDepreciationSettingDepreciationMethod | null; - - /** The method of averaging applied to this asset. See Averaging Methods */ - averagingMethod?: BookDepreciationSettingAveragingMethod | null; - - /** - * The rate of depreciation (e.g. 0.05) - * Type: double - */ - depreciationRate?: number | null; - - /** - * Effective life of the asset in years (e.g. 5) - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - effectiveLifeYears?: number | null; - - /** See Depreciation Calculation Methods */ - depreciationCalculationMethod?: BookDepreciationSettingDepreciationCalculationMethod | null; - - /** Unique Xero identifier for the depreciable object */ - depreciableObjectId?: string | null; - - /** The type of asset object */ - depreciableObjectType?: string | null; - - /** Unique Xero identifier for the effective date change */ - bookEffectiveDateOfChangeId?: string | null; - } - - export enum BookDepreciationSettingDepreciationMethod { NoDepreciation = 0, StraightLine = 1, DiminishingValue100 = 2, DiminishingValue150 = 3, DiminishingValue200 = 4, FullDepreciation = 5 } - - export enum BookDepreciationSettingAveragingMethod { FullMonth = 0, ActualDays = 1 } - - export enum BookDepreciationSettingDepreciationCalculationMethod { Rate = 0, Life = 1, None = 2 } - - export interface BookDepreciationDetail { - - /** - * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. - * Type: double - */ - currentCapitalGain?: number | null; - - /** - * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. - * Type: double - */ - currentGainLoss?: number | null; - - /** - * YYYY-MM-DD - * Type: DateOnly - */ - depreciationStartDate?: Date | null; - - /** - * The value of the asset you want to depreciate, if this is less than the cost of the asset. - * Type: double - */ - costLimit?: number | null; - - /** - * The value of the asset remaining when you've fully depreciated it. - * Type: double - */ - residualValue?: number | null; - - /** - * All depreciation prior to the current financial year. - * Type: double - */ - priorAccumDepreciationAmount?: number | null; - - /** - * All depreciation occurring in the current financial year. - * Type: double - */ - currentAccumDepreciationAmount?: number | null; - } - - export interface Setting { - - /** The prefix used for fixed asset numbers (“FA-” by default) */ - assetNumberPrefix?: string | null; - - /** The next available sequence number */ - assetNumberSequence?: string | null; - - /** - * The date depreciation calculations started on registered fixed assets in Xero - * Type: DateOnly - */ - assetStartDate?: Date | null; - - /** - * The last depreciation date - * Type: DateOnly - */ - lastDepreciationDate?: Date | null; - - /** Default account that gains are posted to */ - defaultGainOnDisposalAccountId?: string | null; - - /** Default account that losses are posted to */ - defaultLossOnDisposalAccountId?: string | null; - - /** Default account that capital gains are posted to */ - defaultCapitalGainOnDisposalAccountId?: string | null; - - /** opt in for tax calculation */ - optInForTax?: boolean | null; - } - - export interface Error { - - /** Array of elements of resource validation errors */ - resourceValidationErrors?: Array; - - /** Array of elements of field validation errors */ - fieldValidationErrors?: Array; - - /** The internal type of error, not accessible externally */ - type?: string | null; - - /** Title of the error */ - title?: string | null; - - /** Detail of the error */ - detail?: string | null; - } - - export interface ResourceValidationErrorsElement { - - /** The field name of the erroneous field */ - resourceName?: string | null; - - /** Explaination of the resource validation error */ - localisedMessage?: string | null; - - /** Internal type of the resource error message */ - type?: string | null; - - /** Title of the resource validation error */ - title?: string | null; - - /** Detail of the resource validation error */ - detail?: string | null; - } - - export interface FieldValidationErrorsElement { - - /** The field name of the erroneous field */ - fieldName?: string | null; - - /** The provided value */ - valueProvided?: string | null; - - /** Explaination of the field validation error */ - localisedMessage?: string | null; - - /** Internal type of the field validation error message */ - type?: string | null; - - /** Title of the field validation error */ - title?: string | null; - - /** Detail of the field validation error */ - detail?: string | null; - } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches fixed asset - * By passing in the appropriate options, you can search for available fixed asset in the system - * Get Assets - * @param {AssetStatusQueryParam} status Required when retrieving a collection of assets. See Asset Status Codes - * @param {number} page Results are paged. This specifies which page of the results to return. The default page is 1. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} pageSize The number of records returned per page. By default the number of records returned is 10. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {GetAssetsOrderBy} orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. - * @param {GetAssetsSortDirection} sortDirection ASC or DESC - * @param {GetAssetsFilterBy} filterBy A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. - * @return {Assets} search results matching criteria - */ - GetAssets(status: AssetStatusQueryParam, page: number | null | undefined, pageSize: number | null | undefined, orderBy: GetAssetsOrderBy | null | undefined, sortDirection: GetAssetsSortDirection | null | undefined, filterBy: GetAssetsFilterBy | null | undefined): Observable { - return this.http.get(this.baseUri + 'Assets?status=' + status + '&page=' + page + '&pageSize=' + pageSize + '&orderBy=' + orderBy + '&sortDirection=' + sortDirection + '&filterBy=' + filterBy, {}); - } - - /** - * adds a fixed asset - * Adds an asset to the system - * Post Assets - * @param {Asset} requestBody Fixed asset you are creating - * @return {Asset} return single object - create new asset - */ - CreateAsset(requestBody: Asset): Observable { - return this.http.post(this.baseUri + 'Assets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * retrieves fixed asset by id - * By passing in the appropriate asset id, you can search for - * a specific fixed asset in the system - * Get Assets/{id} - * @param {string} id fixed asset id for single object - * @return {Asset} search results matching criteria - */ - GetAssetById(id: string): Observable { - return this.http.get(this.baseUri + 'Assets/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * searches fixed asset types - * By passing in the appropriate options, you can search for available fixed asset types in the system - * Get AssetTypes - * @return {Array} search results matching criteria - */ - GetAssetTypes(): Observable> { - return this.http.get>(this.baseUri + 'AssetTypes', {}); - } - - /** - * adds a fixed asset type - * Adds an fixed asset type to the system - * Post AssetTypes - * @param {AssetType} requestBody Asset type to add - * @return {AssetType} results single object - created fixed type - */ - CreateAssetType(requestBody: AssetType): Observable { - return this.http.post(this.baseUri + 'AssetTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); - } - - /** - * searches fixed asset settings - * By passing in the appropriate options, you can search for available fixed asset types in the system - * Get Settings - * @return {Setting} search results matching criteria - */ - GetAssetSettings(): Observable { - return this.http.get(this.baseUri + 'Settings', {}); - } - } - - export enum GetAssetsOrderBy { AssetType = 0, AssetName = 1, AssetNumber = 2, PurchaseDate = 3, PurchasePrice = 4, DisposalDate = 5, DisposalPrice = 6 } - - export enum GetAssetsSortDirection { asc = 0, desc = 1 } - - export enum GetAssetsFilterBy { AssetName = 0, AssetNumber = 1, Description = 2, AssetTypeName = 3 } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface Assets { + pagination?: Pagination; + items?: Array; + } + + export interface Asset { + + /** The Xero-generated Id for the asset */ + assetId?: string | null; + + /** + * The name of the asset + * Required + */ + assetName: string; + + /** The Xero-generated Id for the asset type */ + assetTypeId?: string | null; + + /** Must be unique. */ + assetNumber?: string | null; + + /** + * The date the asset was purchased YYYY-MM-DD + * Type: DateOnly + */ + purchaseDate?: Date | null; + + /** + * The purchase price of the asset + * Type: double + */ + purchasePrice?: number | null; + + /** + * The price the asset was disposed at + * Type: double + */ + disposalPrice?: number | null; + + /** See Asset Status Codes. */ + assetStatus?: AssetAssetStatus | null; + + /** The date the asset’s warranty expires (if needed) YYYY-MM-DD */ + warrantyExpiryDate?: string | null; + + /** The asset's serial number */ + serialNumber?: string | null; + bookDepreciationSetting?: BookDepreciationSetting; + bookDepreciationDetail?: BookDepreciationDetail; + + /** Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. */ + canRollback?: boolean | null; + + /** + * The accounting value of the asset + * Type: double + */ + accountingBookValue?: number | null; + + /** Boolean to indicate whether delete is enabled */ + isDeleteEnabledForDate?: boolean | null; + } + + export enum AssetAssetStatus { Draft = 0, Registered = 1, Disposed = 2 } + + export interface Pagination { + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + page?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageSize?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + pageCount?: number | null; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + itemCount?: number | null; + } + + + /** See Asset Status Codes. */ + export enum AssetStatus { Draft = 0, Registered = 1, Disposed = 2 } + + + /** See Asset Status Codes. */ + export enum AssetStatusQueryParam { DRAFT = 0, REGISTERED = 1, DISPOSED = 2 } + + export interface AssetType { + + /** Xero generated unique identifier for asset types */ + assetTypeId?: string | null; + + /** + * The name of the asset type + * Required + */ + assetTypeName: string; + + /** The asset account for fixed assets of this type */ + fixedAssetAccountId?: string | null; + + /** The expense account for the depreciation of fixed assets of this type */ + depreciationExpenseAccountId?: string | null; + + /** The account for accumulated depreciation of fixed assets of this type */ + accumulatedDepreciationAccountId?: string | null; + + /** Required */ + bookDepreciationSetting: BookDepreciationSetting; + + /** + * All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + locks?: number | null; + } + + export interface BookDepreciationSetting { + + /** The method of depreciation applied to this asset. See Depreciation Methods */ + depreciationMethod?: BookDepreciationSettingDepreciationMethod | null; + + /** The method of averaging applied to this asset. See Averaging Methods */ + averagingMethod?: BookDepreciationSettingAveragingMethod | null; + + /** + * The rate of depreciation (e.g. 0.05) + * Type: double + */ + depreciationRate?: number | null; + + /** + * Effective life of the asset in years (e.g. 5) + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + effectiveLifeYears?: number | null; + + /** See Depreciation Calculation Methods */ + depreciationCalculationMethod?: BookDepreciationSettingDepreciationCalculationMethod | null; + + /** Unique Xero identifier for the depreciable object */ + depreciableObjectId?: string | null; + + /** The type of asset object */ + depreciableObjectType?: string | null; + + /** Unique Xero identifier for the effective date change */ + bookEffectiveDateOfChangeId?: string | null; + } + + export enum BookDepreciationSettingDepreciationMethod { NoDepreciation = 0, StraightLine = 1, DiminishingValue100 = 2, DiminishingValue150 = 3, DiminishingValue200 = 4, FullDepreciation = 5 } + + export enum BookDepreciationSettingAveragingMethod { FullMonth = 0, ActualDays = 1 } + + export enum BookDepreciationSettingDepreciationCalculationMethod { Rate = 0, Life = 1, None = 2 } + + export interface BookDepreciationDetail { + + /** + * When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. + * Type: double + */ + currentCapitalGain?: number | null; + + /** + * When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. + * Type: double + */ + currentGainLoss?: number | null; + + /** + * YYYY-MM-DD + * Type: DateOnly + */ + depreciationStartDate?: Date | null; + + /** + * The value of the asset you want to depreciate, if this is less than the cost of the asset. + * Type: double + */ + costLimit?: number | null; + + /** + * The value of the asset remaining when you've fully depreciated it. + * Type: double + */ + residualValue?: number | null; + + /** + * All depreciation prior to the current financial year. + * Type: double + */ + priorAccumDepreciationAmount?: number | null; + + /** + * All depreciation occurring in the current financial year. + * Type: double + */ + currentAccumDepreciationAmount?: number | null; + } + + export interface Setting { + + /** The prefix used for fixed asset numbers (“FA-” by default) */ + assetNumberPrefix?: string | null; + + /** The next available sequence number */ + assetNumberSequence?: string | null; + + /** + * The date depreciation calculations started on registered fixed assets in Xero + * Type: DateOnly + */ + assetStartDate?: Date | null; + + /** + * The last depreciation date + * Type: DateOnly + */ + lastDepreciationDate?: Date | null; + + /** Default account that gains are posted to */ + defaultGainOnDisposalAccountId?: string | null; + + /** Default account that losses are posted to */ + defaultLossOnDisposalAccountId?: string | null; + + /** Default account that capital gains are posted to */ + defaultCapitalGainOnDisposalAccountId?: string | null; + + /** opt in for tax calculation */ + optInForTax?: boolean | null; + } + + export interface Error { + + /** Array of elements of resource validation errors */ + resourceValidationErrors?: Array; + + /** Array of elements of field validation errors */ + fieldValidationErrors?: Array; + + /** The internal type of error, not accessible externally */ + type?: string | null; + + /** Title of the error */ + title?: string | null; + + /** Detail of the error */ + detail?: string | null; + } + + export interface ResourceValidationErrorsElement { + + /** The field name of the erroneous field */ + resourceName?: string | null; + + /** Explaination of the resource validation error */ + localisedMessage?: string | null; + + /** Internal type of the resource error message */ + type?: string | null; + + /** Title of the resource validation error */ + title?: string | null; + + /** Detail of the resource validation error */ + detail?: string | null; + } + + export interface FieldValidationErrorsElement { + + /** The field name of the erroneous field */ + fieldName?: string | null; + + /** The provided value */ + valueProvided?: string | null; + + /** Explaination of the field validation error */ + localisedMessage?: string | null; + + /** Internal type of the field validation error message */ + type?: string | null; + + /** Title of the field validation error */ + title?: string | null; + + /** Detail of the field validation error */ + detail?: string | null; + } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches fixed asset + * By passing in the appropriate options, you can search for available fixed asset in the system + * Get Assets + * @param {AssetStatusQueryParam} status Required when retrieving a collection of assets. See Asset Status Codes + * @param {number} page Results are paged. This specifies which page of the results to return. The default page is 1. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} pageSize The number of records returned per page. By default the number of records returned is 10. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {GetAssetsOrderBy} orderBy Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + * @param {GetAssetsSortDirection} sortDirection ASC or DESC + * @param {GetAssetsFilterBy} filterBy A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. + * @return {Assets} search results matching criteria + */ + GetAssets(status: AssetStatusQueryParam, page: number | null | undefined, pageSize: number | null | undefined, orderBy: GetAssetsOrderBy | null | undefined, sortDirection: GetAssetsSortDirection | null | undefined, filterBy: GetAssetsFilterBy | null | undefined): Observable { + return this.http.get(this.baseUri + 'Assets?status=' + status + '&page=' + page + '&pageSize=' + pageSize + '&orderBy=' + orderBy + '&sortDirection=' + sortDirection + '&filterBy=' + filterBy, {}); + } + + /** + * adds a fixed asset + * Adds an asset to the system + * Post Assets + * @param {Asset} requestBody Fixed asset you are creating + * @return {Asset} return single object - create new asset + */ + CreateAsset(requestBody: Asset): Observable { + return this.http.post(this.baseUri + 'Assets', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * retrieves fixed asset by id + * By passing in the appropriate asset id, you can search for + * a specific fixed asset in the system + * Get Assets/{id} + * @param {string} id fixed asset id for single object + * @return {Asset} search results matching criteria + */ + GetAssetById(id: string): Observable { + return this.http.get(this.baseUri + 'Assets/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * searches fixed asset types + * By passing in the appropriate options, you can search for available fixed asset types in the system + * Get AssetTypes + * @return {Array} search results matching criteria + */ + GetAssetTypes(): Observable> { + return this.http.get>(this.baseUri + 'AssetTypes', {}); + } + + /** + * adds a fixed asset type + * Adds an fixed asset type to the system + * Post AssetTypes + * @param {AssetType} requestBody Asset type to add + * @return {AssetType} results single object - created fixed type + */ + CreateAssetType(requestBody: AssetType): Observable { + return this.http.post(this.baseUri + 'AssetTypes', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' } }); + } + + /** + * searches fixed asset settings + * By passing in the appropriate options, you can search for available fixed asset types in the system + * Get Settings + * @return {Setting} search results matching criteria + */ + GetAssetSettings(): Observable { + return this.http.get(this.baseUri + 'Settings', {}); + } + } + + export enum GetAssetsOrderBy { AssetType = 0, AssetName = 1, AssetNumber = 2, PurchaseDate = 3, PurchasePrice = 4, DisposalDate = 5, DisposalPrice = 6 } + + export enum GetAssetsSortDirection { asc = 0, desc = 1 } + + export enum GetAssetsFilterBy { AssetName = 0, AssetNumber = 1, Description = 2, AssetTypeName = 3 } + +} + diff --git a/Tests/SwagTsTests/NG2Results/xero_bankfeeds.txt b/Tests/SwagTsTests/NG2Results/xero_bankfeeds.ts similarity index 98% rename from Tests/SwagTsTests/NG2Results/xero_bankfeeds.txt rename to Tests/SwagTsTests/NG2Results/xero_bankfeeds.ts index 7c7c4365..6eb408b1 100644 --- a/Tests/SwagTsTests/NG2Results/xero_bankfeeds.txt +++ b/Tests/SwagTsTests/NG2Results/xero_bankfeeds.ts @@ -1,331 +1,331 @@ -import { Injectable, Inject } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; -import { Observable } from 'rxjs'; -export namespace MyNS { - export interface FeedConnections { - pagination?: Pagination; - items?: Array; - } - - export interface Pagination { - - /** - * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - page?: number | null; - - /** - * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageSize?: number | null; - - /** - * Number of pages available - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - pageCount?: number | null; - - /** - * Number of items returned - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - itemCount?: number | null; - } - - export interface FeedConnection { - - /** GUID used to identify the Account. */ - id?: string | null; - - /** - * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. - * Maximum: 50 - */ - accountToken?: string | null; - - /** - * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. - * Maximum: 40 - */ - accountNumber?: string | null; - - /** - * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. - * Maximum: 30 - */ - accountName?: string | null; - - /** Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. */ - accountId?: string | null; - - /** High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. */ - accountType?: FeedConnectionAccountType | null; - - /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ - currency?: FeedConnectionCurrency | null; - - /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ - country?: FeedConnectionCountry | null; - - /** the current status of the feed connection */ - status?: FeedConnectionStatus | null; - - /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ - error?: Error; - } - - export enum FeedConnectionAccountType { BANK = 0, CREDITCARD = 1 } - - export enum FeedConnectionCurrency { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - export enum FeedConnectionCountry { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - export enum FeedConnectionStatus { PENDING = 0, REJECTED = 1 } - - - /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ - export interface Error { - - /** - * Human readable high level error description. - * Maximum: 255 - */ - title?: string | null; - - /** - * The numeric HTTP Status Code, e.g. 404 - * Type: int, -2,147,483,648 to 2,147,483,647 - */ - status?: number | null; - - /** - * Human readable detailed error description. - * Maximum: 255 - */ - detail?: string | null; - - /** Identifies the type of error. */ - type?: ErrorType | null; - } - - export enum ErrorType { 'invalid-request' = 0, 'invalid-application' = 1, 'invalid-feed-connection' = 2, 'duplicate-statement' = 3, 'invalid-end-balance' = 4, 'invalid-start-and-end-date' = 5, 'invalid-start-date' = 6, 'internal-error' = 7, 'feed-already-connected-in-current-organisation' = 8 } - - export interface Statements { - pagination?: Pagination; - items?: Array; - } - - export interface Statement { - - /** GUID used to identify the Statement. */ - id?: string | null; - - /** The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. */ - feedConnectionId?: string | null; - - /** Current status of statements */ - status?: StatementStatus | null; - - /** - * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - startDate?: Date | null; - - /** - * Closing balance date ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - endDate?: Date | null; - - /** The starting balance of the statement */ - startBalance?: StartBalance; - - /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ - endBalance?: EndBalance; - statementLines?: Array; - errors?: Array; - - /** Type: int, -2,147,483,648 to 2,147,483,647 */ - statementLineCount?: number | null; - } - - export enum StatementStatus { PENDING = 0, REJECTED = 1, DELIVERED = 2 } - - - /** The starting balance of the statement */ - export interface StartBalance { - - /** - * decimal(19,4) unsigned Opening/closing balance amount. - * Type: double - */ - amount?: number | null; - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; - } - - export enum StartBalanceCreditDebitIndicator { CREDIT = 0, DEBIT = 1 } - - - /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ - export interface EndBalance { - - /** Type: double */ - amount?: number | null; - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; - } - - - /** the lines details for a statement */ - export interface StatementLine { - - /** - * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD - * Type: DateOnly - */ - postedDate?: Date | null; - - /** - * Transaction description - * Maximum: 2000 - */ - description?: string | null; - - /** - * Transaction amount - * Type: double - */ - amount?: number | null; - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; - - /** Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. */ - transactionId?: string | null; - - /** - * Typically the merchant or payee name - * Maximum: 255 - */ - payeeName?: string | null; - - /** - * Optional field to enhance the Description - * Maximum: 255 - */ - reference?: string | null; - - /** - * The cheque/check number - * Maximum: 20 - */ - chequeNumber?: string | null; - } - - - /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ - export enum CreditDebitIndicator { CREDIT = 0, DEBIT = 1 } - - - /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ - export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } - - - /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ - export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } - - @Injectable() - export class MyClient { - constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { - } - - /** - * searches feed connections - * By passing in the appropriate options, you can search for available feed connections in the system. - * Get FeedConnections - * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {void} - */ - GetFeedConnections(page: number | null | undefined, pageSize: number | null | undefined): Observable> { - return this.http.get(this.baseUri + 'FeedConnections?page=' + page + '&pageSize=' + pageSize, { observe: 'response', responseType: 'text' }); - } - - /** - * create one or more new feed connection - * By passing in the FeedConnections array object in the body, you can create one or more new feed connections - * Post FeedConnections - * @param {FeedConnections} requestBody Feed Connection(s) array object in the body - * @return {void} - */ - CreateFeedConnections(requestBody: FeedConnections): Observable> { - return this.http.post(this.baseUri + 'FeedConnections', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrive single feed connection based on unique id provided - * By passing in a FeedConnection Id options, you can search for matching feed connections - * Get FeedConnections/{id} - * @param {string} id Unique identifier for retrieving single object - * @return {FeedConnection} success returns a FeedConnection object matching the id in response - */ - GetFeedConnection(id: string): Observable { - return this.http.get(this.baseUri + 'FeedConnections/' + (id == null ? '' : encodeURIComponent(id)), {}); - } - - /** - * Delete an exsiting feed connection - * By passing in FeedConnections array object in the body, you can delete a feed connection. - * Post FeedConnections/DeleteRequests - * @param {FeedConnections} requestBody Feed Connections array object in the body - * @return {void} - */ - DeleteFeedConnections(requestBody: FeedConnections): Observable> { - return this.http.post(this.baseUri + 'FeedConnections/DeleteRequests', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrive all statements based on unique search criteria - * By passing in parameters, you can search for matching statements - * Get Statements - * @param {number} page unique id for single object - * Type: int, -2,147,483,648 to 2,147,483,647 - * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. - * Type: int, -2,147,483,648 to 2,147,483,647 - * @return {Statements} success returns Statements array of objects response - */ - GetStatements(page: number | null | undefined, pageSize: number | null | undefined): Observable { - return this.http.get(this.baseUri + 'Statements?page=' + page + '&pageSize=' + pageSize, {}); - } - - /** - * Post Statements - * @param {Statements} requestBody Statements array of objects in the body - * @return {void} - */ - CreateStatements(requestBody: Statements): Observable> { - return this.http.post(this.baseUri + 'Statements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); - } - - /** - * Retrive single statement based on unique id provided - * By passing in a statement id, you can search for matching statements - * Get Statements/{statementId} - * @param {string} statementId statement id for single object - * @return {Statement} search results matching id for single statement - */ - GetStatement(statementId: string): Observable { - return this.http.get(this.baseUri + 'Statements/' + (statementId == null ? '' : encodeURIComponent(statementId)), {}); - } - } - -} - +import { Injectable, Inject } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { Observable } from 'rxjs'; +export namespace MyNS { + export interface FeedConnections { + pagination?: Pagination; + items?: Array; + } + + export interface Pagination { + + /** + * Page number which specifies the set of records to retrieve. Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?page=2 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + page?: number | null; + + /** + * Page size which specifies how many records per page will be returned (default 50). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageSize?: number | null; + + /** + * Number of pages available + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + pageCount?: number | null; + + /** + * Number of items returned + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + itemCount?: number | null; + } + + export interface FeedConnection { + + /** GUID used to identify the Account. */ + id?: string | null; + + /** + * This account identifier is generated by the financial institute (FI). This must be unique for your financial institute. + * Maximum: 50 + */ + accountToken?: string | null; + + /** + * String(40) when AccountType is BANK String(4) when AccountType is CREDITCARD The Account Number is used to match the feed to a Xero Bank Account. The API will create a new Xero Bank Account if a match to an existing Xero Bank Account is not found. Only the last 4 digits must be supplied for Credit Card numbers. Must be included if AccountId is not specified. + * Maximum: 40 + */ + accountNumber?: string | null; + + /** + * The Account Name will be used for the creation of a new Xero Bank Account if a matching Xero Bank Account is not found. + * Maximum: 30 + */ + accountName?: string | null; + + /** Xero identifier for a bank account in Xero. Must be included if AccountNumber is not specified. */ + accountId?: string | null; + + /** High level bank account type - BANK CREDITCARD BANK encompasses all bank account types other than credit cards. */ + accountType?: FeedConnectionAccountType | null; + + /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ + currency?: FeedConnectionCurrency | null; + + /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ + country?: FeedConnectionCountry | null; + + /** the current status of the feed connection */ + status?: FeedConnectionStatus | null; + + /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ + error?: Error; + } + + export enum FeedConnectionAccountType { BANK = 0, CREDITCARD = 1 } + + export enum FeedConnectionCurrency { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + export enum FeedConnectionCountry { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + export enum FeedConnectionStatus { PENDING = 0, REJECTED = 1 } + + + /** On error, the API consumer will receive an HTTP response with a HTTP Status Code of 4xx or 5xx and a Content-Type of application/problem+json. */ + export interface Error { + + /** + * Human readable high level error description. + * Maximum: 255 + */ + title?: string | null; + + /** + * The numeric HTTP Status Code, e.g. 404 + * Type: int, -2,147,483,648 to 2,147,483,647 + */ + status?: number | null; + + /** + * Human readable detailed error description. + * Maximum: 255 + */ + detail?: string | null; + + /** Identifies the type of error. */ + type?: ErrorType | null; + } + + export enum ErrorType { 'invalid-request' = 0, 'invalid-application' = 1, 'invalid-feed-connection' = 2, 'duplicate-statement' = 3, 'invalid-end-balance' = 4, 'invalid-start-and-end-date' = 5, 'invalid-start-date' = 6, 'internal-error' = 7, 'feed-already-connected-in-current-organisation' = 8 } + + export interface Statements { + pagination?: Pagination; + items?: Array; + } + + export interface Statement { + + /** GUID used to identify the Statement. */ + id?: string | null; + + /** The Xero generated feed connection Id that identifies the Xero Bank Account Container into which the statement should be delivered. This is obtained by calling GET FeedConnections. */ + feedConnectionId?: string | null; + + /** Current status of statements */ + status?: StatementStatus | null; + + /** + * Opening balance date (can be no older than one year from the current date) ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + startDate?: Date | null; + + /** + * Closing balance date ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + endDate?: Date | null; + + /** The starting balance of the statement */ + startBalance?: StartBalance; + + /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ + endBalance?: EndBalance; + statementLines?: Array; + errors?: Array; + + /** Type: int, -2,147,483,648 to 2,147,483,647 */ + statementLineCount?: number | null; + } + + export enum StatementStatus { PENDING = 0, REJECTED = 1, DELIVERED = 2 } + + + /** The starting balance of the statement */ + export interface StartBalance { + + /** + * decimal(19,4) unsigned Opening/closing balance amount. + * Type: double + */ + amount?: number | null; + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; + } + + export enum StartBalanceCreditDebitIndicator { CREDIT = 0, DEBIT = 1 } + + + /** The StartBalance plus all the Statement Line Amounts should be equal to the EndBalance Amount. */ + export interface EndBalance { + + /** Type: double */ + amount?: number | null; + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; + } + + + /** the lines details for a statement */ + export interface StatementLine { + + /** + * The date that the transaction was processed or cleared as seen in internet banking ISO-8601 YYYY-MM-DD + * Type: DateOnly + */ + postedDate?: Date | null; + + /** + * Transaction description + * Maximum: 2000 + */ + description?: string | null; + + /** + * Transaction amount + * Type: double + */ + amount?: number | null; + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + creditDebitIndicator?: StartBalanceCreditDebitIndicator | null; + + /** Financial institute's internal transaction identifier. If provided this field is factored into duplicate detection. */ + transactionId?: string | null; + + /** + * Typically the merchant or payee name + * Maximum: 255 + */ + payeeName?: string | null; + + /** + * Optional field to enhance the Description + * Maximum: 255 + */ + reference?: string | null; + + /** + * The cheque/check number + * Maximum: 20 + */ + chequeNumber?: string | null; + } + + + /** If the statement balances are credit or debit, the CreditDebitIndicator should be specified from the perspective of the Customer. */ + export enum CreditDebitIndicator { CREDIT = 0, DEBIT = 1 } + + + /** 3 letter alpha code for the ISO-4217 currency code, e.g. USD, AUD. */ + export enum CurrencyCode { AED = 0, AFN = 1, ALL = 2, AMD = 3, ANG = 4, AOA = 5, ARS = 6, AUD = 7, AWG = 8, AZN = 9, BAM = 10, BBD = 11, BDT = 12, BGN = 13, BHD = 14, BIF = 15, BMD = 16, BND = 17, BOB = 18, BRL = 19, BSD = 20, BTN = 21, BWP = 22, BYN = 23, BZD = 24, CAD = 25, CDF = 26, CHF = 27, CLP = 28, CNY = 29, COP = 30, CRC = 31, CUC = 32, CUP = 33, CVE = 34, CZK = 35, DJF = 36, DKK = 37, DOP = 38, DZD = 39, EGP = 40, ERN = 41, ETB = 42, EUR = 43, FJD = 44, FKP = 45, GBP = 46, GEL = 47, GGP = 48, GHS = 49, GIP = 50, GMD = 51, GNF = 52, GTQ = 53, GYD = 54, HKD = 55, HNL = 56, HRK = 57, HTG = 58, HUF = 59, IDR = 60, ILS = 61, IMP = 62, INR = 63, IQD = 64, IRR = 65, ISK = 66, JEP = 67, JMD = 68, JOD = 69, JPY = 70, KES = 71, KGS = 72, KHR = 73, KMF = 74, KPW = 75, KRW = 76, KWD = 77, KYD = 78, KZT = 79, LAK = 80, LBP = 81, LKR = 82, LRD = 83, LSL = 84, LYD = 85, MAD = 86, MDL = 87, MGA = 88, MKD = 89, MMK = 90, MNT = 91, MOP = 92, MRU = 93, MUR = 94, MVR = 95, MWK = 96, MXN = 97, MYR = 98, MZN = 99, NAD = 100, NGN = 101, NIO = 102, NOK = 103, NPR = 104, NZD = 105, OMR = 106, PAB = 107, PEN = 108, PGK = 109, PHP = 110, PKR = 111, PLN = 112, PYG = 113, QAR = 114, RON = 115, RSD = 116, RUB = 117, RWF = 118, SAR = 119, SBD = 120, SCR = 121, SDG = 122, SEK = 123, SGD = 124, SHP = 125, SLL = 126, SOS = 127, SPL = 128, SRD = 129, STN = 130, SVC = 131, SYP = 132, SZL = 133, THB = 134, TJS = 135, TMT = 136, TND = 137, TOP = 138, TRY = 139, TTD = 140, TVD = 141, TWD = 142, TZS = 143, UAH = 144, UGX = 145, USD = 146, UYU = 147, UZS = 148, VEF = 149, VND = 150, VUV = 151, WST = 152, XAF = 153, XCD = 154, XDR = 155, XOF = 156, XPF = 157, YER = 158, ZAR = 159, ZMW = 160, ZMK = 161, ZWD = 162, '' = 163 } + + + /** ISO-3166 alpha-2 country code, e.g. US, AU This element is required only when the Application supports multi-region. Talk to your Partner Manager to confirm if this is the case. */ + export enum CountryCode { AD = 0, AE = 1, AF = 2, AG = 3, AI = 4, AL = 5, AM = 6, AN = 7, AO = 8, AQ = 9, AR = 10, AS = 11, AT = 12, AU = 13, AW = 14, AZ = 15, BA = 16, BB = 17, BD = 18, BE = 19, BF = 20, BG = 21, BH = 22, BI = 23, BJ = 24, BL = 25, BM = 26, BN = 27, BO = 28, BR = 29, BS = 30, BT = 31, BW = 32, BY = 33, BZ = 34, CA = 35, CC = 36, CD = 37, CF = 38, CG = 39, CH = 40, CI = 41, CK = 42, CL = 43, CM = 44, CN = 45, CO = 46, CR = 47, CU = 48, CV = 49, CW = 50, CX = 51, CY = 52, CZ = 53, DE = 54, DJ = 55, DK = 56, DM = 57, DO = 58, DZ = 59, EC = 60, EE = 61, EG = 62, EH = 63, ER = 64, ES = 65, ET = 66, FI = 67, FJ = 68, FK = 69, FM = 70, FO = 71, FR = 72, GA = 73, GB = 74, GD = 75, GE = 76, GG = 77, GH = 78, GI = 79, GL = 80, GM = 81, GN = 82, GQ = 83, GR = 84, GT = 85, GU = 86, GW = 87, GY = 88, HK = 89, HN = 90, HR = 91, HT = 92, HU = 93, ID = 94, IE = 95, IL = 96, IM = 97, IN = 98, IO = 99, IQ = 100, IR = 101, IS = 102, IT = 103, JE = 104, JM = 105, JO = 106, JP = 107, KE = 108, KG = 109, KH = 110, KI = 111, KM = 112, KN = 113, KP = 114, KR = 115, KW = 116, KY = 117, KZ = 118, LA = 119, LB = 120, LC = 121, LI = 122, LK = 123, LR = 124, LS = 125, LT = 126, LU = 127, LV = 128, LY = 129, MA = 130, MC = 131, MD = 132, ME = 133, MF = 134, MG = 135, MH = 136, MK = 137, ML = 138, MM = 139, MN = 140, MO = 141, MP = 142, MR = 143, MS = 144, MT = 145, MU = 146, MV = 147, MW = 148, MX = 149, MY = 150, MZ = 151, NA = 152, NC = 153, NE = 154, NG = 155, NI = 156, NL = 157, NO = 158, NP = 159, NR = 160, NU = 161, NZ = 162, OM = 163, PA = 164, PE = 165, PF = 166, PG = 167, PH = 168, PK = 169, PL = 170, PM = 171, PN = 172, PR = 173, PS = 174, PT = 175, PW = 176, PY = 177, QA = 178, RE = 179, RO = 180, RS = 181, RU = 182, RW = 183, SA = 184, SB = 185, SC = 186, SD = 187, SE = 188, SG = 189, SH = 190, SI = 191, SJ = 192, SK = 193, SL = 194, SM = 195, SN = 196, SO = 197, SR = 198, SS = 199, ST = 200, SV = 201, SX = 202, SY = 203, SZ = 204, TC = 205, TD = 206, TG = 207, TH = 208, TJ = 209, TK = 210, TL = 211, TM = 212, TN = 213, TO = 214, TR = 215, TT = 216, TV = 217, TW = 218, TZ = 219, UA = 220, UG = 221, US = 222, UY = 223, UZ = 224, VA = 225, VC = 226, VE = 227, VG = 228, VI = 229, VN = 230, VU = 231, WF = 232, WS = 233, XK = 234, YE = 235, YT = 236, ZA = 237, ZM = 238, ZW = 239 } + + @Injectable() + export class MyClient { + constructor(@Inject('baseUri') private baseUri: string = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + '/', private http: HttpClient) { + } + + /** + * searches feed connections + * By passing in the appropriate options, you can search for available feed connections in the system. + * Get FeedConnections + * @param {number} page Page number which specifies the set of records to retrieve. By default the number of the records per set is 10. Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?page=1 to get the second set of the records. When page value is not a number or a negative number, by default, the first set of records is returned. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/FeedConnections?pageSize=100 to specify page size of 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {void} + */ + GetFeedConnections(page: number | null | undefined, pageSize: number | null | undefined): Observable> { + return this.http.get(this.baseUri + 'FeedConnections?page=' + page + '&pageSize=' + pageSize, { observe: 'response', responseType: 'text' }); + } + + /** + * create one or more new feed connection + * By passing in the FeedConnections array object in the body, you can create one or more new feed connections + * Post FeedConnections + * @param {FeedConnections} requestBody Feed Connection(s) array object in the body + * @return {void} + */ + CreateFeedConnections(requestBody: FeedConnections): Observable> { + return this.http.post(this.baseUri + 'FeedConnections', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrive single feed connection based on unique id provided + * By passing in a FeedConnection Id options, you can search for matching feed connections + * Get FeedConnections/{id} + * @param {string} id Unique identifier for retrieving single object + * @return {FeedConnection} success returns a FeedConnection object matching the id in response + */ + GetFeedConnection(id: string): Observable { + return this.http.get(this.baseUri + 'FeedConnections/' + (id == null ? '' : encodeURIComponent(id)), {}); + } + + /** + * Delete an exsiting feed connection + * By passing in FeedConnections array object in the body, you can delete a feed connection. + * Post FeedConnections/DeleteRequests + * @param {FeedConnections} requestBody Feed Connections array object in the body + * @return {void} + */ + DeleteFeedConnections(requestBody: FeedConnections): Observable> { + return this.http.post(this.baseUri + 'FeedConnections/DeleteRequests', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrive all statements based on unique search criteria + * By passing in parameters, you can search for matching statements + * Get Statements + * @param {number} page unique id for single object + * Type: int, -2,147,483,648 to 2,147,483,647 + * @param {number} pageSize Page size which specifies how many records per page will be returned (default 10). Example - https://api.xero.com/bankfeeds.xro/1.0/Statements?pageSize=100 to specify page size of 100. + * Type: int, -2,147,483,648 to 2,147,483,647 + * @return {Statements} success returns Statements array of objects response + */ + GetStatements(page: number | null | undefined, pageSize: number | null | undefined): Observable { + return this.http.get(this.baseUri + 'Statements?page=' + page + '&pageSize=' + pageSize, {}); + } + + /** + * Post Statements + * @param {Statements} requestBody Statements array of objects in the body + * @return {void} + */ + CreateStatements(requestBody: Statements): Observable> { + return this.http.post(this.baseUri + 'Statements', JSON.stringify(requestBody), { headers: { 'Content-Type': 'application/json;charset=UTF-8' }, observe: 'response', responseType: 'text' }); + } + + /** + * Retrive single statement based on unique id provided + * By passing in a statement id, you can search for matching statements + * Get Statements/{statementId} + * @param {string} statementId statement id for single object + * @return {Statement} search results matching id for single statement + */ + GetStatement(statementId: string): Observable { + return this.http.get(this.baseUri + 'Statements/' + (statementId == null ? '' : encodeURIComponent(statementId)), {}); + } + } + +} + diff --git a/Tests/SwagTsTests/SwagTsTests.csproj b/Tests/SwagTsTests/SwagTsTests.csproj index ad00ed3b..da5af378 100644 --- a/Tests/SwagTsTests/SwagTsTests.csproj +++ b/Tests/SwagTsTests/SwagTsTests.csproj @@ -7,6 +7,7 @@ false true + true